diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-16 14:26:06 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-16 14:26:06 +0100 |
commit | 17bf0019b6962c06c87a08e4b41799481eaccd26 (patch) | |
tree | 657ec7b8c8fd5d8d9ff9632f5d166af22d39306d | |
parent | b707f18d17564653a2b45adf46a4e8eafcc6ab2c (diff) |
sna: Only retire requests after IO if the bo was active
We only want to process retirements if we know we caused a stall waiting
for the GPU to release the bo before performing IO.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 4297937a..f5f87d4a 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -177,9 +177,9 @@ Bool kgem_bo_write(struct kgem *kgem, struct kgem_bo *bo, return FALSE; bo->needs_flush = false; - if (bo->gpu) + if (bo->rq) kgem_retire(kgem); - assert(bo->gpu == false); + bo->gpu = false; return TRUE; } @@ -546,9 +546,6 @@ void kgem_retire(struct kgem *kgem) list_for_each_entry_safe(bo, next, &kgem->flushing, request) { if (!kgem_busy(kgem, bo->handle)) { - assert(bo->rq == NULL); - assert(bo->needs_flush); - assert(bo->deleted); bo->needs_flush = 0; bo->gpu = false; list_move(&bo->list, inactive(kgem, bo->size)); @@ -1610,9 +1607,9 @@ void kgem_bo_sync(struct kgem *kgem, struct kgem_bo *bo, bool for_write) drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain); bo->needs_flush = false; - if (bo->gpu) + if (bo->rq) kgem_retire(kgem); - assert(bo->gpu == false); + bo->gpu = false; bo->cpu_read = true; if (for_write) bo->cpu_write = true; @@ -1809,9 +1806,9 @@ void kgem_buffer_sync(struct kgem *kgem, struct kgem_bo *_bo) else gem_read(kgem->fd, bo->base.handle, bo+1, bo->used); bo->base.needs_flush = false; - if (bo->base.gpu) + if (bo->base.rq) kgem_retire(kgem); - assert(bo->base.gpu == false); + bo->base.gpu = false; bo->need_io = 0; } |