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 <benjamin.lee@collabora.com>
Fixes: edd98aac3f ("panfrost: Add support for native wallpapering on Bifrost")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32954>
This commit is contained in:
Benjamin Lee 2025-01-08 13:51:07 -08:00 committed by Marge Bot
parent 79517d8a65
commit f93a48e4e3
4 changed files with 8 additions and 20 deletions

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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;