On Mon, Jan 23, 2012 at 12:30:31PM +0100, Gerd Hoffmann wrote:
The vmware vga emulated by qemu has a I/O region in pci bar 0. The framebuffer is in pci bar 1. Handle that by checking the type of bar 0 in case it is a I/O bar use bar 1 instead.
Also make bochsbios report lfb size in debug output.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com
FYI - I updated this patch and added it to my repo.
-Kevin
commit b1d222d74bafe6190c3c16ca1f62f67835929abd Author: Kevin O'Connor kevin@koconnor.net Date: Sun Jan 29 11:53:59 2012 -0500
vgabios: handle vmware vga in bochsvga.
The vmware vga emulated by qemu has a I/O region in pci bar 0. The framebuffer is in pci bar 1. Handle that by checking the type of bar 0 in case it is a I/O bar use bar 1 instead.
Also make bochsbios report lfb size in debug output.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com Signed-off-by: Kevin O'Connor kevin@koconnor.net
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c index 6065f25..331cb4e 100644 --- a/vgasrc/bochsvga.c +++ b/vgasrc/bochsvga.c @@ -138,16 +138,25 @@ bochsvga_init(void)
u32 lfb_addr = VBE_DISPI_LFB_PHYSICAL_ADDRESS; int bdf = GET_GLOBAL(VgaBDF); - if (CONFIG_VGA_PCI && bdf >= 0) - lfb_addr = (pci_config_readl(bdf, PCI_BASE_ADDRESS_0) - & PCI_BASE_ADDRESS_MEM_MASK); + if (CONFIG_VGA_PCI && bdf >= 0) { + int barid = 0; + u32 bar = pci_config_readl(bdf, PCI_BASE_ADDRESS_0); + if ((bar & PCI_BASE_ADDRESS_SPACE) != PCI_BASE_ADDRESS_SPACE_MEMORY) { + barid = 1; + bar = pci_config_readl(bdf, PCI_BASE_ADDRESS_1); + } + lfb_addr = bar & PCI_BASE_ADDRESS_MEM_MASK; + dprintf(1, "VBE DISPI: bdf %02x:%02x.%x, bar %d\n", pci_bdf_to_bus(bdf) + , pci_bdf_to_dev(bdf), pci_bdf_to_fn(bdf), barid); + }
SET_VGA(VBE_framebuffer, lfb_addr); u16 totalmem = dispi_read(VBE_DISPI_INDEX_VIDEO_MEMORY_64K); SET_VGA(VBE_total_memory, totalmem * 64 * 1024); SET_VGA(VBE_capabilities, VBE_CAPABILITY_8BIT_DAC);
- dprintf(1, "VBE DISPI detected. lfb_addr=%x\n", lfb_addr); + dprintf(1, "VBE DISPI: lfb_addr=%x, size %d MB\n", + lfb_addr, totalmem / 16);
return 0; }