panfrost: Set register allocation in the v7 RSD
authorAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 11 Jun 2021 19:34:10 +0000 (15:34 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 9 Jul 2021 23:15:28 +0000 (23:15 +0000)
Required to hit full occupancy. Now that this information is piped
through the compiler, we can do this correctly.

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

src/panfrost/lib/pan_shader.h

index 751d21a..6fa37bb 100644 (file)
@@ -119,6 +119,13 @@ pan_shader_prepare_bifrost_rsd(const struct panfrost_device *dev,
         unsigned fau_count = DIV_ROUND_UP(info->push.count, 2);
         rsd->preload.uniform_count = fau_count;
 
+        if (dev->arch == 7) {
+                rsd->properties.bifrost.shader_register_allocation =
+                        (info->work_reg_count <= 32) ?
+                        MALI_SHADER_REGISTER_ALLOCATION_32_PER_THREAD :
+                        MALI_SHADER_REGISTER_ALLOCATION_64_PER_THREAD;
+        }
+
         switch (info->stage) {
         case MESA_SHADER_VERTEX:
                 rsd->preload.vertex.vertex_id = true;