Fixing devPrivates

Eamon Walsh ewalsh at tycho.nsa.gov
Thu Apr 29 13:42:41 PDT 2010


On 04/29/2010 01:20 PM, Keith Packard wrote:
> On Thu, 29 Apr 2010 14:06:19 +0200, Matthias Hopf <mhopf at suse.de> wrote:
>   
>> On Apr 28, 10 23:59:06 -0700, Keith Packard wrote:
>>     
>>> It's possible to adapt to this change with some very small adjustments
>>> in your code; simply replace 'int' in the index variable declaration
>>> with 'DevPrivateKeyRec' and make sure dixRegisterPrivateKey is called
>>> (potentially replacing an existing call to dixRequestPrivate). The rest
>>> of your code should work just fine.
>>>       
>> I suggest that you have some sort of compile-time define available to
>> determine the API type - in case some out-of-Xserver part (drivers?)
>> wants to be backward compatible and support both APIs.
>>     
> That's a good idea. I can add a #define to let drivers know that there's
> a change in the DevPrivate API. Of course, they could check the ABI
> version numbers while building, but having something specific to the
> DevPrivate change would make things easier.
>   



Some of the drivers do appear to use devPrivates, for example the sunleo
driver (which I got into Big Trouble for breaking on the first
go-round).  Now there is code like:

#define LEO_OLDPRIV (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
#if LEO_OLDPRIV
#define LeoGetGCPrivate(g) (g)->devPrivates[LeoGCPrivateIndex].ptr
#else
#define LeoGetGCPrivate(g) dixLookupPrivate(&(g)->devPrivates,
&LeoGCPrivateIndex)
#endif


So a new rev of devPrivates would involve adding another clause to these
ifdefs.




-- 

Eamon Walsh 
National Security Agency



More information about the xorg-devel mailing list