venus: add vn_relax_warn to check if at warn order

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
This commit is contained in:
Yiwei Zhang 2026-04-03 15:02:13 -07:00 committed by Marge Bot
parent b1de02b7ea
commit de86f0223d
2 changed files with 9 additions and 0 deletions

View file

@ -259,8 +259,10 @@ vn_relax(struct vn_relax_state *state)
return;
}
state->warn = false;
if (unlikely(*iter % (1 << warn_order) == 0)) {
struct vn_instance *instance = state->instance;
state->warn = true;
vn_log(instance, "stuck in %s wait with iter at %d", state->reason_str,
*iter);

View file

@ -273,6 +273,7 @@ struct vn_relax_state {
uint32_t iter;
const struct vn_relax_profile profile;
const char *reason_str;
bool warn;
};
/* TLS ring
@ -430,6 +431,12 @@ vn_relax(struct vn_relax_state *state);
void
vn_relax_fini(struct vn_relax_state *state);
static inline bool
vn_relax_warn(struct vn_relax_state *state)
{
return state->warn;
}
static_assert(sizeof(vn_object_id) >= sizeof(uintptr_t), "");
static inline VkResult