From 212aac55fd13e985cebf88042f40479c01ac2e44 Mon Sep 17 00:00:00 2001 From: jljusten Date: Tue, 27 Nov 2012 19:11:11 +0000 Subject: QemuVideo: prepare to support more hardware Move to a table-driven hardware detection. Add a table with PCI IDs, card name and variant enum. Use the table for hardware detection and initialization. Rename Cirrus-specific data and code to carry "cirrus" in the name. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gerd Hoffmann Reviewed-by: Laszlo Ersek Reviewed-by: Jordan Justen git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13967 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/QemuVideoDxe/Initialize.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'OvmfPkg/QemuVideoDxe/Initialize.c') diff --git a/OvmfPkg/QemuVideoDxe/Initialize.c b/OvmfPkg/QemuVideoDxe/Initialize.c index 2491733df9..a369e22988 100644 --- a/OvmfPkg/QemuVideoDxe/Initialize.c +++ b/OvmfPkg/QemuVideoDxe/Initialize.c @@ -143,7 +143,7 @@ UINT16 Seq_1024_768_32bpp_60[15] = { /// /// Table of supported video modes /// -QEMU_VIDEO_VIDEO_MODES QemuVideoVideoModes[] = { +QEMU_VIDEO_CIRRUS_MODES QemuVideoCirrusModes[] = { // { 640, 480, 8, 60, Crtc_640_480_256_60, Seq_640_480_256_60, 0xe3 }, // { 800, 600, 8, 60, Crtc_800_600_256_60, Seq_800_600_256_60, 0xef }, { 640, 480, 32, 60, Crtc_640_480_32bpp_60, Seq_640_480_32bpp_60, 0xef }, @@ -154,38 +154,38 @@ QEMU_VIDEO_VIDEO_MODES QemuVideoVideoModes[] = { // { 960, 720, 32, 60, Crtc_960_720_32bpp_60, Seq_1024_768_32bpp_60, 0xef } }; -#define QEMU_VIDEO_MODE_COUNT \ - (sizeof (QemuVideoVideoModes) / sizeof (QemuVideoVideoModes[0])) +#define QEMU_VIDEO_CIRRUS_MODE_COUNT \ + (sizeof (QemuVideoCirrusModes) / sizeof (QemuVideoCirrusModes[0])) /** Construct the valid video modes for QemuVideo. **/ EFI_STATUS -QemuVideoVideoModeSetup ( +QemuVideoCirrusModeSetup ( QEMU_VIDEO_PRIVATE_DATA *Private ) { UINT32 Index; QEMU_VIDEO_MODE_DATA *ModeData; - QEMU_VIDEO_VIDEO_MODES *VideoMode; + QEMU_VIDEO_CIRRUS_MODES *VideoMode; // // Setup Video Modes // Private->ModeData = AllocatePool ( - sizeof (Private->ModeData[0]) * QEMU_VIDEO_MODE_COUNT + sizeof (Private->ModeData[0]) * QEMU_VIDEO_CIRRUS_MODE_COUNT ); ModeData = Private->ModeData; - VideoMode = &QemuVideoVideoModes[0]; - for (Index = 0; Index < QEMU_VIDEO_MODE_COUNT; Index ++) { + VideoMode = &QemuVideoCirrusModes[0]; + for (Index = 0; Index < QEMU_VIDEO_CIRRUS_MODE_COUNT; Index ++) { ModeData->ModeNumber = Index; ModeData->HorizontalResolution = VideoMode->Width; ModeData->VerticalResolution = VideoMode->Height; ModeData->ColorDepth = VideoMode->ColorDepth; ModeData->RefreshRate = VideoMode->RefreshRate; DEBUG ((EFI_D_INFO, - "Adding Video Mode %d: %dx%d, %d-bit, %d Hz\n", + "Adding Cirrus Video Mode %d: %dx%d, %d-bit, %d Hz\n", ModeData->ModeNumber, ModeData->HorizontalResolution, ModeData->VerticalResolution, @@ -196,7 +196,7 @@ QemuVideoVideoModeSetup ( ModeData ++ ; VideoMode ++; } - Private->MaxMode = QEMU_VIDEO_MODE_COUNT; + Private->MaxMode = QEMU_VIDEO_CIRRUS_MODE_COUNT; return EFI_SUCCESS; } -- cgit v1.2.3