[PATCH] etnaviv: fix texture_format_needs_swiz

Marek Vasut marex at denx.de
Fri Apr 20 12:55:48 UTC 2018


On 04/20/2018 02:37 PM, Lucas Stach wrote:
> memcmp returns 0 when both swizzles are the same, which means we don't
> need any swizzling. texture_format_needs_swiz needs to returns true
> when the return value of the memcmp is non-zero.
> 
> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>

On a custom iMX6SX board with 480x800 display
Tested-by: Marek Vasut <marex at denx.de>

Thank you!

> ---
>  src/gallium/drivers/etnaviv/etnaviv_format.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_format.c b/src/gallium/drivers/etnaviv/etnaviv_format.c
> index 7943c819d511..29e81c4a8b04 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_format.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_format.c
> @@ -302,7 +302,7 @@ texture_format_needs_swiz(enum pipe_format fmt)
>     bool swiz = false;
>  
>     if (formats[fmt].present)
> -      swiz = !memcmp(def, formats[fmt].tex_swiz, sizeof(formats[fmt].tex_swiz));
> +      swiz = !!memcmp(def, formats[fmt].tex_swiz, sizeof(formats[fmt].tex_swiz));
>  
>     return swiz;
>  }
> 


-- 
Best regards,
Marek Vasut


More information about the etnaviv mailing list