Mesa (master): freedreno/a4xx: fix *_NONE enum conversion

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 30 14:48:32 UTC 2020


Module: Mesa
Branch: master
Commit: b1d309eaa39a695da5adc7dfd663cb2a4179710e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1d309eaa39a695da5adc7dfd663cb2a4179710e

Author: Shawn Guo <shawn.guo at linaro.org>
Date:   Tue Jun 30 20:40:53 2020 +0800

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 <shawn.guo at linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5693>

---

 src/gallium/drivers/freedreno/a4xx/fd4_format.c |  6 +++---
 src/gallium/drivers/freedreno/a4xx/fd4_screen.c | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

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;
 	}
 



More information about the mesa-commit mailing list