summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_blt.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_blt.c b/src/gallium/drivers/etnaviv/etnaviv_blt.c
index 1f13bbc31cd..42d1a4462d1 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_blt.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_blt.c
@@ -391,12 +391,16 @@ etna_try_blt_blit(struct pipe_context *pctx,
/* TODO: 1 byte per pixel formats aren't handled by etna_compatible_rs_format nor
* translate_rs_format.
- * Also this should be smarter about format conversions; etna_compatible_rs_format
- * assumes all 2-byte pixel format are laid out as 4444, all 4-byte pixel formats
- * are 8888.
*/
- unsigned src_format = etna_compatible_rs_format(blit_info->src.format);
- unsigned dst_format = etna_compatible_rs_format(blit_info->dst.format);
+ unsigned src_format = blit_info->src.format;
+ unsigned dst_format = blit_info->dst.format;
+
+ /* for a copy with same dst/src format, we can use a different format */
+ if (translate_blt_format(src_format) == ETNA_NO_MATCH &&
+ src_format == dst_format) {
+ src_format = dst_format = etna_compatible_rs_format(src_format);
+ }
+
if (translate_blt_format(src_format) == ETNA_NO_MATCH ||
translate_blt_format(dst_format) == ETNA_NO_MATCH ||
blit_info->scissor_enable ||
@@ -449,7 +453,7 @@ etna_try_blt_blit(struct pipe_context *pctx,
op.src.tiling = src->layout;
op.src.cache_mode = TS_CACHE_MODE_128; /* TODO: cache modes */
const struct util_format_description *src_format_desc =
- util_format_description(blit_info->src.format);
+ util_format_description(src_format);
for (unsigned x=0; x<4; ++x)
op.src.swizzle[x] = src_format_desc->swizzle[x];
@@ -474,7 +478,7 @@ etna_try_blt_blit(struct pipe_context *pctx,
op.dest.tiling = dst->layout;
op.dest.cache_mode = TS_CACHE_MODE_128; /* TODO cache modes */
const struct util_format_description *dst_format_desc =
- util_format_description(blit_info->dst.format);
+ util_format_description(dst_format);
for (unsigned x=0; x<4; ++x)
op.dest.swizzle[x] = dst_format_desc->swizzle[x];