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

Donald Kayser xorg at kayser.net
Fri Sep 18 07:09:14 PDT 2009


I have not looked into what wfb is yet, but from the comments from  
Michel, it would seem to support my notion that I don't want to do  
this in software. I personally think it would be too much overhead on  
software to accomplish every swap as data is written to the frame  
buffer.

I don't know what EXA is yet, so I will take some time today and study  
that section of X and see if those hooks work.

I have found a way to make this work, but I am not sure of the  
solution.  I found that I could use the function xf86SetAccessFuncs()  
to pass in  my own EnableAccess and DisableAccess functions. My  new  
functions do nothing to pci config, and all is working at the moment.

I will look into EXA.

Thanks again.

Donald

On Sep 18, 2009, at 8:53 AM, Michel Dänzer wrote:

> 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