summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-01-17 22:31:48 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-01-17 22:34:33 +0000
commite351c36473e0a3d6724adc06f1e0b049d74a087d (patch)
treefedb6f981c5661b55198bf55960921b2ac2af90d
parenta4fff8918824fba0401e9842709bbb9b6b08017c (diff)
sna/gen6+: Prefer not to switch away from active RENDER pipeline
If we don't have a good reason to switch to BLT, don't jump engines simply because the BLT is idle if our target bo is active on the RENDER pipeline. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen6_common.h3
-rw-r--r--src/sna/kgem.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/sna/gen6_common.h b/src/sna/gen6_common.h
index 8ce360e5..fa450b41 100644
--- a/src/sna/gen6_common.h
+++ b/src/sna/gen6_common.h
@@ -61,6 +61,9 @@ inline static bool can_switch_to_blt(struct sna *sna,
if (sna->render_state.gt < 2)
return true;
+ if (bo && RQ_IS_RENDER(bo->rq))
+ return false;
+
return kgem_ring_is_idle(&sna->kgem, KGEM_BLT);
}
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 2267bacf..59cb7243 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -42,6 +42,7 @@ struct kgem_bo {
#define RQ(rq) ((struct kgem_request *)((uintptr_t)(rq) & ~3))
#define RQ_RING(rq) ((uintptr_t)(rq) & 3)
#define RQ_IS_BLT(rq) (RQ_RING(rq) == KGEM_BLT)
+#define RQ_IS_RENDER(rq) (RQ_RING(rq) == KGEM_RENDER)
#define MAKE_REQUEST(rq, ring) ((struct kgem_request *)((uintptr_t)(rq) | (ring)))
struct drm_i915_gem_exec_object2 *exec;