[PATCH] DRI2: fixup handling of last_swap_target

Michel Dänzer michel at daenzer.net
Sun Mar 7 06:38:24 PST 2010


On Sun, 2010-03-07 at 08:44 +0100, Mario Kleiner wrote: 
> 
> Your deferred pPriv deletion logic looks now good to me. But if  
> deletion is deferred then i think almost all "public" functions  
> inside dri2.c should return 'BadDrawable' not only for pPriv == NULL  
> but also for pPriv->refCount == 0, e.g., DRI2SwapBuffers,  
> DRI2GetMSC, ... From the viewpoint of client code, a refCount == 0 is  
> the same as a destroyed drawable. For all practical purposes it is  
> already gone. Maybe it would make sense to consolidate the (pPriv ==  
> NULL || pPriv->refCount == 0) check into a macro or function,  
> something like DRI2IsDrawableAlive(pPriv); and then call that in most  
> DRI2xxx functions?

Sounds like a good idea to me FWIW.

Speaking of consolidation: Is it just me, or do the X server <-> driver
interfaces you guys have been discussing seem to require way too much
brains in the drivers which should rather be centralized in the server?
(I admit I've only been skimming the code and discussion, so my
impression may be wrong)


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list