diff options
author | yuchenlin <yuchenlin@synology.com> | 2018-11-07 11:47:13 +0800 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2018-11-20 20:49:15 +0100 |
commit | d021868ccf49e2a39664021909354ef1150b0a6d (patch) | |
tree | 6fb4594a821f377d7aa80567fc93d78ccdb177d0 /OvmfPkg | |
parent | 330e18555cd246465e0229e1daa1a72287d3274d (diff) | |
download | edk2-d021868ccf49e2a39664021909354ef1150b0a6d.zip edk2-d021868ccf49e2a39664021909354ef1150b0a6d.tar.gz edk2-d021868ccf49e2a39664021909354ef1150b0a6d.tar.bz2 |
OvmfPkg: simply use the Bochs interface for vmsvga
BAR | std vga | vmsvga
---------------------------------
0 | Framebuffer | I/O space
1 | Reserved | Framebuffer
2 | MMIO | FIFO
- We cannot recognize VMW SVGA as BOCHS because that would confuse the
IsQxl setting in QemuVideoControllerDriverStart(),
- We cannot recognize VMW SVGA as BOCHS_MMIO because BAR2 on VMW SVGA is
not the BOCHS MMIO BAR (we can only use port IO).
Therefore the list of reasons for which we should introduce
QEMU_VIDEO_VMWARE_SVGA should name three reasons:
(1) Get framebuffer from correct PCI BAR
(2) Prevent using BAR2 for MMIO
(3) Prevent mis-recognizing VMW SVGA as QXL
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>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/QemuVideoDxe/Driver.c | 16 | ||||
-rw-r--r-- | OvmfPkg/QemuVideoDxe/Gop.c | 2 | ||||
-rw-r--r-- | OvmfPkg/QemuVideoDxe/Qemu.h | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c index 2304afd..8e02700 100644 --- a/OvmfPkg/QemuVideoDxe/Driver.c +++ b/OvmfPkg/QemuVideoDxe/Driver.c @@ -70,6 +70,12 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = { QEMU_VIDEO_BOCHS_MMIO,
L"QEMU VirtIO VGA"
},{
+ PCI_CLASS_DISPLAY_VGA,
+ 0x15ad,
+ 0x0405,
+ QEMU_VIDEO_VMWARE_SVGA,
+ L"QEMU VMWare SVGA"
+ },{
0 /* end of list */
}
};
@@ -317,6 +323,14 @@ QemuVideoControllerDriverStart ( }
//
+ // VMWare SVGA is handled like Bochs (with port IO only).
+ //
+ if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
+ Private->Variant = QEMU_VIDEO_BOCHS;
+ Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;
+ }
+
+ //
// Check if accessing the bochs interface works.
//
if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO ||
@@ -764,7 +778,7 @@ ClearScreen ( Private->PciIo->Mem.Write (
Private->PciIo,
EfiPciIoWidthFillUint32,
- 0,
+ Private->FrameBufferVramBarIndex,
0,
0x400000 >> 2,
&Color
diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c index d490fa7..6f542d9 100644 --- a/OvmfPkg/QemuVideoDxe/Gop.c +++ b/OvmfPkg/QemuVideoDxe/Gop.c @@ -60,7 +60,7 @@ QemuVideoCompleteModeData ( Private->PciIo->GetBarAttributes (
Private->PciIo,
- 0,
+ Private->FrameBufferVramBarIndex,
NULL,
(VOID**) &FrameBufDesc
);
diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h b/OvmfPkg/QemuVideoDxe/Qemu.h index d7da761..3aac9ee 100644 --- a/OvmfPkg/QemuVideoDxe/Qemu.h +++ b/OvmfPkg/QemuVideoDxe/Qemu.h @@ -92,6 +92,7 @@ typedef enum { QEMU_VIDEO_CIRRUS_5446,
QEMU_VIDEO_BOCHS,
QEMU_VIDEO_BOCHS_MMIO,
+ QEMU_VIDEO_VMWARE_SVGA,
} QEMU_VIDEO_VARIANT;
typedef struct {
@@ -120,6 +121,7 @@ typedef struct { QEMU_VIDEO_VARIANT Variant;
FRAME_BUFFER_CONFIGURE *FrameBufferBltConfigure;
UINTN FrameBufferBltConfigureSize;
+ UINT8 FrameBufferVramBarIndex;
} QEMU_VIDEO_PRIVATE_DATA;
///
|