xserver-multidpi/hw/xfree86/dri2
Jesse Barnes 8476d99231 DRI2: drawable lifetime fixes
Handle drawable destruction and lifetime correctly.

Check whether the drawable priv is valid in DRI2SwapInterval(),
DRI2WaitSBC() and DRI2WaitMSC(); it may have gone away, so be sure to
check it before using it.

If more than 1 outstanding swap is queued, we may complete several after
an app has exited.  If we free it after the first one completes and the
refcount reaches 0, we'll crash the server on subsequent completions.
So delay freeing until all swaps complete and remove the error message
as this is a normal occurence.  To do this properly, we must also avoid
destroying drawables in DRI2DestroyDrawable() if a swap or wait event is
pending.

And finally, make sure we free drawables in DRI2WaitMSCComplete() if
necessary (i.e. if the refcount has reached 0 and this MSC was the last
pending event on the object).

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-03-29 10:02:22 -07:00
..
dri2.c DRI2: drawable lifetime fixes 2010-03-29 10:02:22 -07:00
dri2.h DRI2: Allow multiple driver names. 2010-01-27 13:57:00 -08:00
dri2ext.c DRI2: initialize event->drawable in DRI2SwapEvent 2010-02-25 11:43:37 -08:00
Makefile.am Don't reuse PKG_CHECK_MODULES identifiers 2009-01-18 09:49:06 -08:00