panfrost: Implement workgroups_x_shift_2 quirk
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 16 Aug 2019 23:31:00 +0000 (16:31 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 15:40:51 +0000 (08:40 -0700)
I'm not sure why this is done this way, but let's follow the blob.

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

index 96efd190d828041c71ac7c1d55d966ab73a5dc46..8fb1669c9ed18213c63c51557a7c0f9f9cd89009 100644 (file)
@@ -106,8 +106,17 @@ panfrost_pack_work_groups_compute(
         if (quirk_graphics && (num_z <= 1))
                 out->workgroups_z_shift = 32;
 
-        /* Special fields */
-        out->workgroups_x_shift_2 = MAX2(out->workgroups_x_shift, 2);
+        /* Quirk: for graphics, workgroups_x_shift_2 must be at least 2,
+         * whereas for OpenCL it is simply equal to workgroups_x_shift. For GL
+         * compute, it seems it might *always* be 2, but this is suspicious and
+         * needs further investigation. (I'm probably just using GL wrong). */
+
+        if (quirk_graphics)
+                out->workgroups_x_shift_2 = MAX2(out->workgroups_x_shift, 2);
+        else
+                out->workgroups_x_shift_2 = out->workgroups_x_shift;
+
+        /* TODO: Compute workgroups_x_shift_3 */
         out->workgroups_x_shift_3 = out->workgroups_x_shift_2;
 }