Mesa (main): panfrost: Elucidate thread group split field

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 1 19:26:48 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Thu May 20 19:25:00 2021 -0400

panfrost: Elucidate thread group split field

Last unknown field in the XML :-)

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11074>

---

 src/gallium/drivers/panfrost/pan_context.c | 2 +-
 src/panfrost/lib/midgard.xml               | 4 +++-
 src/panfrost/lib/pan_invocation.c          | 8 +++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index c25802062aa..238bca7d174 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -553,7 +553,7 @@ panfrost_direct_draw(struct panfrost_batch *batch,
                         cfg.workgroups_x_shift = 0;
                         cfg.workgroups_y_shift = 0;
                         cfg.workgroups_z_shift = 32;
-                        cfg.unknown_shift = 2;
+                        cfg.thread_group_split = MALI_SPLIT_MIN_EFFICIENT;
                 }
         }
 
diff --git a/src/panfrost/lib/midgard.xml b/src/panfrost/lib/midgard.xml
index 1f526952a66..f27a9ef7450 100644
--- a/src/panfrost/lib/midgard.xml
+++ b/src/panfrost/lib/midgard.xml
@@ -626,7 +626,9 @@
     <field name="Workgroups X shift" size="6" start="1:10" type="uint"/>
     <field name="Workgroups Y shift" size="6" start="1:16" type="uint"/>
     <field name="Workgroups Z shift" size="6" start="1:22" type="uint"/>
-    <field name="Unknown shift" size="4" start="1:28" type="uint"/>
+    <field name="Thread group split" size="4" start="1:28" type="uint" prefix="MALI_SPLIT">
+      <value name="Min efficient" value="2"/>
+    </field>
   </struct>
 
   <enum name="Point Size Array Format">
diff --git a/src/panfrost/lib/pan_invocation.c b/src/panfrost/lib/pan_invocation.c
index c92296fc37e..6c0843e6755 100644
--- a/src/panfrost/lib/pan_invocation.c
+++ b/src/panfrost/lib/pan_invocation.c
@@ -98,9 +98,11 @@ panfrost_pack_work_groups_compute(
                 if (quirk_graphics && (num_z <= 1))
                         cfg.workgroups_z_shift = 32;
 
-                /* Quirk: for graphics, >= 2.  For compute, 2 without barriers
-                 * but equal to workgroups_x_shift with barriers */
+                /* For graphics, set to the minimum efficient value. For
+                 * compute, must equal the workgroup X shift for barriers to
+                 * function correctly */
 
-                cfg.unknown_shift = quirk_graphics ? 2 : cfg.workgroups_x_shift;
+                cfg.thread_group_split = quirk_graphics ?
+                        MALI_SPLIT_MIN_EFFICIENT : cfg.workgroups_x_shift;
         }
 }



More information about the mesa-commit mailing list