summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2008-02-13 09:26:06 -0800
committerEric Anholt <[email protected]>2008-02-13 10:34:48 -0800
commitee781a41af95a317f4f37182e0d614e917e0737d (patch)
tree9f9180dd5d67b7cf72b72cc9c2236639bdae2640 /src
parentee8dfa89646ea5aa5e5cf72e29b601cbe357e126 (diff)
When mapping, wait on the buffer's fence, not hardware idle, in bufmgr_fake
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr_fake.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
index 30a4ecb3b75..7212ee84ab1 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
@@ -517,6 +517,21 @@ dri_bufmgr_fake_wait_idle(dri_bufmgr_fake *bufmgr_fake)
_fence_wait_internal(bufmgr_fake, cookie);
}
+/**
+ * Wait for execution pending on a buffer
+ */
+static void
+dri_bufmgr_fake_bo_wait_idle(dri_bo *bo)
+{
+ dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr;
+ dri_bo_fake *bo_fake = (dri_bo_fake *)bo;
+
+ if (bo_fake->block == NULL || !bo_fake->block->fenced)
+ return;
+
+ _fence_wait_internal(bufmgr_fake, bo_fake->block->fence);
+}
+
/* Specifically ignore texture memory sharing.
* -- just evict everything
* -- and wait for idle
@@ -720,8 +735,10 @@ dri_fake_bo_map(dri_bo *bo, GLboolean write_enable)
assert(bo_fake->block);
bo_fake->dirty = 0;
- if (!(bo_fake->flags & BM_NO_FENCE_SUBDATA))
- dri_bufmgr_fake_wait_idle(bufmgr_fake);
+ if (!(bo_fake->flags & BM_NO_FENCE_SUBDATA) &&
+ bo_fake->block->fenced) {
+ dri_bufmgr_fake_bo_wait_idle(bo);
+ }
bo->virtual = bo_fake->block->virtual;
}