summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2007-11-30 18:17:12 -0800
committerEric Anholt <[email protected]>2007-11-30 18:17:12 -0800
commit556cf9abff75eaa56c3ea11f1c59cb04d30c0b92 (patch)
tree49ca817a7040652918ebb3f32198b776edc4935d /src/mesa/drivers/dri/common
parentd388cad74675b6ac9bde4aa1dbdd3f4b0138942d (diff)
[intel] Move batch bo_unmap from TTM code to shared, and add more asserts.
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr_fake.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
index 029f29ad693..dda6e5a25ed 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
@@ -754,6 +754,7 @@ dri_fake_bo_unmap(dri_bo *bo)
return 0;
_glthread_LOCK_MUTEX(bufmgr_fake->mutex);
+ assert(bo_fake->map_count != 0);
if (--bo_fake->map_count != 0) {
_glthread_UNLOCK_MUTEX(bufmgr_fake->mutex);
return 0;
@@ -785,6 +786,12 @@ dri_fake_bo_validate(dri_bo *bo, uint64_t flags)
_glthread_LOCK_MUTEX(bufmgr_fake->mutex);
{
+ /* Sanity check: Buffers should be unmapped before being validated.
+ * This is not so much of a problem for bufmgr_fake, but TTM refuses,
+ * and the problem is harder to debug there.
+ */
+ assert(bo_fake->map_count == 0);
+
if (bo_fake->is_static) {
/* Add it to the needs-fence list */
bufmgr_fake->need_fence = 1;