panfrost: Set workgroups z to 32 for non-instanced graphics
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 16 Aug 2019 23:21:45 +0000 (16:21 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 15:40:51 +0000 (08:40 -0700)
This is a blob quirk; in so much as I know, the hardware doesn't care.
But we're trying to be bit-identical to take as much entropy out of
traces as possible, so let's introduce the quirk.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_compute.c
src/panfrost/encoder/pan_encoder.h
src/panfrost/encoder/pan_invocation.c

index d0b2e132295c631e69c7f927a1fb0ee6d9ae5101..50e70cd8298ef0de423bad84d28be9784be49586 100644 (file)
@@ -119,7 +119,7 @@ panfrost_launch_grid(struct pipe_context *pipe,
 
         panfrost_pack_work_groups_compute(&payload->prefix,
                         info->grid[0], info->grid[1], info->grid[2],
-                        info->block[0], info->block[1], info->block[2]);
+                        info->block[0], info->block[1], info->block[2], false);
 
         /* Upload the payload */
 
index 4d8ab61e46dea8fedef0713a81f7974cc3230a56..aba3ebacf2c82de81b9a80c13878468a58898768 100644 (file)
@@ -39,7 +39,8 @@ panfrost_pack_work_groups_compute(
         unsigned num_z,
         unsigned size_x,
         unsigned size_y,
-        unsigned size_z);
+        unsigned size_z,
+        bool quirk_graphics);
 
 void
 panfrost_pack_work_groups_fused(
index 810fed3a96960ba75bc82618dfa73667e914937e..96efd190d828041c71ac7c1d55d966ab73a5dc46 100644 (file)
@@ -47,7 +47,8 @@ panfrost_pack_work_groups_compute(
         unsigned num_z,
         unsigned size_x,
         unsigned size_y,
-        unsigned size_z)
+        unsigned size_z,
+        bool quirk_graphics)
 {
         /* First of all, all 6 values are off-by-one (strictly positive).
          * Account for that, first by ensuring all values are strictly positive
@@ -98,6 +99,13 @@ panfrost_pack_work_groups_compute(
         out->workgroups_y_shift = shifts[4];
         out->workgroups_z_shift = shifts[5];
 
+        /* Quirk: for non-instanced graphics, the blob sets workgroups_z_shift
+         * = 32. This doesn't appear to matter to the hardware, but it's good
+         * to be bit-identical. */
+
+        if (quirk_graphics && (num_z <= 1))
+                out->workgroups_z_shift = 32;
+
         /* Special fields */
         out->workgroups_x_shift_2 = MAX2(out->workgroups_x_shift, 2);
         out->workgroups_x_shift_3 = out->workgroups_x_shift_2;
@@ -115,7 +123,7 @@ panfrost_pack_work_groups_fused(
         unsigned size_y,
         unsigned size_z)
 {
-        panfrost_pack_work_groups_compute(vertex, num_x, num_y, num_z, size_x, size_y, size_z);
+        panfrost_pack_work_groups_compute(vertex, num_x, num_y, num_z, size_x, size_y, size_z, true);
 
         /* Copy results over */
         tiler->invocation_count = vertex->invocation_count;