Skip to contentSkip to conversation

mesa: fix non-trivial designated initializers issue

PATCH In review [email protected] 3 participants 3 messages Apr 4, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesa: fix non-trivial designated initializers issue

From: Kai Kang <[email protected]>

It fails to compile intel/compiler/brw_simd_selection.cpp with g++ 7.5.0:

| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp: In function ‘int
brw_simd_select_for_workgroup_size(const intel_device_info*, const brw_cs_prog_data*, const unsigned int*)’:
| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp:205:7: sorry,
unimplemented: non-trivial designated initializers not supported

|        };
|        ^

Initialize the leading 2 members to fix the issue.

---
 ...on.cpp-fix-non-trivial-designated-in.patch | 59 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch
meta/recipes-graphics/mesa/files/0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch new file +59 -0
new file mode 100644
index 0000000000..9db738cdc0
@@ -0,0 +1,59 @@
+From 6fd92cfc8a52a1884b8bc45b9ac0c7ceaf492a58 Mon Sep 17 00:00:00 2001
+From: Kai Kang <[email protected]>
+Date: Mon, 27 Mar 2023 21:19:36 +0800
+Subject: [PATCH] brw_simd_selection.cpp: fix non-trivial designated
+ initializers issue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It fails to compile intel/compiler/brw_simd_selection.cpp with g++ 7.5.0:
+
+| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp: In function ‘int
+  brw_simd_select_for_workgroup_size(const intel_device_info*,
+  const brw_cs_prog_data*, const unsigned int*)’:
+| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp:205:7: sorry,
+  unimplemented: non-trivial designated initializers not supported
+|        };
+|        ^
+
+Initialize the leading 2 members to fix the issue.
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22138]
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+ src/intel/compiler/brw_simd_selection.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/intel/compiler/brw_simd_selection.cpp b/src/intel/compiler/brw_simd_selection.cpp
+index 1515e538b74..4c065f9884a 100644
+--- a/src/intel/compiler/brw_simd_selection.cpp
++++ b/src/intel/compiler/brw_simd_selection.cpp
+@@ -232,10 +232,14 @@ brw_simd_select_for_workgroup_size(const struct intel_device_info *devinfo,
+                                    const struct brw_cs_prog_data *prog_data,
+                                    const unsigned *sizes)
+ {
++   void *mem_ctx = ralloc_context(NULL);
++
+    if (!sizes || (prog_data->local_size[0] == sizes[0] &&
+                   prog_data->local_size[1] == sizes[1] &&
+                   prog_data->local_size[2] == sizes[2])) {
+       brw_simd_selection_state simd_state{
++         .mem_ctx = mem_ctx,
++         .devinfo = devinfo,
+          .prog_data = const_cast<struct brw_cs_prog_data *>(prog_data),
+       };
+ 
+@@ -257,8 +261,6 @@ brw_simd_select_for_workgroup_size(const struct intel_device_info *devinfo,
+    cloned.prog_mask = 0;
+    cloned.prog_spilled = 0;
+ 
+-   void *mem_ctx = ralloc_context(NULL);
+-
+    brw_simd_selection_state simd_state{
+       .mem_ctx = mem_ctx,
+       .devinfo = devinfo,
+-- 
+2.34.1
+
meta/recipes-graphics/mesa/mesa.inc +1 -0
index 8f72f25c17..caab1eff6d 100644
@@ -17,6 +17,7 @@ PE = "2"
 SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
+           file://0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch \
            "
 
 SRC_URI[sha256sum] = "01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4"
Signature · 1 line
2.17.1
#1 lore raw

2023. 04. 04. 11:21 keltezéssel, Kai Kang írta:

Quoted 3 lines

From: Kai Kang <[email protected]>

It fails to compile intel/compiler/brw_simd_selection.cpp with g++ 7.5.0:

Mesa officially needs GCC 8.0.0 or later.
https://docs.mesa3d.org/install.html

Quoted 104 lines

| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp: In function ‘int
brw_simd_select_for_workgroup_size(const intel_device_info*, const brw_cs_prog_data*, const unsigned int*)’:
| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp:205:7: sorry,
unimplemented: non-trivial designated initializers not supported

|        };
|        ^

Initialize the leading 2 members to fix the issue.

---
  ...on.cpp-fix-non-trivial-designated-in.patch | 59 +++++++++++++++++++
  meta/recipes-graphics/mesa/mesa.inc           |  1 +
  2 files changed, 60 insertions(+)

create mode 100644 meta/recipes-graphics/mesa/files/0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch

meta/recipes-graphics/mesa/files/0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch new file +59 -0
new file mode 100644
index 0000000000..9db738cdc0
@@ -0,0 +1,59 @@
+From 6fd92cfc8a52a1884b8bc45b9ac0c7ceaf492a58 Mon Sep 17 00:00:00 2001
+From: Kai Kang <[email protected]>
+Date: Mon, 27 Mar 2023 21:19:36 +0800
+Subject: [PATCH] brw_simd_selection.cpp: fix non-trivial designated
+ initializers issue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It fails to compile intel/compiler/brw_simd_selection.cpp with g++ 7.5.0:
+
+| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp: In function ‘int
+  brw_simd_select_for_workgroup_size(const intel_device_info*,
+  const brw_cs_prog_data*, const unsigned int*)’:
+| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp:205:7: sorry,
+  unimplemented: non-trivial designated initializers not supported
+|        };
+|        ^
+
+Initialize the leading 2 members to fix the issue.
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22138]
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+ src/intel/compiler/brw_simd_selection.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/intel/compiler/brw_simd_selection.cpp b/src/intel/compiler/brw_simd_selection.cpp
+index 1515e538b74..4c065f9884a 100644
+--- a/src/intel/compiler/brw_simd_selection.cpp
++++ b/src/intel/compiler/brw_simd_selection.cpp
+@@ -232,10 +232,14 @@ brw_simd_select_for_workgroup_size(const struct intel_device_info *devinfo,
+                                    const struct brw_cs_prog_data *prog_data,
+                                    const unsigned *sizes)
+ {
++   void *mem_ctx = ralloc_context(NULL);
++
+    if (!sizes || (prog_data->local_size[0] == sizes[0] &&
+                   prog_data->local_size[1] == sizes[1] &&
+                   prog_data->local_size[2] == sizes[2])) {
+       brw_simd_selection_state simd_state{
++         .mem_ctx = mem_ctx,
++         .devinfo = devinfo,
+          .prog_data = const_cast<struct brw_cs_prog_data *>(prog_data),
+       };
+
+@@ -257,8 +261,6 @@ brw_simd_select_for_workgroup_size(const struct intel_device_info *devinfo,
+    cloned.prog_mask = 0;
+    cloned.prog_spilled = 0;
+
+-   void *mem_ctx = ralloc_context(NULL);
+-
+    brw_simd_selection_state simd_state{
+       .mem_ctx = mem_ctx,
+       .devinfo = devinfo,
+--
+2.34.1
+
meta/recipes-graphics/mesa/mesa.inc +1 -1
index 8f72f25c17..caab1eff6d 100644
@@ -17,6 +17,7 @@ PE = "2"
  SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
             file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
             file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
+           file://0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch \
             "
 
  SRC_URI[sha256sum] = "01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#179678): https://lists.openembedded.org/g/openembedded-core/message/179678
Mute This Topic: https://lists.openembedded.org/mt/98056265/3617728
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
In reply to [email protected]
Quoted 91 lines · Kai Kang

From: Kai Kang <[email protected]>

It fails to compile intel/compiler/brw_simd_selection.cpp with g++ 7.5.0:

Quoted 1 line

mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp: In function ‘int

brw_simd_select_for_workgroup_size(const intel_device_info*, const brw_cs_prog_data*, const unsigned int*)’:

Quoted 1 line

mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp:205:7: sorry,

unimplemented: non-trivial designated initializers not supported

Quoted 2 lines
       };
       ^

Initialize the leading 2 members to fix the issue.

---
 ...on.cpp-fix-non-trivial-designated-in.patch | 59 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch
meta/recipes-graphics/mesa/files/0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch new file +59 -0
new file mode 100644
index 0000000000..9db738cdc0
@@ -0,0 +1,59 @@
+From 6fd92cfc8a52a1884b8bc45b9ac0c7ceaf492a58 Mon Sep 17 00:00:00 2001
+From: Kai Kang <[email protected]>
+Date: Mon, 27 Mar 2023 21:19:36 +0800
+Subject: [PATCH] brw_simd_selection.cpp: fix non-trivial designated
+ initializers issue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It fails to compile intel/compiler/brw_simd_selection.cpp with g++ 7.5.0:
+
+| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp: In function ‘int
+  brw_simd_select_for_workgroup_size(const intel_device_info*,
+  const brw_cs_prog_data*, const unsigned int*)’:
+| mesa-23.0.0/src/intel/compiler/brw_simd_selection.cpp:205:7: sorry,
+  unimplemented: non-trivial designated initializers not supported
+|        };
+|        ^
+
+Initialize the leading 2 members to fix the issue.
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22138]
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+ src/intel/compiler/brw_simd_selection.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/intel/compiler/brw_simd_selection.cpp b/src/intel/compiler/brw_simd_selection.cpp
+index 1515e538b74..4c065f9884a 100644
+--- a/src/intel/compiler/brw_simd_selection.cpp
++++ b/src/intel/compiler/brw_simd_selection.cpp
+@@ -232,10 +232,14 @@ brw_simd_select_for_workgroup_size(const struct intel_device_info *devinfo,
+                                    const struct brw_cs_prog_data *prog_data,
+                                    const unsigned *sizes)
+ {
++   void *mem_ctx = ralloc_context(NULL);
++
+    if (!sizes || (prog_data->local_size[0] == sizes[0] &&
+                   prog_data->local_size[1] == sizes[1] &&
+                   prog_data->local_size[2] == sizes[2])) {
+       brw_simd_selection_state simd_state{
++         .mem_ctx = mem_ctx,
++         .devinfo = devinfo,
+          .prog_data = const_cast<struct brw_cs_prog_data *>(prog_data),
+       };
+ 
+@@ -257,8 +261,6 @@ brw_simd_select_for_workgroup_size(const struct intel_device_info *devinfo,
+    cloned.prog_mask = 0;
+    cloned.prog_spilled = 0;
+ 
+-   void *mem_ctx = ralloc_context(NULL);
+-
+    brw_simd_selection_state simd_state{
+       .mem_ctx = mem_ctx,
+       .devinfo = devinfo,
+-- 
+2.34.1
+
meta/recipes-graphics/mesa/mesa.inc +0 -0
index 8f72f25c17..caab1eff6d 100644

meta/recipes-graphics/mesa/mesa.inc PE = "2" · line 23

Quoted 7 lines
meta/recipes-graphics/mesa/mesa.inc +1 -0
@@ -17,6 +17,7 @@ PE = "2"
 SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
            file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
+           file://0001-brw_simd_selection.cpp-fix-non-trivial-designated-in.patch \
            "
 
 SRC_URI[sha256sum] = "01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4"

There is feedback upstream suggesting this causes a memory leak?

Cheers,

Richard