Composite Wrapper in unified tree

Deron Johnson Deron.Johnson at Sun.COM
Tue Feb 14 15:55:04 PST 2006



Keith Packard wrote On 02/12/06 18:55,:
> I'm trying to build kdrive in the newly unified xserver/xorg tree and
> I'm having trouble with the composite wrapper. kdrive, of course, has no
> need for this piece of kludgeware, but i can't avoid having it
> referenced from miext/damage as it gets linked from there
> unconditionally.
> 
> Somehow we need the xorg DDX to plug the composite wrapper below damage
> when it is needed, and without requiring any weird code in the damage
> initialization sequence.   

This is related to a bug that I encountered. My fix might provide a
fix for your problem too.

The problem is that DamageSetup from miSpriteInitialize is a kludge
and it is causing a problem that only happens to Xorg on Solaris.  But
I feel that it is a bug waiting to happen on Linux.

Basically, the current calling sequence is:
     InitOutput (DDX) -> miSpriteInitialize -> DamageSetup

Nvidea 7174 Linux InitOutput:
	Installs the NV screen functions before calling DamageSetup
	So the Damage routines properly wrap around the NV functions.

Nvidia 7663 Solaris InitOutput:
	Installs the NV screen functions *AFTER* calling DamageSetup.
	This destroys the initialization of the Damage screen functions.

I contend that this is an Xorg problem, not an Nvidia driver problem.
Having the correct functionality depend on when a DDX calls
miSprite is a bug. The fix is to ensure that DamageSetup is called
AFTER InitOutput but BEFORE CompositeExtensionInit.

I propose that we fix both problems as follows:

1. Remove the call to miInitializeCompositeWrapper from DamageSetup
   and make the call instead in CompositeExtensionInit.

2. Remove the call to DamageSetup from miSpriteInitialize.

3. Add call to DamageSetup to the start of miinitext.c:InitExtensions,
   as follows:

    for (s = 0; s < screenInfo.numScreens; s++) {
	if (!DamageSetup (screenInfo.screens[s])) {
	    FatalError("DamageSetup: initialization failed for screen %d.\n", s);
	}
    }

These changes will ensure that Damage's functions are the outermost
wrappers.

Note also that kdrive should call miDisableCompositeWrapper which will
prevent the composite wrappers from ever being installed.




More information about the xorg mailing list