Mesa (main): turnip: Get indirect_draw_wfm_quirk from fd_dev_info
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jul 14 02:20:02 UTC 2021
Module: Mesa
Branch: main
Commit: 64af60cfb3f9386e34ef0f04653414447e5c1919
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=64af60cfb3f9386e34ef0f04653414447e5c1919
Author: Rob Clark <robdclark at chromium.org>
Date: Thu Jul 8 09:25:20 2021 -0700
turnip: Get indirect_draw_wfm_quirk from fd_dev_info
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 at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
---
src/freedreno/common/freedreno_dev_info.h | 12 ++++++++++++
src/freedreno/common/freedreno_devices.py | 2 ++
src/freedreno/vulkan/tu_cmd_buffer.c | 11 ++---------
3 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/freedreno/common/freedreno_dev_info.h b/src/freedreno/common/freedreno_dev_info.h
index 6bfef2934e7..a58250f2d16 100644
--- a/src/freedreno/common/freedreno_dev_info.h
+++ b/src/freedreno/common/freedreno_dev_info.h
@@ -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;
diff --git a/src/freedreno/common/freedreno_devices.py b/src/freedreno/common/freedreno_devices.py
index 29e98b0bde9..58be069b9cc 100644
--- a/src/freedreno/common/freedreno_devices.py
+++ b/src/freedreno/common/freedreno_devices.py
@@ -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:
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c
index a671839cf90..4ff660dabee 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -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);
More information about the mesa-commit
mailing list