From: jljusten Date: Tue, 30 Jun 2009 15:57:33 +0000 (+0000) Subject: Do not update the GL-GD5446 DRAM Control register during X-Git-Tag: edk2-stable201903~17617 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=85f8bc32d4e358670b946327a7cb03594ba34938 Do not update the GL-GD5446 DRAM Control register during InitializeGraphicsMode. The update of this register would cause the xorg-cirrus driver to mis-detect the size of video memory for the QEMU cirrus video device. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8690 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c b/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c index a248847273..8b01f8c435 100644 --- a/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c +++ b/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c @@ -770,6 +770,20 @@ InitializeGraphicsMode ( { UINT8 Byte; UINTN Index; + UINT16 DeviceId; + + // + // Read the PCI Configuration Header from the PCI Device + // + ASSERT_EFI_ERROR ( + Private->PciIo->Pci.Read ( + Private->PciIo, + EfiPciIoWidthUint16, + PCI_DEVICE_ID_OFFSET, + 1, + &DeviceId + ) + ); outw (Private, SEQ_ADDRESS_REGISTER, 0x1206); outw (Private, SEQ_ADDRESS_REGISTER, 0x0012); @@ -778,9 +792,11 @@ InitializeGraphicsMode ( outw (Private, SEQ_ADDRESS_REGISTER, ModeData->SeqSettings[Index]); } - outb (Private, SEQ_ADDRESS_REGISTER, 0x0f); - Byte = (UINT8) ((inb (Private, SEQ_DATA_REGISTER) & 0xc7) ^ 0x30); - outb (Private, SEQ_DATA_REGISTER, Byte); + if (DeviceId != CIRRUS_LOGIC_5446_DEVICE_ID) { + outb (Private, SEQ_ADDRESS_REGISTER, 0x0f); + Byte = (UINT8) ((inb (Private, SEQ_DATA_REGISTER) & 0xc7) ^ 0x30); + outb (Private, SEQ_DATA_REGISTER, Byte); + } outb (Private, MISC_OUTPUT_REGISTER, ModeData->MiscSetting); outw (Private, GRAPH_ADDRESS_REGISTER, 0x0506);