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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27927>
This commit is contained in:
Faith Ekstrand 2024-03-10 10:56:26 -05:00 committed by Marge Bot
parent df90d80d9d
commit 0ed7bce8e5

View file

@ -59,21 +59,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