summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2015-05-30 17:13:57 +0100
committerRussell King <rmk@arm.linux.org.uk>2015-06-29 12:58:32 +0100
commitace19c44ff09211600b74c312ca39e62b2e00ddb (patch)
tree728aeae18e41e06e7c48eead3b3793093b6cdfc2
parent80cf33dd609c01bed9d20f31862cc8bdbeba9d0e (diff)
etnaviv: fallback to software to acquire src for unhandled cases
If the source pixmap does not have an etna bo associated with it, we should nevertheless try to obtain it in a format we can use, to save bouncing the destination pixmap back to the CPU. Rearrange the code in etnaviv_acquire_src() to handle this case. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--etnaviv/etnaviv_accel.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/etnaviv/etnaviv_accel.c b/etnaviv/etnaviv_accel.c
index d3db2ee..29ae90c 100644
--- a/etnaviv/etnaviv_accel.c
+++ b/etnaviv/etnaviv_accel.c
@@ -1324,18 +1324,18 @@ static struct etnaviv_pixmap *etnaviv_acquire_src(struct etnaviv *etnaviv,
int tx, ty;
if (etnaviv_pict_solid_argb(pict, &colour)) {
- src_topleft->x = 0;
- src_topleft->y = 0;
if (!etnaviv_fill_single(etnaviv, vTemp, clip, colour))
return NULL;
+ src_topleft->x = 0;
+ src_topleft->y = 0;
return vTemp;
}
drawable = pict->pDrawable;
vSrc = etnaviv_drawable_offset(drawable, &src_offset);
if (!vSrc)
- return NULL;
+ goto fallback;
etnaviv_set_format(vSrc, pict);
@@ -1347,22 +1347,18 @@ static struct etnaviv_pixmap *etnaviv_acquire_src(struct etnaviv *etnaviv,
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;
- } else {
- int x = src_topleft->x;
- int y = src_topleft->y;
- int w = clip->x2;
- int h = clip->y2;
-
- if (!etnaviv_composite_to_pixmap(PictOpSrc, pict, NULL, *pPix,
- x, y, 0, 0, w, h))
- return NULL;
-
- src_topleft->x = 0;
- src_topleft->y = 0;
- vSrc = vTemp;
+ return vSrc;
}
- return vSrc;
+fallback:
+ if (!etnaviv_composite_to_pixmap(PictOpSrc, pict, NULL, *pPix,
+ src_topleft->x, src_topleft->y,
+ 0, 0, clip->x2, clip->y2))
+ return NULL;
+
+ src_topleft->x = 0;
+ src_topleft->y = 0;
+ return vTemp;
}
/*