summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-20 13:12:27 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-20 13:12:27 +0100
commitfb7987fc0b51cf3b83dcf78bcefe65ec3af32ccf (patch)
tree77408a6547dc2ede149791f08c6213eb3777db05
parent3b56588fbaa2c4ccdfb2f2a8f5656d2cda9dacd7 (diff)
sna/dri: Cleanup ring selection for SNB+ CopyRegion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_dri.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 4ced0eb1..da2f3580 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -426,6 +426,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
static void sna_dri_select_mode(struct sna *sna, struct kgem_bo *src, bool sync)
{
struct drm_i915_gem_busy busy;
+ int mode;
if (sna->kgem.gen < 60)
return;
@@ -463,11 +464,14 @@ static void sna_dri_select_mode(struct sna *sna, struct kgem_bo *src, bool sync)
* our operation on the same ring, and ideally on the same
* ring as we will flip from (which should be the RENDER ring
* as well).
+ *
+ * The ultimate question is whether preserving the ring outweighs
+ * the cost of the query.
*/
- if ((busy.busy & 0xffff0000) == 0 || busy.busy & (1 << 16))
- kgem_set_mode(&sna->kgem, KGEM_RENDER);
- else
- kgem_set_mode(&sna->kgem, KGEM_BLT);
+ mode = KGEM_RENDER;
+ if (busy.busy & (1 << 16))
+ mode = KGEM_BLT;
+ _kgem_set_mode(&sna->kgem, mode);
}
static struct kgem_bo *