Skip to contentSkip to conversation

mesa: Fix clang build error w/ util_blitter_get_color_format_for_zs()

PATCH In review John Stultz 3 participants 4 messages Jul 3, 2019 – Jul 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mesa: Fix clang build error w/ util_blitter_get_color_format_for_zs()

Building with clang, I'm seeing
u_blitter.h:627:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]

The util_blitter_get_color_format_for_zs() asserts for any unhandled types, so we do not expect to reach the end of the function here.

But provide a dummy return with an explicit assert above to ensure we don't hit it with any future changes to the logic.

Cc Rob Clark <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Alistair Strachan <[email protected]>
Cc Greg Hartman <[email protected]>
Cc Tapani Pälli <[email protected]>
Cc Marek Olšák <[email protected]>
---
 src/gallium/auxiliary/util/u_blitter.h | 3 +++
 1 file changed, 3 insertions(+)
src/gallium/auxiliary/util/u_blitter.h +3 -0
index 9e3fa55e648..7d6c3db64da 100644
@@ -624,6 +624,9 @@ util_blitter_get_color_format_for_zs(enum pipe_format format)
    default:
       assert(0);
    }
+   assert(0);
+   /*XXX NEVER GET HERE*/
+   return PIPE_FORMAT_R32G32_UINT;
 }
 
 #ifdef __cplusplus
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 mesa: Add ir3/ir3_nir_imul.c generation to Android.mk

With current master we're seeing build failures with AOSP:
error: undefined symbol: ir3_nir_lower_imul

This is due to the ir3_nir_imul.c file not being generated in the Android.mk files.

This patch simply adds it to the Android build, after which thigns build and boot ok on db410c.

Cc Rob Clark <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Alistair Strachan <[email protected]>
Cc Greg Hartman <[email protected]>
Cc Tapani Pälli <[email protected]>
---
 src/freedreno/Makefile.sources               | 3 ++-
 src/gallium/drivers/freedreno/Android.gen.mk | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
src/freedreno/Makefile.sources +2 -1
index d8aaf2caecc..75ec361663b 100644
@@ -48,7 +48,8 @@ ir3_SOURCES := \
 	ir3/ir3_sun.c
 
 ir3_GENERATED_FILES := \
-	ir3/ir3_nir_trig.c
+	ir3/ir3_nir_trig.c \
+	ir3/ir3_nir_imul.c
 
 registers_FILES := \
 	registers/a2xx.xml.h \
src/gallium/drivers/freedreno/Android.gen.mk +7 -0
index d29ba159d5c..1d3ee5ff856 100644
@@ -28,11 +28,18 @@ ir3_nir_trig_deps := \
 	$(MESA_TOP)/src/freedreno/ir3/ir3_nir_trig.py \
 	$(MESA_TOP)/src/compiler/nir/nir_algebraic.py
 
+ir3_nir_imul_deps := \
+	$(MESA_TOP)/src/freedreno/ir3/ir3_nir_imul.py
+
 intermediates := $(call local-generated-sources-dir)
 
 $(intermediates)/ir3/ir3_nir_trig.c: $(ir3_nir_trig_deps)
 	@mkdir -p $(dir $@)
 	$(hide) $(MESA_PYTHON2) $< -p $(MESA_TOP)/src/compiler/nir > $@
 
+$(intermediates)/ir3/ir3_nir_imul.c: $(ir3_nir_imul_deps)
+	@mkdir -p $(dir $@)
+	$(hide) $(MESA_PYTHON2) $< -p $(MESA_TOP)/src/compiler/nir > $@
+
 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
 	$(ir3_GENERATED_FILES))
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] mesa: Add ir3/ir3_nir_imul.c generation to Android.mk

Quoted 10 lines · John Stultz

With current master we're seeing build failures with AOSP:
error: undefined symbol: ir3_nir_lower_imul

This is due to the ir3_nir_imul.c file not being generated in the Android.mk files.

This patch simply adds it to the Android build, after which thigns build and boot ok on db410c.

Quoted 8 lines
Cc Rob Clark <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Alistair Strachan <[email protected]>
Cc Greg Hartman <[email protected]>
Cc Tapani Pälli <[email protected]>
Quoted 45 lines
---
 src/freedreno/Makefile.sources               | 3 ++-
 src/gallium/drivers/freedreno/Android.gen.mk | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
src/freedreno/Makefile.sources +2 -1
index d8aaf2caecc..75ec361663b 100644
@@ -48,7 +48,8 @@ ir3_SOURCES := \
        ir3/ir3_sun.c
 
 ir3_GENERATED_FILES := \
-       ir3/ir3_nir_trig.c
+       ir3/ir3_nir_trig.c \
+       ir3/ir3_nir_imul.c
 
 registers_FILES := \
        registers/a2xx.xml.h \
src/gallium/drivers/freedreno/Android.gen.mk +7 -1
index d29ba159d5c..1d3ee5ff856 100644
@@ -28,11 +28,18 @@ ir3_nir_trig_deps := \
        $(MESA_TOP)/src/freedreno/ir3/ir3_nir_trig.py \
        $(MESA_TOP)/src/compiler/nir/nir_algebraic.py
 
+ir3_nir_imul_deps := \
+       $(MESA_TOP)/src/freedreno/ir3/ir3_nir_imul.py
+
 intermediates := $(call local-generated-sources-dir)
 
 $(intermediates)/ir3/ir3_nir_trig.c: $(ir3_nir_trig_deps)
        @mkdir -p $(dir $@)
        $(hide) $(MESA_PYTHON2) $< -p $(MESA_TOP)/src/compiler/nir > $@
 
+$(intermediates)/ir3/ir3_nir_imul.c: $(ir3_nir_imul_deps)
+       @mkdir -p $(dir $@)
+       $(hide) $(MESA_PYTHON2) $< -p $(MESA_TOP)/src/compiler/nir > $@
+
 LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
        $(ir3_GENERATED_FILES))
--

2.17.1

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to John Stultz

Thanks for the notice. I had already had a fix for this, but forgot to push it. It's pushed now.

Marek

Quoted 43 lines · John Stultz

Building with clang, I'm seeing
u_blitter.h:627:1: error: control may reach end of non-void function
[-Werror,-Wreturn-type]

The util_blitter_get_color_format_for_zs() asserts for any unhandled types, so we do not expect to reach the end of the function here.

But provide a dummy return with an explicit assert above to ensure we don't hit it with any future changes to the logic.

Cc Rob Clark <[email protected]>
Cc Emil Velikov <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Sumit Semwal <[email protected]>
Cc Alistair Strachan <[email protected]>
Cc Greg Hartman <[email protected]>
Cc Tapani Pälli <[email protected]>
Cc Marek Olšák <[email protected]>
---
 src/gallium/auxiliary/util/u_blitter.h | 3 +++
 1 file changed, 3 insertions(+)
src/gallium/auxiliary/util/u_blitter.h +3 -0
index 9e3fa55e648..7d6c3db64da 100644
@@ -624,6 +624,9 @@ util_blitter_get_color_format_for_zs(enum pipe_format
 format)
    default:
       assert(0);
    }
+   assert(0);
+   /*XXX NEVER GET HERE*/
+   return PIPE_FORMAT_R32G32_UINT;
 }
 

#ifdef __cplusplus
--
2.17.1

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel