panfrost: Pack compute Midgard properties
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 19 Aug 2020 20:40:22 +0000 (16:40 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 25 Aug 2020 15:05:35 +0000 (17:05 +0200)
Now that we have XML for it.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>

src/gallium/drivers/panfrost/pan_cmdstream.c

index 2efd512ddb6a819ec06e84814221e34543239af2..2c6f2f28c1d928383745640d725f144535069c04 100644 (file)
@@ -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));
         }
 }