From bb80ed88737ce51023fe073f2401b8574d4d2496 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 1 Sep 2020 16:21:47 -0700 Subject: [PATCH] panfrost: Fix gnu-empty-initializer errors. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3473 Signed-off-by: Vinson Lee Reviewed-by: Alyssa Rosenzweig Part-of: --- 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): -- 2.30.2