[PATCH] Add support for RENDER BGRA formats.

Michael macallan at netbsd.org
Sat Oct 31 11:57:23 PDT 2009


Hello,

On Oct 31, 2009, at 11:17 AM, Mark Kettenis wrote:

> Still struggling a bit with how to map BAR 5 though.  I have a hack to
> make things work, but I'll need to discuss the implications for the
> OpenBSD kernel and libpciaccess.

Assuming that OpenBSD is still more or less NetBSD-ish here :

in whateverfb_mmap():
#ifdef PCI_MAGIC_IO_RANGE
	/* allow mapping of IO space */
	if ((offset >= PCI_MAGIC_IO_RANGE) &&
	    (offset < PCI_MAGIC_IO_RANGE + 0x10000)) {
		pa = bus_space_mmap(sc->sc_iot, offset - PCI_MAGIC_IO_RANGE,
		    0, prot, BUS_SPACE_MAP_LINEAR);
		return pa;
	}
#endif

IO space on sparc64 is memory mapped, you can just hand the IO tag  
from pci_attach_args to bus_space_mmap(), pick a region that's safe  
for your architecture and map it at that offset through the wsdisplay  
file handle ( on sparc64 you'll probably want to pick something above  
4GB. On macppc for example we use 0xf2000000 because that's  
traditionally where the first PCI bridge puts its IO space. ). That  
way you also automatically get the right IO space if you have more  
than one. Yes, most PCI Suns implement considerably more than 64kB IO  
space but the firmware tries to cram everything into the lower 64KB  
anyway and you won't have many PCI devices with IO enabled either.
Or, to be more in line with libpciaccess, you can do that in  
pci_mmap() so each /dev/pci* entry would return the right IO space.

have fun
Michael



More information about the xorg-devel mailing list