xf86-video-chips: pci access byte swapped under powerpc

Michel Dänzer michel at daenzer.net
Fri Sep 18 06:53:48 PDT 2009

On Fri, 2009-09-18 at 09:26 +1000, Daniel Stone wrote: 
> On Thu, Sep 17, 2009 at 11:06:21AM -0500, Donald Kayser wrote:
> > I have been rewriting the xf86-video-chips to enable independent  
> > monitors. My system is PPC, and on the C&T 69030 you can configure the  
> > frame buffer for big endian. What I have discovered is that not only  
> > does it swap bytes for the frame buffer, but pci configuration is also  
> > byte swapped, and this causes problems that I am working around.
> > 
> > This is an issue when the mouse pointer moves from one chips's screen  
> > to the next chip's screen. I have debugged it to the point where the  
> > code in xf86pciBus.c - initPciState() has shown me what is going on.  
> > When the mouse moves from on screen to the next, the pci configuration  
> > is written to - it is disabling the pci config io for one card and  
> > enabling the pci config io for the next card. Since this data  is now  
> > swapped, it kills the chip when configuring the pci data.
> > 
> > Since I have two chips on this platform and it is configured for MMIO,  
> > there is no need to reconfigure the pci configuration. I am looking  
> > for a way to override the pci access, or at least be notified of  
> > pending access so that I can set the configuration back to little  
> > endian until the access is complete.
> > 
> > Any suggestions?
> Instead of having the chip swap everything, you could always just use
> wfb (call wfbInitScreen instead of fbInitScreen and pass your
> preparation methods), and have a handler which did the swapping in
> software.

However, beware that wfb can be extremely slow, as the wrapper functions
will be called for each word of an operation, in extreme cases even for
each byte.

Donald, instead of leaving byte swapping enabled by default and
disabling it when it hurts, have you considered leaving it disabled by
default and only enabling it when necessary? This is easy to achieve
e.g. with EXA via Prepare/FinishAccess driver hooks.

Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer

More information about the xorg-devel mailing list