summaryrefslogtreecommitdiff
path: root/src/sna/gen8_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-04-22 14:08:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-04-22 16:03:31 +0100
commit4fdd3a714d380afd3d6425aedbbf2ae20180638b (patch)
tree99e681b2a664c53f84f3a2e003a986895b958774 /src/sna/gen8_render.c
parent83b8528773a0b1e6655fa87c9645a0062cee1359 (diff)
sna/gen6+: Discourage use of the BLT with Y-tiling
Somewhere, somehow the first glyph character upload into the Y-tiled glyph cache is corrupt since commit 75d87762471e195dddd73056fc6a06e17db1c8b0 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Apr 17 10:29:28 2015 +0100 sna: Enable blitting with Y-tiled surfaces I have not spotted whether it is a missing magic bit or a bad GTT path, but ideally we don't want to switch to BLT along that path anyway (since we are in the middle of rendering with the other engine). Reported-by: Andy Furniss <adf.lists@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=90138 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen8_render.c')
-rw-r--r--src/sna/gen8_render.c65
1 files changed, 44 insertions, 21 deletions
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index c0fe9f9c..b40c582a 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -2029,55 +2029,78 @@ gen8_composite_set_target(struct sna *sna,
static bool
try_blt(struct sna *sna,
- PicturePtr dst, PicturePtr src,
- int width, int height)
+ uint8_t op,
+ PicturePtr src,
+ PicturePtr mask,
+ PicturePtr dst,
+ int16_t src_x, int16_t src_y,
+ int16_t msk_x, int16_t msk_y,
+ int16_t dst_x, int16_t dst_y,
+ int16_t width, int16_t height,
+ unsigned flags,
+ struct sna_composite_op *tmp)
{
struct kgem_bo *bo;
if (sna->kgem.mode == KGEM_BLT) {
DBG(("%s: already performing BLT\n", __FUNCTION__));
- return true;
+ goto execute;
}
if (too_large(width, height)) {
DBG(("%s: operation too large for 3D pipe (%d, %d)\n",
__FUNCTION__, width, height));
- return true;
+ goto execute;
}
bo = __sna_drawable_peek_bo(dst->pDrawable);
if (bo == NULL)
- return true;
+ goto execute;
if (untiled_tlb_miss(bo))
- return true;
+ goto execute;
+
+ if (bo->rq) {
+ if (RQ_IS_BLT(bo->rq))
+ goto execute;
+
+ return false;
+ }
- if (bo->rq)
- return RQ_IS_BLT(bo->rq);
+ if (bo->tiling == I915_TILING_Y)
+ goto upload;
if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, bo, 0))
- return true;
+ goto execute;
if (src->pDrawable == dst->pDrawable &&
(sna->render_state.gt < 3 || width*height < 1024) &&
can_switch_to_blt(sna, bo, 0))
- return true;
+ goto execute;
if (src->pDrawable) {
struct kgem_bo *s = __sna_drawable_peek_bo(src->pDrawable);
if (s == NULL)
- return true;
+ goto upload;
if (prefer_blt_bo(sna, s, bo))
- return true;
+ goto execute;
}
if (sna->kgem.ring == KGEM_BLT) {
DBG(("%s: already performing BLT\n", __FUNCTION__));
- return true;
+ goto execute;
}
- return false;
+upload:
+ flags |= COMPOSITE_UPLOAD;
+execute:
+ return sna_blt_composite(sna, op,
+ src, dst,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ flags, tmp);
}
static bool
@@ -2307,13 +2330,13 @@ gen8_render_composite(struct sna *sna,
width, height, sna->kgem.mode, sna->kgem.ring));
if (mask == NULL &&
- try_blt(sna, dst, src, width, height) &&
- sna_blt_composite(sna, op,
- src, dst,
- src_x, src_y,
- dst_x, dst_y,
- width, height,
- flags, tmp))
+ try_blt(sna, op,
+ src, mask, dst,
+ src_x, src_y,
+ msk_x, msk_y,
+ dst_x, dst_y,
+ width, height,
+ flags, tmp))
return true;
if (gen8_composite_fallback(sna, src, mask, dst))