summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2009-11-25 20:23:22 +1000
committerDave Airlie <[email protected]>2009-11-25 20:40:15 +1000
commit92c6a26a8a0f6ce540fe7c9681fb9a30b0da9e5f (patch)
treeee7071461e07b9a62fbbaea2ce3157c6105bd6d1
parent94bcb9f1a43f2ab3bdff09156e3ab5b1c115cbd8 (diff)
radeon: fix context destroy needing lock for flushing.
Thanks to Intel code which I've just stolen pretty much as usual. This fixes fdo bug 22851 which is a dri1 regression since rewrite. Tested by: fpiobaf (Fabio) on #radeon Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_lock.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c
index 02de8e5fd1d..7ad781ba619 100644
--- a/src/mesa/drivers/dri/radeon/radeon_lock.c
+++ b/src/mesa/drivers/dri/radeon/radeon_lock.c
@@ -62,8 +62,6 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags)
__DRIdrawablePrivate *const readable = radeon_get_readable(rmesa);
__DRIscreenPrivate *sPriv = rmesa->dri.screen;
- assert(drawable != NULL);
-
drmGetLock(rmesa->dri.fd, rmesa->dri.hwContext, flags);
/* The window might have moved, so we might need to get new clip
@@ -74,12 +72,13 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags)
* Since the hardware state depends on having the latest drawable
* clip rects, all state checking must be done _after_ this call.
*/
- DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable);
- if (drawable != readable) {
+ if (drawable)
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable);
+ if (readable && drawable != readable) {
DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable);
}
- if (rmesa->lastStamp != drawable->lastStamp) {
+ if (drawable && (rmesa->lastStamp != drawable->lastStamp)) {
radeon_window_moved(rmesa);
rmesa->lastStamp = drawable->lastStamp;
}