[Mesa-dev] [PATCH] etnaviv: fix 16bpp clears

Wladimir J. van der Laan laanwj at gmail.com
Fri Sep 22 10:29:50 UTC 2017


On Fri, Sep 22, 2017 at 11:24:08AM +0200, Lucas Stach wrote:
> util_pack_color may leave undefined values in the upper half of the packed
> integer. As our hardware needs the upper 16 bits to mirror the lower 16bits,
> this breaks clears of those formats if the undefined values aren't masked off.
> 
> I've only observed the issue with R5G6B5_UNORM surfaces, other 16bpp
> formats seem to work fine.

Reviewed-by: Wladimir J. van der Laan <laanwj at gmail.com>

> 
> Fixes: d6aa2ba2b2 (etnaviv: replace translate_clear_color with util_pack_color)
> Cc: mesa-stable at lists.freedesktop.org
> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> ---
>  src/gallium/drivers/etnaviv/etnaviv_clear_blit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
> index 971403c45476..c85ada926699 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
> @@ -106,7 +106,7 @@ pack_rgba(enum pipe_format format, const float *rgba)
>     union util_color uc;
>     util_pack_color(rgba, format, &uc);
>     if (util_format_get_blocksize(format) == 2)
> -      return uc.ui[0] << 16 | uc.ui[0];
> +      return uc.ui[0] << 16 | (uc.ui[0] & 0xffff);
>     else
>        return uc.ui[0];
>  }
> -- 
> 2.11.0
> 
> _______________________________________________
> etnaviv mailing list
> etnaviv at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv


More information about the mesa-dev mailing list