From f93a48e4e3462ac214b8f5d1217cbe640d0cd34b Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Wed, 8 Jan 2025 13:51:07 -0800 Subject: [PATCH] panfrost: fix hang by using MALI_PIXEL_KILL_WEAK_EARLY in color preload Setting zs_update_operation = FORCE_EARLY for color preloads triggers hangs in the dEQP-VK.rasterization.rasterization_order_attachment_access depth/stencil tests. I didn't determine why this is the case, but the DDK uses WEAK_EARLY for color preload, and doing the same here fixes the hang. WEAK_EARLY requires ATEST, so I removed .is_blit=true from the compiler inputs. There aren't any known hangs outside of the one set of vulkan CTS tests, and in particular no known hangs in the gallium driver. Because the reason for the hangs is not understood, I also changed the gallium driver to use WEAK_EARLY, under the assumption that the same conditions that trigger the hang in vulkan might occur in GL. Signed-off-by: Benjamin Lee Fixes: edd98aac3f1 ("panfrost: Add support for native wallpapering on Bifrost") Reviewed-by: Lars-Ivar Hesselberg Simonsen Acked-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_fb_preload.c | 11 ++++------- src/panfrost/ci/panfrost-g52-fails.txt | 3 --- src/panfrost/ci/panfrost-g610-fails.txt | 3 --- src/panfrost/vulkan/panvk_vX_cmd_fb_preload.c | 11 ++++------- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_fb_preload.c b/src/gallium/drivers/panfrost/pan_fb_preload.c index 17e103d18df..b28572bf6cc 100644 --- a/src/gallium/drivers/panfrost/pan_fb_preload.c +++ b/src/gallium/drivers/panfrost/pan_fb_preload.c @@ -258,9 +258,8 @@ pan_preload_emit_rsd(const struct pan_preload_shader_data *preload_shader, cfg.properties.zs_update_operation = MALI_PIXEL_KILL_FORCE_LATE; cfg.properties.pixel_kill_operation = MALI_PIXEL_KILL_FORCE_LATE; } else { - /* Skipping ATEST requires forcing Z/S */ - cfg.properties.zs_update_operation = MALI_PIXEL_KILL_FORCE_EARLY; - cfg.properties.pixel_kill_operation = MALI_PIXEL_KILL_FORCE_EARLY; + cfg.properties.zs_update_operation = MALI_PIXEL_KILL_WEAK_EARLY; + cfg.properties.pixel_kill_operation = MALI_PIXEL_KILL_WEAK_EARLY; } /* However, while shaders writing Z/S can normally be killed, on v6 @@ -587,7 +586,6 @@ pan_preload_get_shader(struct pan_fb_preload_cache *cache, struct panfrost_compile_inputs inputs = { .gpu_id = cache->gpu_id, - .is_blit = true, .no_idvs = true, }; struct util_dynarray binary; @@ -1189,9 +1187,8 @@ pan_preload_emit_dcd(struct pan_fb_preload_cache *cache, struct pan_pool *pool, cfg.pixel_kill_operation = MALI_PIXEL_KILL_FORCE_LATE; cfg.blend_count = 0; } else { - /* Skipping ATEST requires forcing Z/S */ - cfg.zs_update_operation = MALI_PIXEL_KILL_FORCE_EARLY; - cfg.pixel_kill_operation = MALI_PIXEL_KILL_FORCE_EARLY; + cfg.zs_update_operation = MALI_PIXEL_KILL_WEAK_EARLY; + cfg.pixel_kill_operation = MALI_PIXEL_KILL_WEAK_EARLY; cfg.blend = blend.gpu; cfg.blend_count = bd_count; diff --git a/src/panfrost/ci/panfrost-g52-fails.txt b/src/panfrost/ci/panfrost-g52-fails.txt index c9e2a1caf67..f9345dddcfd 100644 --- a/src/panfrost/ci/panfrost-g52-fails.txt +++ b/src/panfrost/ci/panfrost-g52-fails.txt @@ -2820,6 +2820,3 @@ dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.indexed_draw.draw_instanced_inde dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.indexed_draw.draw_instanced_indexed_triangle_strip_offset_negative_large_with_bind_offset_with_alloc_offset,Fail dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.indexed_draw.draw_instanced_indexed_triangle_strip_with_alloc_offset,Fail dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.indexed_draw.draw_instanced_indexed_triangle_strip_with_bind_offset_with_alloc_offset,Fail - -dEQP-VK.rasterization.rasterization_order_attachment_access.depth.samples_1.multi_draw_barriers,Crash -dEQP-VK.rasterization.rasterization_order_attachment_access.stencil.samples_1.multi_draw_barriers,Crash diff --git a/src/panfrost/ci/panfrost-g610-fails.txt b/src/panfrost/ci/panfrost-g610-fails.txt index 78d770919d7..2de17518f10 100644 --- a/src/panfrost/ci/panfrost-g610-fails.txt +++ b/src/panfrost/ci/panfrost-g610-fails.txt @@ -268,9 +268,6 @@ dEQP-VK.renderpass2.suballocation.attachment_allocation.input_output.63,Fail dEQP-VK.glsl.loops.special.do_while_dynamic_iterations.dowhile_trap_vertex,Crash -dEQP-VK.rasterization.rasterization_order_attachment_access.depth.samples_1.multi_draw_barriers,Crash -dEQP-VK.rasterization.rasterization_order_attachment_access.stencil.samples_1.multi_draw_barriers,Crash - dEQP-VK.wsi.wayland.swapchain.simulate_oom.composite_alpha,Crash dEQP-VK.wsi.wayland.swapchain.simulate_oom.exclusive_nonzero_queues,Crash dEQP-VK.wsi.wayland.swapchain.simulate_oom.image_array_layers,Crash diff --git a/src/panfrost/vulkan/panvk_vX_cmd_fb_preload.c b/src/panfrost/vulkan/panvk_vX_cmd_fb_preload.c index 28d96508def..248c3662faf 100644 --- a/src/panfrost/vulkan/panvk_vX_cmd_fb_preload.c +++ b/src/panfrost/vulkan/panvk_vX_cmd_fb_preload.c @@ -172,7 +172,6 @@ get_preload_shader(struct panvk_device *dev, struct panfrost_compile_inputs inputs = { .gpu_id = phys_dev->kmod.props.gpu_prod_id, .no_ubo_to_push = true, - .is_blit = true, }; pan_shader_preprocess(nir, inputs.gpu_id); @@ -375,9 +374,8 @@ cmd_emit_dcd(struct panvk_cmd_buffer *cmdbuf, struct pan_fb_info *fbinfo, cfg.stencil_back = cfg.stencil_front; if (key->aspects == VK_IMAGE_ASPECT_COLOR_BIT) { - /* Skipping ATEST requires forcing Z/S */ - cfg.properties.zs_update_operation = MALI_PIXEL_KILL_FORCE_EARLY; - cfg.properties.pixel_kill_operation = MALI_PIXEL_KILL_FORCE_EARLY; + cfg.properties.zs_update_operation = MALI_PIXEL_KILL_WEAK_EARLY; + cfg.properties.pixel_kill_operation = MALI_PIXEL_KILL_WEAK_EARLY; } else { /* Writing Z/S requires late updates */ cfg.properties.zs_update_operation = MALI_PIXEL_KILL_FORCE_LATE; @@ -619,9 +617,8 @@ cmd_emit_dcd(struct panvk_cmd_buffer *cmdbuf, struct pan_fb_info *fbinfo, pan_pack(&dcds[dcd_idx], DRAW, cfg) { if (key->aspects == VK_IMAGE_ASPECT_COLOR_BIT) { - /* Skipping ATEST requires forcing Z/S */ - cfg.zs_update_operation = MALI_PIXEL_KILL_FORCE_EARLY; - cfg.pixel_kill_operation = MALI_PIXEL_KILL_FORCE_EARLY; + cfg.zs_update_operation = MALI_PIXEL_KILL_WEAK_EARLY; + cfg.pixel_kill_operation = MALI_PIXEL_KILL_WEAK_EARLY; cfg.blend = bds.gpu; cfg.blend_count = bd_count;