From 085612fce5ed5c642ccd959cfdcebbe28080c50a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 27 Oct 2023 14:18:35 +1000 Subject: [PATCH] radv: don't submit empty command buffers on encoder ring. the vcn enc/unified rings don't do nop packets, and hang with 0 sized cmd buffers. This just stops submitting 0 sized cmd buffers to the hw. Fixes hangs with dEQP-VK.video.decode.h264_i on navi3x Cc: mesa-stable Reviewed-by: Samuel Pitoiset Part-of: (cherry picked from commit f33683e4dad9e1dfb7dcd4f86bb86ef3e3954315) --- .pick_status.json | 2 +- src/amd/vulkan/radv_queue.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index aa427a542d3..3754fcb5018 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -24,7 +24,7 @@ "description": "radv: don't submit empty command buffers on encoder ring.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_queue.c b/src/amd/vulkan/radv_queue.c index 3d4382878d1..ec73cf785af 100644 --- a/src/amd/vulkan/radv_queue.c +++ b/src/amd/vulkan/radv_queue.c @@ -1641,8 +1641,11 @@ radv_queue_submit_normal(struct radv_queue *queue, struct vk_queue_submit *submi } queue->device->ws->cs_unchain(cmd_buffer->cs); - if (!chainable || !queue->device->ws->cs_chain(chainable, cmd_buffer->cs, queue->state.uses_shadow_regs)) - cs_array[num_submitted_cs++] = cmd_buffer->cs; + if (!chainable || !queue->device->ws->cs_chain(chainable, cmd_buffer->cs, queue->state.uses_shadow_regs)) { + /* don't submit empty command buffers to the kernel. */ + if (radv_queue_ring(queue) != AMD_IP_VCN_ENC || cmd_buffer->cs->cdw != 0) + cs_array[num_submitted_cs++] = cmd_buffer->cs; + } chainable = can_chain_next ? cmd_buffer->cs : NULL; }