etnaviv: fix texture_format_needs_swiz
authorLucas Stach <l.stach@pengutronix.de>
Fri, 20 Apr 2018 12:34:45 +0000 (14:34 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 20 Apr 2018 16:54:10 +0000 (18:54 +0200)
memcmp returns 0 when both swizzles are the same, which means we don't
need any hardware swizzling. texture_format_needs_swiz should return
true when the return value of the memcmp is non-zero.

Fixes: 751ae6afbefd ("etnaviv: add support for swizzled texture formats")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_format.c

index 7943c819d5110359f47de5d6ae41795e6daea144..29e81c4a8b047e4e1830c2a88a63b6a6253c0a3f 100644 (file)
@@ -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;
 }