turnip: Get indirect_draw_wfm_quirk from fd_dev_info
authorRob Clark <robdclark@chromium.org>
Thu, 8 Jul 2021 16:25:20 +0000 (09:25 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 14 Jul 2021 01:58:00 +0000 (01:58 +0000)
At some point we might want to change this to minimum fw version, but
for now it can be a bool.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

src/freedreno/common/freedreno_dev_info.h
src/freedreno/common/freedreno_devices.py
src/freedreno/vulkan/tu_cmd_buffer.c

index 6bfef29..a58250f 100644 (file)
@@ -73,6 +73,18 @@ struct fd_dev_info {
           */
          bool storage_16bit;
 
+         /* The latest known a630_sqe.fw fails to wait for WFI before
+          * reading the indirect buffer when using CP_DRAW_INDIRECT_MULTI,
+          * so we have to fall back to CP_WAIT_FOR_ME except for a650
+          * which has a fixed firmware.
+          *
+          * TODO: There may be newer a630_sqe.fw released in the future
+          * which fixes this, if so we should detect it and avoid this
+          * workaround.  Once we have uapi to query fw version, we can
+          * replace this with minimum fw version.
+          */
+         bool indirect_draw_wfm_quirk;
+
          struct {
             uint32_t RB_UNKNOWN_8E04_blit;
             uint32_t PC_UNKNOWN_9805;
index 29e98b0..58be069 100644 (file)
@@ -176,6 +176,7 @@ a6xx_gen1 = dict(
         fibers_per_sp = 128 * 16,
         reg_size_vec4 = 96,
         ccu_cntl_gmem_unk2 = True,
+        indirect_draw_wfm_quirk = True,
     )
 
 # a640, a680:
@@ -184,6 +185,7 @@ a6xx_gen2 = dict(
         reg_size_vec4 = 96,
         supports_multiview_mask = True,
         has_z24uint_s8uint = True,
+        indirect_draw_wfm_quirk = True,
     )
 
 # a650:
index a671839..4ff660d 100644 (file)
@@ -3960,14 +3960,7 @@ tu_CmdDrawIndirect(VkCommandBuffer commandBuffer,
 
    tu6_emit_empty_vs_params(cmd);
 
-   /* The latest known a630_sqe.fw fails to wait for WFI before reading the
-    * indirect buffer when using CP_DRAW_INDIRECT_MULTI, so we have to fall
-    * back to CP_WAIT_FOR_ME except for a650 which has a fixed firmware.
-    *
-    * TODO: There may be newer a630_sqe.fw released in the future which fixes
-    * this, if so we should detect it and avoid this workaround.
-    */
-   if (cmd->device->physical_device->gpu_id != 650)
+   if (cmd->device->physical_device->info->a6xx.indirect_draw_wfm_quirk)
       draw_wfm(cmd);
 
    tu6_draw_common(cmd, cs, false, 0);
@@ -3994,7 +3987,7 @@ tu_CmdDrawIndexedIndirect(VkCommandBuffer commandBuffer,
 
    tu6_emit_empty_vs_params(cmd);
 
-   if (cmd->device->physical_device->gpu_id != 650)
+   if (cmd->device->physical_device->info->a6xx.indirect_draw_wfm_quirk)
       draw_wfm(cmd);
 
    tu6_draw_common(cmd, cs, true, 0);