From ee781a41af95a317f4f37182e0d614e917e0737d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 13 Feb 2008 09:26:06 -0800 Subject: [PATCH] When mapping, wait on the buffer's fence, not hardware idle, in bufmgr_fake --- src/mesa/drivers/dri/common/dri_bufmgr_fake.c | 21 +++++++++++++++++-- 1 file 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; } -- 2.30.2