summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-04 15:55:15 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-04 18:12:17 +0000
commit4ba55c3d110ba51400a72da7d4f4c62efcea1335 (patch)
treeed274493a1c9a5ae572aa8b9a93d6e7bd383d794
parent703cf8abdbcda783e2bb0ceb423909ee8ca98176 (diff)
sna/gen5: Prefer using the BLT for many solid fills
Even if it means incurring a context switch, the BLT unit is significantly faster so long as we do enough fills. And there is the catch ;-) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen5_render.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 3926adcd..28c7a073 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -51,6 +51,8 @@
#define NO_COMPOSITE_SPANS 0
+#define PREFER_BLT_FILL 1
+
#define DBG_NO_STATE_CACHE 0
#define DBG_NO_SURFACE_CACHE 0
@@ -2643,6 +2645,15 @@ gen5_fill_bind_surfaces(struct sna *sna,
gen5_emit_state(sna, op, offset);
}
+static inline bool prefer_blt_fill(struct sna *sna)
+{
+#if PREFER_BLT_FILL
+ return true;
+#else
+ return sna->kgem.mode != KGEM_RENDER;
+#endif
+}
+
static Bool
gen5_render_fill_boxes(struct sna *sna,
CARD8 op,
@@ -2663,7 +2674,7 @@ gen5_render_fill_boxes(struct sna *sna,
return FALSE;
}
- if (sna->kgem.mode != KGEM_RENDER ||
+ if (prefer_blt_fill(sna) ||
dst->drawable.width > 8192 ||
dst->drawable.height > 8192 ||
!gen5_check_dst_format(format)) {
@@ -2869,7 +2880,7 @@ gen5_render_fill(struct sna *sna, uint8_t alu,
{
DBG(("%s(alu=%d, color=%08x)\n", __FUNCTION__, alu, color));
- if (sna->kgem.mode != KGEM_RENDER &&
+ if (prefer_blt_fill(sna) &&
sna_blt_fill(sna, alu,
dst_bo, dst->drawable.bitsPerPixel,
color,