From d47541285965b4f255d1e8c686d38f6e4b96fd0e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 19 Aug 2020 16:40:22 -0400 Subject: [PATCH] panfrost: Pack compute Midgard properties Now that we have XML for it. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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)); } } -- 2.30.2