diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-09 14:16:17 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-09 14:16:17 +0000 |
commit | 6193f2f00fa7205f9d736340318c66d116dca53e (patch) | |
tree | 15e3ffb427ca89a192b0f083ccdf335626c91ebf | |
parent | 4d8369f8e60fd4f5a0ef49f3e9866ea5ecb21927 (diff) |
sna: Fix retire after readback
Upon reading, we encounter a serialisation point and so can retire all
requests. However, kgem_bo_retire() wasn't correctly detecting that
barrier and so we continued to using GPU detiling thinking the target
was still busy.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 1c233204..607f1c45 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -306,7 +306,7 @@ static void kgem_bo_retire(struct kgem *kgem, struct kgem_bo *bo) __FUNCTION__, bo->handle, bo->domain)); assert(!kgem_busy(kgem, bo->handle)); - if (bo->domain == DOMAIN_GPU) + if (bo->rq) kgem_retire(kgem); if (bo->exec == NULL) { @@ -3561,6 +3561,7 @@ void kgem_buffer_read_sync(struct kgem *kgem, struct kgem_bo *_bo) { struct kgem_partial_bo *bo; uint32_t offset = _bo->delta, length = _bo->size.bytes; + int domain; assert(_bo->io); assert(_bo->exec == NULL); @@ -3587,11 +3588,11 @@ void kgem_buffer_read_sync(struct kgem *kgem, struct kgem_bo *_bo) if (IS_CPU_MAP(bo->base.map)) { set_domain.read_domains = I915_GEM_DOMAIN_CPU; set_domain.write_domain = I915_GEM_DOMAIN_CPU; - bo->base.domain = DOMAIN_CPU; + domain = DOMAIN_CPU; } else { set_domain.read_domains = I915_GEM_DOMAIN_GTT; set_domain.write_domain = I915_GEM_DOMAIN_GTT; - bo->base.domain = DOMAIN_GTT; + domain = DOMAIN_GTT; } drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain); @@ -3600,9 +3601,10 @@ void kgem_buffer_read_sync(struct kgem *kgem, struct kgem_bo *_bo) bo->base.handle, (char *)bo->mem+offset, offset, length); kgem_bo_map__cpu(kgem, &bo->base); - bo->base.domain = DOMAIN_NONE; + domain = DOMAIN_NONE; } kgem_bo_retire(kgem, &bo->base); + bo->base.domain = domain; } uint32_t kgem_bo_get_binding(struct kgem_bo *bo, uint32_t format) |