summaryrefslogtreecommitdiff
path: root/src/sna/gen7_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-06-20 11:21:52 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-06-20 11:45:47 +0100
commit5419bbb483af595d7021e49debef7700c599217e (patch)
treecb2841ac65a4d30507e0dd6b9cbf7789a9517947 /src/sna/gen7_render.c
parent1c0bb8c4c93a43e2932429a9f6c23d91f1be2060 (diff)
sna/gen7: Prefer BLT for copies
It's faster for where the cost of the extra batches and ring switching do not dominate... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen7_render.c')
-rw-r--r--src/sna/gen7_render.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 915e9281..c474767e 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2412,14 +2412,14 @@ gen7_composite_set_target(struct sna *sna, struct sna_composite_op *op, PictureP
return TRUE;
}
-static bool prefer_blt_ring(struct sna *sna)
+inline static bool can_switch_rings(struct sna *sna)
{
- return sna->kgem.ring != KGEM_RENDER;
+ return sna->kgem.mode == KGEM_NONE && sna->kgem.has_semaphores && !NO_RING_SWITCH;
}
-static bool can_switch_rings(struct sna *sna)
+inline static bool prefer_blt_ring(struct sna *sna)
{
- return sna->kgem.mode == KGEM_NONE && sna->kgem.has_semaphores && !NO_RING_SWITCH;
+ return sna->kgem.ring != KGEM_RENDER || can_switch_rings(sna);
}
static Bool
@@ -3308,7 +3308,7 @@ static inline bool prefer_blt_copy(struct sna *sna,
PixmapPtr src, struct kgem_bo *src_bo,
PixmapPtr dst, struct kgem_bo *dst_bo)
{
- return (sna->kgem.ring == KGEM_BLT ||
+ return (prefer_blt_ring(sna) ||
prefer_blt_bo(sna, src, src_bo) ||
prefer_blt_bo(sna, dst, dst_bo));
}
@@ -3715,9 +3715,7 @@ gen7_emit_fill_state(struct sna *sna, const struct sna_composite_op *op)
static inline bool prefer_blt_fill(struct sna *sna,
struct kgem_bo *bo)
{
- return (can_switch_rings(sna) ||
- prefer_blt_ring(sna) ||
- untiled_tlb_miss(bo));
+ return prefer_blt_ring(sna) || untiled_tlb_miss(bo);
}
static Bool