PCI rework

Mark Kettenis mark.kettenis at xs4all.nl
Sun Apr 30 05:22:24 PDT 2006


> I've just posted my first set of patches for my PCI rework.  Right now
> this just patches the core server and the MGA driver.  These patches
> require that libpciaccess be built and installed like all the other X libs.

> http://users.freedesktop.org/~idr/pci_cleanup/

Matthieu Herb, asked me to have a look at libpciaccess some time ago.
My conclusion then was that it is too tightly bound to Linux.  It
takes the Linux sysfs pci access interface as a model instead of the
actual pci hardware.  I especially feel the support to map memory
associated with the PCI BAR's does not belong in the library.  It is
not impossible to implement the libpciaccess backend for other
operating systems, but it would be rather awkward.

Looking at your patch I see that changes to the drivers are mostly
changes like:

-    *pucByte = pciReadByte(pMga->PciTag,ulOffset);
+    pci_device_cfg_read_u8( pMga->PciInfo, pucByte, ulOffset );

So basically this is just replacing the current interfaces with the
equivalent libpciaccess interfaces.  Why not keep the current current
interfaces and reimplement them to use libpciaccess in the
Linux-specific Xorg code?  I really don't see any major flaws in the
current xf86Pci.h interfaces, but I agree that some of the
implementation could use some cleanup.

Oh, and I really think you shouldn't change the coding style.  Those
extra spaces after the the '(' are just plain ugly ;-).

Mark



More information about the xorg mailing list