From: Alyssa Rosenzweig Date: Wed, 19 Aug 2020 20:40:22 +0000 (-0400) Subject: panfrost: Pack compute Midgard properties X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d47541285965b4f255d1e8c686d38f6e4b96fd0e;p=mesa.git panfrost: Pack compute Midgard properties Now that we have XML for it. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 2efd512ddb6..2c6f2f28c1d 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -327,16 +327,17 @@ panfrost_emit_compute_shader(struct panfrost_context *ctx, meta->bifrost2.uniform_count = ss->uniform_count; meta->bifrost1.uniform_buffer_count = panfrost_ubo_count(ctx, st); } else { - meta->midgard1.uniform_count = ss->uniform_count; - meta->midgard1.work_count = ss->work_reg_count; - - /* TODO: This is not conformant on ES3 */ - meta->midgard1.flags_hi = MALI_SUPPRESS_INF_NAN; - - meta->midgard1.flags_lo = 0x20; - meta->midgard1.uniform_buffer_count = panfrost_ubo_count(ctx, st); + struct mali_midgard_properties_packed prop; + + pan_pack(&prop, MIDGARD_PROPERTIES, cfg) { + cfg.uniform_buffer_count = panfrost_ubo_count(ctx, st); + cfg.uniform_count = ss->uniform_count; + cfg.work_register_count = ss->work_reg_count; + cfg.writes_globals = ss->writes_global; + cfg.suppress_inf_nan = true; /* XXX */ + } - SET_BIT(meta->midgard1.flags_lo, MALI_WRITES_GLOBAL, ss->writes_global); + memcpy(&meta->midgard1, &prop, sizeof(prop)); } }