Bi-Endian issue

Laurent Lagrange lagrange at
Thu Nov 30 00:42:04 PST 2006

> -----Message d'origine-----
> De : Michel Dänzer [mailto:michel at]
> Envoyé : mer. 29 novembre 2006 09:31
> À : Laurent Lagrange
> Cc : xorg at
> Objet : Re: Bi-Endian issue
> On Tue, 2006-11-28 at 18:26 +0100, Laurent Lagrange wrote: 
> > I am writing a DDX driver for my graphics card and I have 
> endian problems. I
> > work on a powerpc (big endian) with a pci graphics card 
> (little endian
> > framebuffer). My board doesn't have endian conversion flags 
> and this leads
> > to bad colors.
> > 
> > Is there a way to describe in my driver the bi-endian 
> configuration ? How
> > can I correctly handle byte swapping, without patching 
> (I use
> > 6.8.2 and I can't recompile it).
> I'm afraid the only option is to use a shadow framebuffer in system
> memory and fix the byte order on copying the data to the real
> framebuffer. This will unfortunately prevent hardware acceleration for
> rendering but not for things like hardware cursor or video overlay.

My driver has XAA acceleration and I don't want to lose it. I can handle byte ordering in the XAA rendering functions, but my problem is with every drawing operation which don't use XAA. For example, OpenGL with mesa (in software).

As I said earlier I can not patch and recompile the whole server. Nevertheless, I can modify the modules. My driver relies on fbdevhw and fb modules. Would it be possible to patch a module and build a new one specific to my graphics card ?

In xc/programs/Xserver/include/servermd.h, there are two defines IMAGE_BYTE_ORDER and BITMAP_BIT_ORDER. They are set to MSB for my powerpc. In xc/programs/Xserver/fb/fbbits.c, those defines are used. If I patch the fb module, is it enough to solve my problem ?


More information about the xorg mailing list