sna: Manually clear the GPU bo needs_flush flag after doing an explicit flush

The kernel often gets confused and fails to flush the bo itself, so lets
just pretend it worked.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c127
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2015-10-19 09:34:43 +01:00
parent 6861391ff3
commit 3656bcf01e
1 changed files with 4 additions and 0 deletions

View File

@ -6752,6 +6752,7 @@ void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo)
DBG(("%s: sync: GPU hang detected\n", __FUNCTION__));
kgem_throttle(kgem);
}
bo->needs_flush = false;
kgem_bo_retire(kgem, bo);
bo->domain = DOMAIN_GTT;
bo->gtt_dirty = true;
@ -6964,6 +6965,7 @@ void kgem_bo_sync__cpu(struct kgem *kgem, struct kgem_bo *bo)
DBG(("%s: sync: GPU hang detected\n", __FUNCTION__));
kgem_throttle(kgem);
}
bo->needs_flush = false;
kgem_bo_retire(kgem, bo);
bo->domain = DOMAIN_CPU;
}
@ -7004,6 +7006,7 @@ void kgem_bo_sync__cpu_full(struct kgem *kgem, struct kgem_bo *bo, bool write)
kgem_throttle(kgem);
}
if (write) {
bo->needs_flush = false;
kgem_bo_retire(kgem, bo);
bo->domain = DOMAIN_CPU;
} else {
@ -7040,6 +7043,7 @@ void kgem_bo_sync__gtt(struct kgem *kgem, struct kgem_bo *bo)
DBG(("%s: sync: GPU hang detected\n", __FUNCTION__));
kgem_throttle(kgem);
}
bo->needs_flush = false;
kgem_bo_retire(kgem, bo);
bo->domain = DOMAIN_GTT;
bo->gtt_dirty = true;