diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-20 13:12:27 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-20 13:12:27 +0100 |
commit | fb7987fc0b51cf3b83dcf78bcefe65ec3af32ccf (patch) | |
tree | 77408a6547dc2ede149791f08c6213eb3777db05 /src/sna/sna_dri.c | |
parent | 3b56588fbaa2c4ccdfb2f2a8f5656d2cda9dacd7 (diff) |
sna/dri: Cleanup ring selection for SNB+ CopyRegion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri.c')
-rw-r--r-- | src/sna/sna_dri.c | 12 |
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 * |