mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 05:28:05 +02:00
venus: set/check ring status bits independently
prepare for manipulation of the new VK_RING_STATUS_ALIVE_BIT_MESA during ring monitoring. Signed-off-by: Ryan Neph <ryanneph@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
This commit is contained in:
parent
bb4c10f85e
commit
3812a946d2
3 changed files with 15 additions and 10 deletions
|
|
@ -161,8 +161,9 @@ vn_relax(struct vn_relax_state *state)
|
|||
if (unlikely(*iter % (1 << warn_order) == 0)) {
|
||||
vn_log(NULL, "stuck in %s wait with iter at %d", reason, *iter);
|
||||
|
||||
if (vn_ring_fatal(ring)) {
|
||||
vn_log(NULL, "aborting on ring fatal error");
|
||||
const uint32_t status = vn_ring_load_status(ring);
|
||||
if (status & VK_RING_STATUS_FATAL_BIT_MESA) {
|
||||
vn_log(NULL, "aborting on ring fatal error at iter %d", *iter);
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,17 +27,18 @@ vn_ring_store_tail(struct vn_ring *ring)
|
|||
memory_order_release);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
uint32_t
|
||||
vn_ring_load_status(const struct vn_ring *ring)
|
||||
{
|
||||
/* must be called and ordered after vn_ring_store_tail for idle status */
|
||||
return atomic_load_explicit(ring->shared.status, memory_order_seq_cst);
|
||||
}
|
||||
|
||||
bool
|
||||
vn_ring_fatal(const struct vn_ring *ring)
|
||||
void
|
||||
vn_ring_unset_status_bits(struct vn_ring *ring, uint32_t mask)
|
||||
{
|
||||
return vn_ring_load_status(ring) & VK_RING_STATUS_FATAL_BIT_MESA;
|
||||
atomic_fetch_and_explicit(ring->shared.status, ~mask,
|
||||
memory_order_seq_cst);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ static_assert(ATOMIC_INT_LOCK_FREE == 2 && sizeof(atomic_uint) == 4,
|
|||
struct vn_ring_shared {
|
||||
const volatile atomic_uint *head;
|
||||
volatile atomic_uint *tail;
|
||||
const volatile atomic_uint *status;
|
||||
volatile atomic_uint *status;
|
||||
void *buffer;
|
||||
void *extra;
|
||||
};
|
||||
|
|
@ -89,6 +89,12 @@ vn_ring_fini(struct vn_ring *ring);
|
|||
struct vn_ring_submit *
|
||||
vn_ring_get_submit(struct vn_ring *ring, uint32_t shmem_count);
|
||||
|
||||
uint32_t
|
||||
vn_ring_load_status(const struct vn_ring *ring);
|
||||
|
||||
void
|
||||
vn_ring_unset_status_bits(struct vn_ring *ring, uint32_t mask);
|
||||
|
||||
bool
|
||||
vn_ring_submit(struct vn_ring *ring,
|
||||
struct vn_ring_submit *submit,
|
||||
|
|
@ -98,7 +104,4 @@ vn_ring_submit(struct vn_ring *ring,
|
|||
void
|
||||
vn_ring_wait(struct vn_ring *ring, uint32_t seqno);
|
||||
|
||||
bool
|
||||
vn_ring_fatal(const struct vn_ring *ring);
|
||||
|
||||
#endif /* VN_RING_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue