Looking at the spec, and based on what you're seeing, I suspect what's being emulated is the GD5446 revision B.bloodline wrote: During PCI Bus Enumeration I can find the gfx board which Qemu emulates, and I'm going to use that to test writing PCI based driver code. I've found the Tech Doc for the QEmu graphics chip (the Cirrus Logic GD5446), http://www.vgamuseum.info/index.php/cpu ... 42814695bc
On page 67, this helpfully (though vaguely) lists all the available hardware regs, but I'm confused as to how to access them. The table give an I/O Port address, some of which appear to match up with the PCI Configuration register address/offsets. I'm having trouble picturing how this works as I'm used to hardware registers just sitting in the normal address space.
-Edit- I might have jumped the gun a bit here... So BAR0 is the framebuffer address. BAR1 is 0, but BAR2 is an address 32megs above the framebuffer... Is it possible the hardware registers are mapped here?
This maps BAR0 as the linear framebuffer, but based on section 9.2.7.3, this is mapped as 4MByte apertures into the framebuffer (the chip only supports 4MB of VRAM.)
[*] 0-4MB - No byte swapping.
[*] 4-8MB - 16-bit word byte swapping.
[*] 8-12MB - 32-bit work byte swapping.
[*] 12-16MB - Video aparture.
Each aperture can map the MMIO interface to the bitblt engine in the last 256 bytes of fb memory.
So your driver interface, on x86, would use the first aperture (no byte swapping), and reference bitblt engine using either the IO region (BAR2?) or enable the MMIO into the FB.
All that said, why not enable a better display option in QEMU? You're unlikely to be running this on real hardware GD5446, so why write a driver for it? And virtio-vga also provides better capabilities.