From 3656bcf01e78554aaeafc11ecebb0caf7dd12713 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 19 Oct 2015 09:34:43 +0100 Subject: [PATCH] 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 References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c127 Signed-off-by: Chris Wilson --- src/sna/kgem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index bb1f70b5..bbe20926 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -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;