summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-31 19:19:13 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-02-01 09:07:13 +0000
commitdf4e1059a4e09998334dde6aa1c8ccfe76e442c0 (patch)
tree92ca51bb2f8132f7e5a5c2332f1f49ce86fa4d6b
parent8b012de0a1af4ec97c3197af3f1efdcc67bc2118 (diff)
sna/gen6: Prefer to do fills using the BLT
Using the BLT is substantially faster than the current shaders for solid fill. The downside is that it invokes more ring switching. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen6_render.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 93410b6a..ec5412a0 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2210,12 +2210,23 @@ gen6_composite_set_target(struct sna *sna,
return TRUE;
}
+static bool prefer_blt_ring(struct sna *sna)
+{
+ return sna->kgem.ring != KGEM_RENDER;
+}
+
+static bool
+is_solid(PicturePtr picture)
+{
+ return sna_picture_is_solid(picture, NULL);
+}
+
static Bool
try_blt(struct sna *sna,
PicturePtr dst, PicturePtr src,
int width, int height)
{
- if (sna->kgem.ring != KGEM_RENDER) {
+ if (prefer_blt_ring(sna)) {
DBG(("%s: already performing BLT\n", __FUNCTION__));
return TRUE;
}
@@ -2241,15 +2252,12 @@ try_blt(struct sna *sna,
return TRUE;
}
- return FALSE;
-}
+ if (sna->kgem.has_semaphores) {
+ if (is_solid(src))
+ return TRUE;
+ }
-static bool
-is_solid(PicturePtr picture)
-{
- return picture->pDrawable->width == 1 &&
- picture->pDrawable->height == 1 &&
- picture->repeat;
+ return FALSE;
}
static bool
@@ -3071,7 +3079,7 @@ static inline bool prefer_blt_copy(struct sna *sna,
struct kgem_bo *src_bo,
struct kgem_bo *dst_bo)
{
- return (sna->kgem.ring != KGEM_RENDER ||
+ return (prefer_blt_ring(sna) ||
untiled_tlb_miss(src_bo) ||
untiled_tlb_miss(dst_bo));
}
@@ -3424,7 +3432,7 @@ gen6_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 sna->kgem.ring != KGEM_RENDER || untiled_tlb_miss(bo);
+ return sna->kgem.has_semaphores || prefer_blt_ring(sna) || untiled_tlb_miss(bo);
}
static Bool