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

Author: Vinson Lee <[email protected]>
Date:   Tue Sep  1 16:21:47 2020 -0700

panfrost: Fix gnu-empty-initializer errors.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3473
Signed-off-by: Vinson Lee <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6551>

---

 src/gallium/drivers/panfrost/pan_assemble.c  | 2 +-
 src/gallium/drivers/panfrost/pan_cmdstream.c | 2 +-
 src/gallium/drivers/panfrost/pan_resource.c  | 4 ++--
 src/panfrost/lib/gen_pack.py                 | 5 ++++-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_assemble.c 
b/src/gallium/drivers/panfrost/pan_assemble.c
index b231fc8e003..c2fcb3ac59c 100644
--- a/src/gallium/drivers/panfrost/pan_assemble.c
+++ b/src/gallium/drivers/panfrost/pan_assemble.c
@@ -241,7 +241,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
         s->info.stage = stage;
 
         /* Call out to Midgard compiler given the above NIR */
-        panfrost_program program = {};
+        panfrost_program program = {0};
         memcpy(program.rt_formats, state->rt_formats, 
sizeof(program.rt_formats));
 
         if (dev->quirks & IS_BIFROST) {
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c 
b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 777725d0a26..2e5ddc3e0b5 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -296,7 +296,7 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts,
         }
 
         for (unsigned i = 0; i < rt_count; ++i) {
-                struct mali_blend_flags_packed flags = {};
+                struct mali_blend_flags_packed flags = {0};
 
                 pan_pack(&flags, BLEND_FLAGS, cfg) {
                         if (blend[i].no_colour) {
diff --git a/src/gallium/drivers/panfrost/pan_resource.c 
b/src/gallium/drivers/panfrost/pan_resource.c
index a34656b5bdf..046a452cb04 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -730,7 +730,7 @@ static void
 pan_blit_from_staging(struct pipe_context *pctx, struct panfrost_gtransfer 
*trans)
 {
         struct pipe_resource *dst = trans->base.resource;
-        struct pipe_blit_info blit = {};
+        struct pipe_blit_info blit = {0};
 
         blit.dst.resource = dst;
         blit.dst.format   = dst->format;
@@ -750,7 +750,7 @@ static void
 pan_blit_to_staging(struct pipe_context *pctx, struct panfrost_gtransfer 
*trans)
 {
         struct pipe_resource *src = trans->base.resource;
-        struct pipe_blit_info blit = {};
+        struct pipe_blit_info blit = {0};
 
         blit.src.resource = src;
         blit.src.format   = src->format;
diff --git a/src/panfrost/lib/gen_pack.py b/src/panfrost/lib/gen_pack.py
index cf3e0feee22..5665f421efe 100644
--- a/src/panfrost/lib/gen_pack.py
+++ b/src/panfrost/lib/gen_pack.py
@@ -584,7 +584,10 @@ class Parser(object):
                 default_fields.append("   .{} = {{ {}_header 
}}".format(field.name, self.gen_prefix(safe_name(field.type.upper()))))
 
         print('#define %-40s\\' % (name + '_header'))
-        print(",  \\\n".join(default_fields))
+        if default_fields:
+            print(",  \\\n".join(default_fields))
+        else:
+            print('   0')
         print('')
 
     def emit_template_struct(self, name, group, opaque_structs):

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

Reply via email to