diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2016-11-22 18:57:58 +0000 |
---|---|---|
committer | Russell King <rmk@armlinux.org.uk> | 2016-11-22 22:01:22 +0000 |
commit | f12188ff545cf31dc5ba3234172ef2f3053d2521 (patch) | |
tree | 9f599e8986d7ca323538d2b57a6276ce494c7ecf | |
parent | 3ec85c46f71fb9c14193eb4b7164d83e4633a02a (diff) |
etnaviv: apply non-alpha workaround for reduced masks
If etnaviv_accel_reduce_mask() succeeded in replacing the mask by
constant alpha the source format still needs to be switched to an
alpha one to get correct swizzles. We only want to avoid clobbering
the alpha mode setup done by etnaviv_accel_reduce_mask().
Found via rendercheck on GC320:
Over composite test error of 255.0000 at (3, 23) --
R G B A
got: 1.000 0.000 1.000 1.000
expected: 1.000 0.000 0.000 1.000
src color: 1.00 0.00 0.00 1.00
msk color: 1.00 1.00 1.00 1.00
dst color: 1.00 1.00 1.00 1.00
src: 10x10 b8g8r8x8, mask: 1x1R a8r8g8b8, dst: x8r8g8b8
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[edited description to include details of the failure, and improved
comment --rmk]
Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r-- | etnaviv/etnaviv_render.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/etnaviv/etnaviv_render.c b/etnaviv/etnaviv_render.c index 2093129..f91438a 100644 --- a/etnaviv/etnaviv_render.c +++ b/etnaviv/etnaviv_render.c @@ -560,11 +560,13 @@ static int etnaviv_accel_composite_srconly(PicturePtr pSrc, PicturePtr pDst, return FALSE; /* - * Apply the same work-around for a non-alpha source as for - * a non-alpha destination. + * Apply the same work-around for a non-alpha source as for a + * non-alpha destination. The test order is important here as + * we must always have an alpha format, otherwise the selected + * alpha mode (by etnaviv_accel_reduce_mask()) will be ignored. */ - if (etnaviv_blend_src_alpha_normal(final_blend) && - etnaviv_workaround_nonalpha(vSrc)) { + if (etnaviv_workaround_nonalpha(vSrc) && + etnaviv_blend_src_alpha_normal(final_blend)) { final_blend->alpha_mode |= VIVS_DE_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_GLOBAL; final_blend->src_alpha = 255; } |