From: Shawn Guo Date: Tue, 30 Jun 2020 12:40:53 +0000 (+0800) Subject: freedreno/a4xx: fix *_NONE enum conversion X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1d309eaa39a695da5adc7dfd663cb2a4179710e;p=mesa.git freedreno/a4xx: fix *_NONE enum conversion Commit e369b8931c67 ("freedreno: Use explicit *_NONE enum for undefined formats") only partially converts ~0 to *_NONE enum. It breaks texture support, and glmark2 texture scene gives a black screen. Adding the missing conversion of ~0 to *_NONE enum fixes the issue. Signed-off-by: Shawn Guo Part-of: --- diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_format.c b/src/gallium/drivers/freedreno/a4xx/fd4_format.c index c41015857d6..3e7fff51743 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_format.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_format.c @@ -339,7 +339,7 @@ enum a4xx_vtx_fmt fd4_pipe2vtx(enum pipe_format format) { if (!formats[format].present) - return ~0; + return VFMT4_NONE; return formats[format].vtx; } @@ -348,7 +348,7 @@ enum a4xx_tex_fmt fd4_pipe2tex(enum pipe_format format) { if (!formats[format].present) - return ~0; + return TFMT4_NONE; return formats[format].tex; } @@ -357,7 +357,7 @@ enum a4xx_color_fmt fd4_pipe2color(enum pipe_format format) { if (!formats[format].present) - return ~0; + return RB4_NONE; return formats[format].rb; } diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c index 8f60b51bf8f..ee6403f9c5d 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c @@ -56,12 +56,12 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen, return false; if ((usage & PIPE_BIND_VERTEX_BUFFER) && - (fd4_pipe2vtx(format) != (enum a4xx_vtx_fmt)~0)) { + (fd4_pipe2vtx(format) != VFMT4_NONE)) { retval |= PIPE_BIND_VERTEX_BUFFER; } if ((usage & PIPE_BIND_SAMPLER_VIEW) && - (fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0) && + (fd4_pipe2tex(format) != TFMT4_NONE) && (target == PIPE_BUFFER || util_format_get_blocksize(format) != 12)) { retval |= PIPE_BIND_SAMPLER_VIEW; @@ -71,8 +71,8 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen, PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | PIPE_BIND_SHARED)) && - (fd4_pipe2color(format) != (enum a4xx_color_fmt)~0) && - (fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0)) { + (fd4_pipe2color(format) != RB4_NONE) && + (fd4_pipe2tex(format) != TFMT4_NONE)) { retval |= usage & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | @@ -86,7 +86,7 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen, if ((usage & PIPE_BIND_DEPTH_STENCIL) && (fd4_pipe2depth(format) != (enum a4xx_depth_format)~0) && - (fd4_pipe2tex(format) != (enum a4xx_tex_fmt)~0)) { + (fd4_pipe2tex(format) != TFMT4_NONE)) { retval |= PIPE_BIND_DEPTH_STENCIL; }