panvk/csf: check printf buffer one last time when queue is lost
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Without this, printf messages that were sent before a crash will be
lost, which makes shader printf pretty useless for debugging crashes.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40816>
This commit is contained in:
Olivia Lee 2025-10-27 20:46:00 -07:00 committed by Marge Bot
parent 5bd3b51cb9
commit 8de5b5802c
2 changed files with 12 additions and 2 deletions

View file

@ -1462,8 +1462,12 @@ panvk_per_arch(gpu_queue_check_status)(struct vk_queue *vk_queue)
for (uint32_t i = 0; i < PANVK_SUBQUEUE_COUNT; i++) {
panvk_priv_mem_readback(queue->subqueues[i].context, 0,
struct panvk_cs_subqueue_context, subq_ctx) {
if (subq_ctx->last_error != 0)
if (subq_ctx->last_error != 0) {
/* Check printf buffer one more time before exiting */
u_printf_with_ctx(stdout, &dev->printf.ctx);
return vk_queue_set_lost(&queue->vk, "CS_FAULT");
}
}
}
@ -1472,6 +1476,9 @@ panvk_per_arch(gpu_queue_check_status)(struct vk_queue *vk_queue)
if (!ret && !state.state)
return VK_SUCCESS;
/* Check printf buffer one more time before exiting */
u_printf_with_ctx(stdout, &dev->printf.ctx);
vk_queue_set_lost(&queue->vk,
"group state: err=%d, state=0x%x, fatal_queues=0x%x", ret,
state.state, state.fatal_queues);

View file

@ -393,8 +393,11 @@ panvk_per_arch(QueueWaitIdle)(VkQueue _queue)
/* we need to use vk_common_QueueWaitIdle if we ever go threaded */
assert(queue->vk.submit.mode != VK_QUEUE_SUBMIT_MODE_THREADED);
if (vk_device_is_lost(&dev->vk))
if (vk_device_is_lost(&dev->vk)) {
/* Check printf buffer one more time before exiting */
u_printf_with_ctx(stdout, &dev->printf.ctx);
return VK_ERROR_DEVICE_LOST;
}
ASSERTED int ret = drmSyncobjWait(dev->drm_fd, &queue->sync, 1,
INT64_MAX, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL,