aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc/bochsvga.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-01-29 11:53:59 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-02-01 20:42:06 -0500
commit2bd4531436cc7bf32186b1bf469ed01810044c0b (patch)
tree7282e3124e2c5ceffb06807a0539951e03112716 /vgasrc/bochsvga.c
parentd9211ee9e3b4b828424d6a32f5542f7ab012d33d (diff)
downloadseabios-2bd4531436cc7bf32186b1bf469ed01810044c0b.tar.gz
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>
Diffstat (limited to 'vgasrc/bochsvga.c')
-rw-r--r--vgasrc/bochsvga.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c
index 5770e106..e40a1fd5 100644
--- a/vgasrc/bochsvga.c
+++ b/vgasrc/bochsvga.c
@@ -139,16 +139,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;
}