From 8ee75c66d3a3d660d8a50e68d704d7f20ead909b Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sun, 10 Mar 2024 10:56:26 -0500 Subject: [PATCH] nvk: Always wait for the FALCON in set_priv_reg The previous version had an optimization where, instead of actually waiting on the FALCON to return, it would just do a bunch of nops in some cases. This seems broken at least on Turing+ and results in registers not ending up with the right values. It only really shows up when you set two registers back-to-back in which case the second SET_PRIV_REG may mess up the first. Part-of: (cherry picked from commit 0ed7bce8e5d2e0dfa68f98bd7fad33a7ba6051d8) --- .pick_status.json | 2 +- src/nouveau/vulkan/nvk_cmd_draw.c | 21 ++++++--------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d0665f49c33..39ba33497bd 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -334,7 +334,7 @@ "description": "nvk: Always wait for the FALCON in set_priv_reg", "nominated": false, "nomination_type": 3, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/nouveau/vulkan/nvk_cmd_draw.c b/src/nouveau/vulkan/nvk_cmd_draw.c index a430725f89a..166eb5799f2 100644 --- a/src/nouveau/vulkan/nvk_cmd_draw.c +++ b/src/nouveau/vulkan/nvk_cmd_draw.c @@ -62,21 +62,12 @@ nvk_mme_set_priv_reg(struct mme_builder *b) mme_mthd(b, NV9097_SET_FALCON04); mme_emit(b, mme_load(b)); - mme_if(b, ieq, s26, mme_imm(2)) { - struct mme_value loop_cond = mme_mov(b, mme_zero()); - mme_while(b, ine, loop_cond, mme_imm(1)) { - mme_state_to(b, loop_cond, NV9097_SET_MME_SHADOW_SCRATCH(0)); - mme_mthd(b, NV9097_NO_OPERATION); - mme_emit(b, mme_zero()); - }; - } - - mme_if(b, ine, s26, mme_imm(2)) { - mme_loop(b, mme_imm(10)) { - mme_mthd(b, NV9097_NO_OPERATION); - mme_emit(b, mme_zero()); - } - } + struct mme_value loop_cond = mme_mov(b, mme_zero()); + mme_while(b, ine, loop_cond, mme_imm(1)) { + mme_state_to(b, loop_cond, NV9097_SET_MME_SHADOW_SCRATCH(0)); + mme_mthd(b, NV9097_NO_OPERATION); + mme_emit(b, mme_zero()); + }; } VkResult