From 60a3b370aea0cf9ffb4947a73984c877b4695d4e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 30 Jan 2013 15:41:51 +0000 Subject: [PATCH] sna: Retire the bo after a set-domain(CPU,0) Having relaxed the earlier assertion because the kernel is wrong, we can now retire for READ-READ optimisations. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 6b72782c..ad6a5aaf 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -4713,11 +4713,9 @@ void kgem_bo_sync__cpu_full(struct kgem *kgem, struct kgem_bo *bo, bool write) set_domain.write_domain = write ? I915_GEM_DOMAIN_CPU : 0; if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain) == 0) { - if (write) { + if (write || bo->needs_flush) kgem_bo_retire(kgem, bo); - bo->domain = DOMAIN_CPU; - } else - bo->domain = DOMAIN_NONE; + bo->domain = write ? DOMAIN_CPU : DOMAIN_NONE; } } }