Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"
This reverts commitc137d95081
. The VMWare SVGA model now -- since commit 104bd1dc70 in QEMU -- falls back to stdvga (that is, Bochs) if we don't setup VMWare SVGA FIFO. To simplify QemuVideoDxe, we don't intend to implement the VMWare SVGA FIFO setup feature. It means our current VMW SVGA driver code is basically dead. To simplify the problem, we will replace the old VMWare SVGA driver to Bochs interface. It should work on all QEMU version. The first step for using Bochs interface is to revert old driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: yuchenlin <yuchenlin@synology.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit98856a724c
) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
@@ -14,10 +14,8 @@
|
||||
|
||||
**/
|
||||
|
||||
#include <IndustryStandard/VmwareSvga.h>
|
||||
#include <IndustryStandard/Acpi.h>
|
||||
#include "Qemu.h"
|
||||
#include "UnalignedIoInternal.h"
|
||||
#include <IndustryStandard/Acpi.h>
|
||||
|
||||
EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding = {
|
||||
QemuVideoControllerDriverSupported,
|
||||
@@ -71,12 +69,6 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
|
||||
0x1050,
|
||||
QEMU_VIDEO_BOCHS_MMIO,
|
||||
L"QEMU VirtIO VGA"
|
||||
},{
|
||||
PCI_CLASS_DISPLAY_VGA,
|
||||
VMWARE_PCI_VENDOR_ID_VMWARE,
|
||||
VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2,
|
||||
QEMU_VIDEO_VMWARE_SVGA,
|
||||
L"QEMU VMWare SVGA"
|
||||
},{
|
||||
0 /* end of list */
|
||||
}
|
||||
@@ -264,7 +256,6 @@ QemuVideoControllerDriverStart (
|
||||
goto ClosePciIo;
|
||||
}
|
||||
Private->Variant = Card->Variant;
|
||||
Private->FrameBufferVramBarIndex = PCI_BAR_IDX0;
|
||||
|
||||
//
|
||||
// IsQxl is based on the detected Card->Variant, which at a later point might
|
||||
@@ -339,58 +330,6 @@ QemuVideoControllerDriverStart (
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check if accessing Vmware SVGA interface works
|
||||
//
|
||||
if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
|
||||
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *IoDesc;
|
||||
UINT32 TargetId;
|
||||
UINT32 SvgaIdRead;
|
||||
|
||||
IoDesc = NULL;
|
||||
Status = Private->PciIo->GetBarAttributes (
|
||||
Private->PciIo,
|
||||
PCI_BAR_IDX0,
|
||||
NULL,
|
||||
(VOID**) &IoDesc
|
||||
);
|
||||
if (EFI_ERROR (Status) ||
|
||||
IoDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_IO ||
|
||||
IoDesc->AddrRangeMin > MAX_UINT16 + 1 - (VMWARE_SVGA_VALUE_PORT + 4)) {
|
||||
if (IoDesc != NULL) {
|
||||
FreePool (IoDesc);
|
||||
}
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto RestoreAttributes;
|
||||
}
|
||||
Private->VmwareSvgaBasePort = (UINT16) IoDesc->AddrRangeMin;
|
||||
FreePool (IoDesc);
|
||||
|
||||
TargetId = VMWARE_SVGA_ID_2;
|
||||
while (TRUE) {
|
||||
VmwareSvgaWrite (Private, VmwareSvgaRegId, TargetId);
|
||||
SvgaIdRead = VmwareSvgaRead (Private, VmwareSvgaRegId);
|
||||
if ((SvgaIdRead == TargetId) || (TargetId <= VMWARE_SVGA_ID_0)) {
|
||||
break;
|
||||
}
|
||||
TargetId--;
|
||||
}
|
||||
|
||||
if (SvgaIdRead != TargetId) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"QemuVideo: QEMU_VIDEO_VMWARE_SVGA ID mismatch "
|
||||
"(got 0x%x, base address 0x%x)\n",
|
||||
SvgaIdRead,
|
||||
Private->VmwareSvgaBasePort
|
||||
));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto RestoreAttributes;
|
||||
}
|
||||
|
||||
Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;
|
||||
}
|
||||
|
||||
//
|
||||
// Get ParentDevicePath
|
||||
//
|
||||
@@ -446,9 +385,6 @@ QemuVideoControllerDriverStart (
|
||||
case QEMU_VIDEO_BOCHS:
|
||||
Status = QemuVideoBochsModeSetup (Private, IsQxl);
|
||||
break;
|
||||
case QEMU_VIDEO_VMWARE_SVGA:
|
||||
Status = QemuVideoVmwareSvgaModeSetup (Private);
|
||||
break;
|
||||
default:
|
||||
ASSERT (FALSE);
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
@@ -510,9 +446,6 @@ DestructQemuVideoGraphics:
|
||||
|
||||
FreeModeData:
|
||||
FreePool (Private->ModeData);
|
||||
if (Private->VmwareSvgaModeInfo != NULL) {
|
||||
FreePool (Private->VmwareSvgaModeInfo);
|
||||
}
|
||||
|
||||
UninstallGopDevicePath:
|
||||
gBS->UninstallProtocolInterface (Private->Handle,
|
||||
@@ -634,9 +567,6 @@ QemuVideoControllerDriverStop (
|
||||
);
|
||||
|
||||
FreePool (Private->ModeData);
|
||||
if (Private->VmwareSvgaModeInfo != NULL) {
|
||||
FreePool (Private->VmwareSvgaModeInfo);
|
||||
}
|
||||
gBS->UninstallProtocolInterface (Private->Handle,
|
||||
&gEfiDevicePathProtocolGuid, Private->GopDevicePath);
|
||||
FreePool (Private->GopDevicePath);
|
||||
@@ -834,7 +764,7 @@ ClearScreen (
|
||||
Private->PciIo->Mem.Write (
|
||||
Private->PciIo,
|
||||
EfiPciIoWidthFillUint32,
|
||||
Private->FrameBufferVramBarIndex,
|
||||
0,
|
||||
0,
|
||||
0x400000 >> 2,
|
||||
&Color
|
||||
@@ -971,38 +901,6 @@ BochsRead (
|
||||
return Data;
|
||||
}
|
||||
|
||||
VOID
|
||||
VmwareSvgaWrite (
|
||||
QEMU_VIDEO_PRIVATE_DATA *Private,
|
||||
UINT16 Register,
|
||||
UINT32 Value
|
||||
)
|
||||
{
|
||||
UnalignedIoWrite32 (
|
||||
Private->VmwareSvgaBasePort + VMWARE_SVGA_INDEX_PORT,
|
||||
Register
|
||||
);
|
||||
UnalignedIoWrite32 (
|
||||
Private->VmwareSvgaBasePort + VMWARE_SVGA_VALUE_PORT,
|
||||
Value
|
||||
);
|
||||
}
|
||||
|
||||
UINT32
|
||||
VmwareSvgaRead (
|
||||
QEMU_VIDEO_PRIVATE_DATA *Private,
|
||||
UINT16 Register
|
||||
)
|
||||
{
|
||||
UnalignedIoWrite32 (
|
||||
Private->VmwareSvgaBasePort + VMWARE_SVGA_INDEX_PORT,
|
||||
Register
|
||||
);
|
||||
return UnalignedIoRead32 (
|
||||
Private->VmwareSvgaBasePort + VMWARE_SVGA_VALUE_PORT
|
||||
);
|
||||
}
|
||||
|
||||
VOID
|
||||
VgaOutb (
|
||||
QEMU_VIDEO_PRIVATE_DATA *Private,
|
||||
@@ -1057,35 +955,6 @@ InitializeBochsGraphicsMode (
|
||||
ClearScreen (Private);
|
||||
}
|
||||
|
||||
VOID
|
||||
InitializeVmwareSvgaGraphicsMode (
|
||||
QEMU_VIDEO_PRIVATE_DATA *Private,
|
||||
QEMU_VIDEO_BOCHS_MODES *ModeData
|
||||
)
|
||||
{
|
||||
UINT32 Capabilities;
|
||||
|
||||
VmwareSvgaWrite (Private, VmwareSvgaRegWidth, ModeData->Width);
|
||||
VmwareSvgaWrite (Private, VmwareSvgaRegHeight, ModeData->Height);
|
||||
|
||||
Capabilities = VmwareSvgaRead (
|
||||
Private,
|
||||
VmwareSvgaRegCapabilities
|
||||
);
|
||||
if ((Capabilities & VMWARE_SVGA_CAP_8BIT_EMULATION) != 0) {
|
||||
VmwareSvgaWrite (
|
||||
Private,
|
||||
VmwareSvgaRegBitsPerPixel,
|
||||
ModeData->ColorDepth
|
||||
);
|
||||
}
|
||||
|
||||
VmwareSvgaWrite (Private, VmwareSvgaRegEnable, 1);
|
||||
|
||||
SetDefaultPalette (Private);
|
||||
ClearScreen (Private);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeQemuVideo (
|
||||
|
Reference in New Issue
Block a user