From 64af60cfb3f9386e34ef0f04653414447e5c1919 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 8 Jul 2021 09:25:20 -0700 Subject: [PATCH] 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 Part-of: --- 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 6bfef29..a58250f 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 29e98b0..58be069 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 a671839..4ff660d 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); -- 2.7.4