2011-04-12 17:08:51 +02:00
|
|
|
/** @file
|
|
|
|
Graphics Output Protocol functions for the QEMU video controller.
|
|
|
|
|
2017-01-23 07:07:42 +01:00
|
|
|
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
|
2011-04-12 17:08:51 +02:00
|
|
|
|
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
2017-04-07 08:25:58 +02:00
|
|
|
#include <IndustryStandard/VmwareSvga.h>
|
2011-04-12 17:08:51 +02:00
|
|
|
#include "Qemu.h"
|
|
|
|
|
|
|
|
STATIC
|
|
|
|
VOID
|
|
|
|
QemuVideoCompleteModeInfo (
|
|
|
|
IN QEMU_VIDEO_MODE_DATA *ModeData,
|
|
|
|
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Info->Version = 0;
|
|
|
|
if (ModeData->ColorDepth == 8) {
|
|
|
|
Info->PixelFormat = PixelBitMask;
|
|
|
|
Info->PixelInformation.RedMask = PIXEL_RED_MASK;
|
|
|
|
Info->PixelInformation.GreenMask = PIXEL_GREEN_MASK;
|
|
|
|
Info->PixelInformation.BlueMask = PIXEL_BLUE_MASK;
|
|
|
|
Info->PixelInformation.ReservedMask = 0;
|
|
|
|
} else if (ModeData->ColorDepth == 24) {
|
|
|
|
Info->PixelFormat = PixelBitMask;
|
|
|
|
Info->PixelInformation.RedMask = PIXEL24_RED_MASK;
|
|
|
|
Info->PixelInformation.GreenMask = PIXEL24_GREEN_MASK;
|
|
|
|
Info->PixelInformation.BlueMask = PIXEL24_BLUE_MASK;
|
|
|
|
Info->PixelInformation.ReservedMask = 0;
|
|
|
|
} else if (ModeData->ColorDepth == 32) {
|
|
|
|
DEBUG ((EFI_D_INFO, "PixelBlueGreenRedReserved8BitPerColor\n"));
|
|
|
|
Info->PixelFormat = PixelBlueGreenRedReserved8BitPerColor;
|
|
|
|
}
|
|
|
|
Info->PixelsPerScanLine = Info->HorizontalResolution;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
STATIC
|
|
|
|
EFI_STATUS
|
|
|
|
QemuVideoCompleteModeData (
|
|
|
|
IN QEMU_VIDEO_PRIVATE_DATA *Private,
|
|
|
|
OUT EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode
|
|
|
|
)
|
|
|
|
{
|
|
|
|
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
|
|
|
|
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *FrameBufDesc;
|
|
|
|
QEMU_VIDEO_MODE_DATA *ModeData;
|
|
|
|
|
|
|
|
ModeData = &Private->ModeData[Mode->Mode];
|
|
|
|
Info = Mode->Info;
|
|
|
|
QemuVideoCompleteModeInfo (ModeData, Info);
|
|
|
|
|
|
|
|
Private->PciIo->GetBarAttributes (
|
|
|
|
Private->PciIo,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
(VOID**) &FrameBufDesc
|
|
|
|
);
|
|
|
|
|
|
|
|
Mode->FrameBufferBase = FrameBufDesc->AddrRangeMin;
|
|
|
|
Mode->FrameBufferSize = Info->HorizontalResolution * Info->VerticalResolution;
|
|
|
|
Mode->FrameBufferSize = Mode->FrameBufferSize * ((ModeData->ColorDepth + 7) / 8);
|
2015-07-28 20:33:23 +02:00
|
|
|
DEBUG ((EFI_D_INFO, "FrameBufferBase: 0x%Lx, FrameBufferSize: 0x%Lx\n",
|
|
|
|
Mode->FrameBufferBase, (UINT64)Mode->FrameBufferSize));
|
2011-04-12 17:08:51 +02:00
|
|
|
|
2013-11-20 23:31:14 +01:00
|
|
|
FreePool (FrameBufDesc);
|
2011-04-12 17:08:51 +02:00
|
|
|
return EFI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2017-04-07 08:25:58 +02:00
|
|
|
STATIC
|
|
|
|
EFI_STATUS
|
|
|
|
QemuVideoVmwareSvgaCompleteModeData (
|
|
|
|
IN QEMU_VIDEO_PRIVATE_DATA *Private,
|
|
|
|
OUT EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode
|
|
|
|
)
|
|
|
|
{
|
|
|
|
EFI_STATUS Status;
|
|
|
|
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
|
|
|
|
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *FrameBufDesc;
|
|
|
|
UINT32 BytesPerLine, FbOffset, BytesPerPixel;
|
|
|
|
|
|
|
|
Info = Mode->Info;
|
|
|
|
CopyMem (Info, &Private->VmwareSvgaModeInfo[Mode->Mode], sizeof (*Info));
|
|
|
|
BytesPerPixel = Private->ModeData[Mode->Mode].ColorDepth / 8;
|
|
|
|
BytesPerLine = Info->PixelsPerScanLine * BytesPerPixel;
|
|
|
|
|
|
|
|
FbOffset = VmwareSvgaRead (Private, VmwareSvgaRegFbOffset);
|
|
|
|
|
|
|
|
Status = Private->PciIo->GetBarAttributes (
|
|
|
|
Private->PciIo,
|
|
|
|
PCI_BAR_IDX1,
|
|
|
|
NULL,
|
|
|
|
(VOID**) &FrameBufDesc
|
|
|
|
);
|
|
|
|
if (EFI_ERROR (Status)) {
|
|
|
|
return EFI_DEVICE_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
Mode->FrameBufferBase = FrameBufDesc->AddrRangeMin + FbOffset;
|
|
|
|
Mode->FrameBufferSize = BytesPerLine * Info->VerticalResolution;
|
|
|
|
|
|
|
|
FreePool (FrameBufDesc);
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
2011-04-12 17:08:51 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// Graphics Output Protocol Member Functions
|
|
|
|
//
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
QemuVideoGraphicsOutputQueryMode (
|
|
|
|
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
|
|
|
IN UINT32 ModeNumber,
|
|
|
|
OUT UINTN *SizeOfInfo,
|
|
|
|
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
|
|
|
|
)
|
|
|
|
/*++
|
|
|
|
|
|
|
|
Routine Description:
|
|
|
|
|
|
|
|
Graphics Output protocol interface to query video mode
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
This - Protocol instance pointer.
|
|
|
|
ModeNumber - The mode number to return information on.
|
|
|
|
Info - Caller allocated buffer that returns information about ModeNumber.
|
|
|
|
SizeOfInfo - A pointer to the size, in bytes, of the Info buffer.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
EFI_SUCCESS - Mode information returned.
|
|
|
|
EFI_BUFFER_TOO_SMALL - The Info buffer was too small.
|
|
|
|
EFI_DEVICE_ERROR - A hardware error occurred trying to retrieve the video mode.
|
|
|
|
EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
|
|
|
|
EFI_INVALID_PARAMETER - One of the input args was NULL.
|
|
|
|
|
|
|
|
--*/
|
|
|
|
{
|
|
|
|
QEMU_VIDEO_PRIVATE_DATA *Private;
|
|
|
|
QEMU_VIDEO_MODE_DATA *ModeData;
|
|
|
|
|
|
|
|
Private = QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (This);
|
|
|
|
|
|
|
|
if (Info == NULL || SizeOfInfo == NULL || ModeNumber >= This->Mode->MaxMode) {
|
|
|
|
return EFI_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|
|
|
|
*Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
|
|
|
|
if (*Info == NULL) {
|
|
|
|
return EFI_OUT_OF_RESOURCES;
|
|
|
|
}
|
|
|
|
|
|
|
|
*SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
|
|
|
|
|
2017-04-07 08:25:58 +02:00
|
|
|
if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
|
|
|
|
CopyMem (*Info, &Private->VmwareSvgaModeInfo[ModeNumber], sizeof (**Info));
|
|
|
|
} else {
|
|
|
|
ModeData = &Private->ModeData[ModeNumber];
|
|
|
|
(*Info)->HorizontalResolution = ModeData->HorizontalResolution;
|
|
|
|
(*Info)->VerticalResolution = ModeData->VerticalResolution;
|
|
|
|
QemuVideoCompleteModeInfo (ModeData, *Info);
|
|
|
|
}
|
2011-04-12 17:08:51 +02:00
|
|
|
|
|
|
|
return EFI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
QemuVideoGraphicsOutputSetMode (
|
|
|
|
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
|
|
|
IN UINT32 ModeNumber
|
|
|
|
)
|
|
|
|
/*++
|
|
|
|
|
|
|
|
Routine Description:
|
|
|
|
|
|
|
|
Graphics Output protocol interface to set video mode
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
This - Protocol instance pointer.
|
|
|
|
ModeNumber - The mode number to be set.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
EFI_SUCCESS - Graphics mode was changed.
|
|
|
|
EFI_DEVICE_ERROR - The device had an error and could not complete the request.
|
|
|
|
EFI_UNSUPPORTED - ModeNumber is not supported by this device.
|
|
|
|
|
|
|
|
--*/
|
|
|
|
{
|
|
|
|
QEMU_VIDEO_PRIVATE_DATA *Private;
|
|
|
|
QEMU_VIDEO_MODE_DATA *ModeData;
|
2016-10-11 07:26:27 +02:00
|
|
|
RETURN_STATUS Status;
|
2011-04-12 17:08:51 +02:00
|
|
|
|
|
|
|
Private = QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (This);
|
|
|
|
|
|
|
|
if (ModeNumber >= This->Mode->MaxMode) {
|
|
|
|
return EFI_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
ModeData = &Private->ModeData[ModeNumber];
|
|
|
|
|
2012-11-27 20:11:11 +01:00
|
|
|
switch (Private->Variant) {
|
|
|
|
case QEMU_VIDEO_CIRRUS_5430:
|
|
|
|
case QEMU_VIDEO_CIRRUS_5446:
|
2014-03-03 09:40:59 +01:00
|
|
|
InitializeCirrusGraphicsMode (Private, &QemuVideoCirrusModes[ModeData->InternalModeIndex]);
|
2012-11-27 20:11:11 +01:00
|
|
|
break;
|
2012-11-27 20:11:45 +01:00
|
|
|
case QEMU_VIDEO_BOCHS_MMIO:
|
2012-11-27 20:11:29 +01:00
|
|
|
case QEMU_VIDEO_BOCHS:
|
2014-03-03 09:40:59 +01:00
|
|
|
InitializeBochsGraphicsMode (Private, &QemuVideoBochsModes[ModeData->InternalModeIndex]);
|
2012-11-27 20:11:29 +01:00
|
|
|
break;
|
2017-04-07 08:25:58 +02:00
|
|
|
case QEMU_VIDEO_VMWARE_SVGA:
|
|
|
|
InitializeVmwareSvgaGraphicsMode (
|
|
|
|
Private,
|
|
|
|
&QemuVideoBochsModes[ModeData->InternalModeIndex]
|
|
|
|
);
|
|
|
|
break;
|
2012-11-27 20:11:11 +01:00
|
|
|
default:
|
|
|
|
ASSERT (FALSE);
|
|
|
|
return EFI_DEVICE_ERROR;
|
|
|
|
}
|
2011-04-12 17:08:51 +02:00
|
|
|
|
|
|
|
This->Mode->Mode = ModeNumber;
|
|
|
|
This->Mode->Info->HorizontalResolution = ModeData->HorizontalResolution;
|
|
|
|
This->Mode->Info->VerticalResolution = ModeData->VerticalResolution;
|
|
|
|
This->Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
|
|
|
|
|
2017-04-07 08:25:58 +02:00
|
|
|
if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
|
|
|
|
QemuVideoVmwareSvgaCompleteModeData (Private, This->Mode);
|
|
|
|
} else {
|
|
|
|
QemuVideoCompleteModeData (Private, This->Mode);
|
|
|
|
}
|
2011-04-12 17:08:51 +02:00
|
|
|
|
2016-10-11 07:26:27 +02:00
|
|
|
//
|
2017-01-23 07:07:42 +01:00
|
|
|
// Re-initialize the frame buffer configure when mode changes.
|
2016-10-11 07:26:27 +02:00
|
|
|
//
|
2017-01-23 07:07:42 +01:00
|
|
|
Status = FrameBufferBltConfigure (
|
|
|
|
(VOID*) (UINTN) This->Mode->FrameBufferBase,
|
|
|
|
This->Mode->Info,
|
|
|
|
Private->FrameBufferBltConfigure,
|
|
|
|
&Private->FrameBufferBltConfigureSize
|
|
|
|
);
|
|
|
|
if (Status == RETURN_BUFFER_TOO_SMALL) {
|
|
|
|
//
|
|
|
|
// Frame buffer configure may be larger in new mode.
|
|
|
|
//
|
|
|
|
if (Private->FrameBufferBltConfigure != NULL) {
|
|
|
|
FreePool (Private->FrameBufferBltConfigure);
|
|
|
|
}
|
2016-10-11 07:26:27 +02:00
|
|
|
Private->FrameBufferBltConfigure =
|
|
|
|
AllocatePool (Private->FrameBufferBltConfigureSize);
|
2017-01-23 07:07:42 +01:00
|
|
|
ASSERT (Private->FrameBufferBltConfigure != NULL);
|
2016-10-11 07:26:27 +02:00
|
|
|
|
2017-01-23 07:07:42 +01:00
|
|
|
//
|
|
|
|
// Create the configuration for FrameBufferBltLib
|
|
|
|
//
|
|
|
|
Status = FrameBufferBltConfigure (
|
|
|
|
(VOID*) (UINTN) This->Mode->FrameBufferBase,
|
|
|
|
This->Mode->Info,
|
|
|
|
Private->FrameBufferBltConfigure,
|
|
|
|
&Private->FrameBufferBltConfigureSize
|
|
|
|
);
|
|
|
|
}
|
2016-10-11 07:26:27 +02:00
|
|
|
ASSERT (Status == RETURN_SUCCESS);
|
2011-04-12 17:08:51 +02:00
|
|
|
|
|
|
|
return EFI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
QemuVideoGraphicsOutputBlt (
|
|
|
|
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
|
|
|
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
|
|
|
|
IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
|
|
|
|
IN UINTN SourceX,
|
|
|
|
IN UINTN SourceY,
|
|
|
|
IN UINTN DestinationX,
|
|
|
|
IN UINTN DestinationY,
|
|
|
|
IN UINTN Width,
|
|
|
|
IN UINTN Height,
|
|
|
|
IN UINTN Delta
|
|
|
|
)
|
|
|
|
/*++
|
|
|
|
|
|
|
|
Routine Description:
|
|
|
|
|
|
|
|
Graphics Output protocol instance to block transfer for CirrusLogic device
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
|
|
|
|
This - Pointer to Graphics Output protocol instance
|
|
|
|
BltBuffer - The data to transfer to screen
|
|
|
|
BltOperation - The operation to perform
|
|
|
|
SourceX - The X coordinate of the source for BltOperation
|
|
|
|
SourceY - The Y coordinate of the source for BltOperation
|
|
|
|
DestinationX - The X coordinate of the destination for BltOperation
|
|
|
|
DestinationY - The Y coordinate of the destination for BltOperation
|
|
|
|
Width - The width of a rectangle in the blt rectangle in pixels
|
|
|
|
Height - The height of a rectangle in the blt rectangle in pixels
|
|
|
|
Delta - Not used for EfiBltVideoFill and EfiBltVideoToVideo operation.
|
|
|
|
If a Delta of 0 is used, the entire BltBuffer will be operated on.
|
|
|
|
If a subrectangle of the BltBuffer is used, then Delta represents
|
|
|
|
the number of bytes in a row of the BltBuffer.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
EFI_INVALID_PARAMETER - Invalid parameter passed in
|
|
|
|
EFI_SUCCESS - Blt operation success
|
|
|
|
|
|
|
|
--*/
|
|
|
|
{
|
|
|
|
EFI_STATUS Status;
|
|
|
|
EFI_TPL OriginalTPL;
|
2016-10-11 07:26:27 +02:00
|
|
|
QEMU_VIDEO_PRIVATE_DATA *Private;
|
2011-04-12 17:08:51 +02:00
|
|
|
|
2016-10-11 07:26:27 +02:00
|
|
|
Private = QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (This);
|
2011-04-12 17:08:51 +02:00
|
|
|
//
|
|
|
|
// We have to raise to TPL Notify, so we make an atomic write the frame buffer.
|
|
|
|
// We would not want a timer based event (Cursor, ...) to come in while we are
|
|
|
|
// doing this operation.
|
|
|
|
//
|
|
|
|
OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
|
|
|
|
|
|
|
|
switch (BltOperation) {
|
|
|
|
case EfiBltVideoToBltBuffer:
|
|
|
|
case EfiBltBufferToVideo:
|
|
|
|
case EfiBltVideoFill:
|
|
|
|
case EfiBltVideoToVideo:
|
2016-10-11 07:26:27 +02:00
|
|
|
Status = FrameBufferBlt (
|
|
|
|
Private->FrameBufferBltConfigure,
|
2011-04-12 17:08:51 +02:00
|
|
|
BltBuffer,
|
|
|
|
BltOperation,
|
|
|
|
SourceX,
|
|
|
|
SourceY,
|
|
|
|
DestinationX,
|
|
|
|
DestinationY,
|
|
|
|
Width,
|
|
|
|
Height,
|
|
|
|
Delta
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
Status = EFI_INVALID_PARAMETER;
|
|
|
|
ASSERT (FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
gBS->RestoreTPL (OriginalTPL);
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
QemuVideoGraphicsOutputConstructor (
|
|
|
|
QEMU_VIDEO_PRIVATE_DATA *Private
|
|
|
|
)
|
|
|
|
{
|
|
|
|
EFI_STATUS Status;
|
|
|
|
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
|
|
|
|
|
|
|
|
|
|
|
|
GraphicsOutput = &Private->GraphicsOutput;
|
|
|
|
GraphicsOutput->QueryMode = QemuVideoGraphicsOutputQueryMode;
|
|
|
|
GraphicsOutput->SetMode = QemuVideoGraphicsOutputSetMode;
|
|
|
|
GraphicsOutput->Blt = QemuVideoGraphicsOutputBlt;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Initialize the private data
|
|
|
|
//
|
|
|
|
Status = gBS->AllocatePool (
|
|
|
|
EfiBootServicesData,
|
|
|
|
sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE),
|
|
|
|
(VOID **) &Private->GraphicsOutput.Mode
|
|
|
|
);
|
|
|
|
if (EFI_ERROR (Status)) {
|
|
|
|
return Status;
|
|
|
|
}
|
2014-03-03 09:40:19 +01:00
|
|
|
|
2011-04-12 17:08:51 +02:00
|
|
|
Status = gBS->AllocatePool (
|
|
|
|
EfiBootServicesData,
|
|
|
|
sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
|
|
|
|
(VOID **) &Private->GraphicsOutput.Mode->Info
|
|
|
|
);
|
|
|
|
if (EFI_ERROR (Status)) {
|
2014-03-03 09:40:19 +01:00
|
|
|
goto FreeMode;
|
2011-04-12 17:08:51 +02:00
|
|
|
}
|
|
|
|
Private->GraphicsOutput.Mode->MaxMode = (UINT32) Private->MaxMode;
|
|
|
|
Private->GraphicsOutput.Mode->Mode = GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER;
|
2016-10-11 07:26:27 +02:00
|
|
|
Private->FrameBufferBltConfigure = NULL;
|
|
|
|
Private->FrameBufferBltConfigureSize = 0;
|
2011-04-12 17:08:51 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// Initialize the hardware
|
|
|
|
//
|
2014-03-03 09:40:19 +01:00
|
|
|
Status = GraphicsOutput->SetMode (GraphicsOutput, 0);
|
|
|
|
if (EFI_ERROR (Status)) {
|
|
|
|
goto FreeInfo;
|
|
|
|
}
|
|
|
|
|
2011-04-12 17:08:51 +02:00
|
|
|
DrawLogo (
|
|
|
|
Private,
|
|
|
|
Private->ModeData[Private->GraphicsOutput.Mode->Mode].HorizontalResolution,
|
|
|
|
Private->ModeData[Private->GraphicsOutput.Mode->Mode].VerticalResolution
|
|
|
|
);
|
|
|
|
|
|
|
|
return EFI_SUCCESS;
|
2014-03-03 09:40:19 +01:00
|
|
|
|
|
|
|
FreeInfo:
|
|
|
|
FreePool (Private->GraphicsOutput.Mode->Info);
|
|
|
|
|
|
|
|
FreeMode:
|
|
|
|
FreePool (Private->GraphicsOutput.Mode);
|
|
|
|
Private->GraphicsOutput.Mode = NULL;
|
|
|
|
|
|
|
|
return Status;
|
2011-04-12 17:08:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
QemuVideoGraphicsOutputDestructor (
|
|
|
|
QEMU_VIDEO_PRIVATE_DATA *Private
|
|
|
|
)
|
|
|
|
/*++
|
|
|
|
|
|
|
|
Routine Description:
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
--*/
|
|
|
|
{
|
2016-10-11 07:26:27 +02:00
|
|
|
if (Private->FrameBufferBltConfigure != NULL) {
|
|
|
|
FreePool (Private->FrameBufferBltConfigure);
|
|
|
|
}
|
|
|
|
|
2011-04-12 17:08:51 +02:00
|
|
|
if (Private->GraphicsOutput.Mode != NULL) {
|
|
|
|
if (Private->GraphicsOutput.Mode->Info != NULL) {
|
|
|
|
gBS->FreePool (Private->GraphicsOutput.Mode->Info);
|
|
|
|
}
|
|
|
|
gBS->FreePool (Private->GraphicsOutput.Mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
return EFI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|