[Xorg] Composite and ABI stability

Soeren Sandmann sandmann at daimi.au.dk
Fri Aug 6 11:33:19 PDT 2004

In bug 990, Eric Anholt reports that X server compiled with COMPOSITE
produce wrong colors and suspects that this is cause alphaMask and
alphaOffset in Visuals are not initialized.

This is correct; modfiying the i830 driver to initialize those fields
does make the problem go away. However, there is a bigger problem than

typedef struct _Visual {
    VisualID		vid;
    short		class;
    short		bitsPerRGBValue;
    short		ColormapEntries;
    short		nplanes;/* = log2 (ColormapEntries). This does not
				 * imply that the screen has this many planes.
				 * it may have more or fewer */
    unsigned long	redMask, greenMask, blueMask;
    int			offsetRed, offsetGreen, offsetBlue;
    unsigned long	alphaMask;
    int			offsetAlpha;
  } VisualRec;

The two added fields break binary compatibility because drivers are
passed arrays of Visuals though screens and are expected to initialize
them. There is a similar problem with Pixmaps which also get two
additional fields. 

If we are guaranteeing binary compatibility with existing drivers,
this has to be done in a different way.

Some possible solutions:

        1. In compinit.c simply initialzie all the existing alpha
           masks to 0. This will break compatibility and prevent
           hardware from advertising its own alpha visuals

        2. Fix all drivers to initialize the fields properly. This
           will break compatibility in the Composite case. 

        3. Rework the way composite has been integrated to now change
           the size of Visuals and Pixmaps and make composite 
           responsible for initializing the new fields.

To me, 3 seems the right solution, but I could be wrong.


More information about the xorg mailing list