diff options
author | Russell King <rmk@arm.linux.org.uk> | 2015-05-31 00:33:12 +0100 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2015-06-29 12:58:33 +0100 |
commit | 7fed6f6b1d3ff97e6feecdf93c65b357f10bae4a (patch) | |
tree | 362884dbebc0da866b38059e6150bcf39c5c5bf4 | |
parent | 720be49f7b14bb3ea772357ceaac17384f2ee95b (diff) |
etnaviv: fix repeat handling in etnaviv_acquire_src()
Fix the repeat handling in etnaviv_acquire_src() - we need to apply the
transform before checking for repeat. In doing this, we can convert
over to using picture_needs_repeat() instead of adjusting the repeat
on the source, which is more efficient.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r-- | etnaviv/etnaviv.c | 6 | ||||
-rw-r--r-- | etnaviv/etnaviv_accel.c | 42 |
2 files changed, 16 insertions, 32 deletions
diff --git a/etnaviv/etnaviv.c b/etnaviv/etnaviv.c index 5cd9b52..a6d83bc 100644 --- a/etnaviv/etnaviv.c +++ b/etnaviv/etnaviv.c @@ -842,13 +842,9 @@ etnaviv_Composite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, Bool ret; if (!etnaviv->force_fallback) { - unsigned src_repeat = pSrc->repeat; - ret = etnaviv_accel_Composite(op, pSrc, pMask, pDst, - xSrc, ySrc, - xMask, yMask, + xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); - pSrc->repeat = src_repeat; if (ret) return; } diff --git a/etnaviv/etnaviv_accel.c b/etnaviv/etnaviv_accel.c index 3a9a335..7b94849 100644 --- a/etnaviv/etnaviv_accel.c +++ b/etnaviv/etnaviv_accel.c @@ -1087,21 +1087,6 @@ static Bool picture_needs_repeat(PicturePtr pPict, int x, int y, return TRUE; } -static void adjust_repeat(PicturePtr pPict, int x, int y, unsigned w, unsigned h) -{ - int tx, ty; - - if (pPict->pDrawable && - pPict->repeat && - pPict->filter != PictFilterConvolution && - transform_is_integer_translation(pPict->transform, &tx, &ty) && - (pPict->pDrawable->width > 1 || pPict->pDrawable->height > 1) && - drawable_contains(pPict->pDrawable, x + tx, y + ty, w, h)) { -//fprintf(stderr, "%s: removing repeat on %p\n", __FUNCTION__, pPict); - pPict->repeat = 0; - } -} - static const struct etnaviv_blend_op etnaviv_composite_op[] = { #define OP(op,s,d) \ [PictOp##op] = { \ @@ -1339,19 +1324,22 @@ static struct etnaviv_pixmap *etnaviv_acquire_src(struct etnaviv *etnaviv, goto fallback; etnaviv_set_format(vSrc, pict); + if (!etnaviv_src_format_valid(etnaviv, vSrc->pict_format)) + goto fallback; - /* Remove repeat on source or mask if useless */ - adjust_repeat(pict, src_topleft->x, src_topleft->y, clip->x2, clip->y2); - - if (!pict->repeat && - transform_is_integer_translation(pict->transform, &tx, &ty) && - etnaviv_src_format_valid(etnaviv, vSrc->pict_format)) { - src_topleft->x += drawable->x + src_offset.x + tx; - src_topleft->y += drawable->y + src_offset.y + ty; - if (force_vtemp) - goto copy_to_vtemp; - return vSrc; - } + if (!transform_is_integer_translation(pict->transform, &tx, &ty)) + goto fallback; + + if (picture_needs_repeat(pict, src_topleft->x + tx, src_topleft->y + ty, + clip->x2, clip->y2)) + goto fallback; + + src_topleft->x += drawable->x + src_offset.x + tx; + src_topleft->y += drawable->y + src_offset.y + ty; + if (force_vtemp) + goto copy_to_vtemp; + + return vSrc; fallback: if (!etnaviv_composite_to_pixmap(PictOpSrc, pict, NULL, *pPix, |