From cd5f77f6c2d85a75ff984fe0ddcbdae8f357db81 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 22 Aug 2025 11:04:18 +0200 Subject: [PATCH] radeonsi: sync harder on finish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the threaded submit code, there's a small window where the fence can be signalled but the buffer lists cleanup code from amdgpu_cs_submit_ib has not executed yet. This is harmless in general, because num_active_ioctls is an optimization. When the glFinish is called though, it's best to avoid this inconsistencies because it can create odd behavior as shown by the flakes being fixed by this commit. The test runs a query, uses glFinish and expect the results to be available. Since results availability depends on num_active_ioctls, it made the test flaky. Fix this by syncing when PIPE_FLUSH_HINT_FINISH is set. Reviewed-by: Marek Olšák Part-of: --- src/amd/ci/radeonsi-mendocino-flakes.txt | 28 ------------- src/amd/ci/radeonsi-stoney-flakes.txt | 15 ------- src/amd/ci/radeonsi-vangogh-flakes.txt | 15 ------- .../radeonsi/ci/gfx10_3-navi21-flakes.csv | 35 ----------------- .../radeonsi/ci/gfx11-navi31-flakes.csv | 39 ------------------- .../radeonsi/ci/gfx12-gfx1200-flakes.csv | 28 ------------- .../radeonsi/ci/gfx6-tahiti-flakes.csv | 12 ------ src/gallium/drivers/radeonsi/si_fence.c | 7 +++- 8 files changed, 6 insertions(+), 173 deletions(-) diff --git a/src/amd/ci/radeonsi-mendocino-flakes.txt b/src/amd/ci/radeonsi-mendocino-flakes.txt index 14a65993955..9f5cf32cfae 100644 --- a/src/amd/ci/radeonsi-mendocino-flakes.txt +++ b/src/amd/ci/radeonsi-mendocino-flakes.txt @@ -1,31 +1,3 @@ -dEQP-GLES3.functional.occlusion_query.all_occluders -dEQP-GLES3.functional.occlusion_query.conservative_all_occluders -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor -dEQP-GLES3.functional.occlusion_query.scissor_depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_stencil_write -dEQP-GLES3.functional.occlusion_query.stencil_clear -dEQP-GLES3.functional.occlusion_query.stencil_write dEQP-GLES31.functional.geometry_shading.basic.output_max KHR-GL46.direct_state_access.framebuffers_texture_layer_attachment diff --git a/src/amd/ci/radeonsi-stoney-flakes.txt b/src/amd/ci/radeonsi-stoney-flakes.txt index 485d8dcefd6..87df14da699 100644 --- a/src/amd/ci/radeonsi-stoney-flakes.txt +++ b/src/amd/ci/radeonsi-stoney-flakes.txt @@ -8,9 +8,6 @@ spec@egl_chromium_sync_control@conformance@eglGetSyncValuesCHROMIUM_msc_and_sbc_ # Flaky with a Fail result since the piglit fix made it stop crashing. glx@glx-make-current -# OQ flakes/fails started with no perceivable pattern around 2023-12-13 -dEQP-GLES3.functional.occlusion_query..* - # uprev Piglit in Mesa dEQP-GLES3.functional.occlusion_query.scissor_depth_write_stencil_write_stencil_clear glx@glx-multithread-texture @@ -19,18 +16,6 @@ spec@ext_image_dma_buf_import@ext_image_dma_buf_import-refcount-multithread dEQP-GLES2.functional.fbo.render.resize.rbo_bgra_stencil_index8 dEQP-GLES3.functional.fbo.render.recreate_color.tex2d_rg8ui_depth_stencil_rbo_depth24_stencil8 -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_stencil_clear - dEQP-GLES2.functional.texture.mipmap.2d.generate.rgba8888_non_square_fastest dEQP-GLES3.functional.texture.filtering.3d.formats.r11f_g11f_b10f_nearest_mipmap_nearest dEQP-GLES3.functional.texture.vertex.3d.wrap.repeat_clamp_mirror diff --git a/src/amd/ci/radeonsi-vangogh-flakes.txt b/src/amd/ci/radeonsi-vangogh-flakes.txt index fdddf9f4a8c..15b673e5f83 100644 --- a/src/amd/ci/radeonsi-vangogh-flakes.txt +++ b/src/amd/ci/radeonsi-vangogh-flakes.txt @@ -1,19 +1,4 @@ dEQP-GLES2.functional.fragment_ops.depth_stencil.stencil_ops.decr_decr_wrap_incr_wrap -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_write -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.stencil_write dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.r32f_r32f.cubemap_to_texture2d_array dEQP-GLES31.functional.geometry_shading.basic.output_256 dEQP-GLES31.functional.geometry_shading.basic.output_max diff --git a/src/gallium/drivers/radeonsi/ci/gfx10_3-navi21-flakes.csv b/src/gallium/drivers/radeonsi/ci/gfx10_3-navi21-flakes.csv index 13391beb9ad..2410805d1af 100644 --- a/src/gallium/drivers/radeonsi/ci/gfx10_3-navi21-flakes.csv +++ b/src/gallium/drivers/radeonsi/ci/gfx10_3-navi21-flakes.csv @@ -4,38 +4,3 @@ glx@glx-multithread-texture # Random: ../src/util/hash_table.c:311: hash_table_search: Assertion `!key_pointer_is_reserved(ht, key)' failed. spec@ext_image_dma_buf_import@ext_image_dma_buf_import-refcount-multithread - -dEQP-GLES3.functional.occlusion_query.all_occluders -dEQP-GLES3.functional.occlusion_query.conservative_all_occluders -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.scissor -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_write_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.scissor_depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.scissor_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.stencil_clear -dEQP-GLES3.functional.occlusion_query.stencil_write diff --git a/src/gallium/drivers/radeonsi/ci/gfx11-navi31-flakes.csv b/src/gallium/drivers/radeonsi/ci/gfx11-navi31-flakes.csv index 17b87ef16a0..1ae7508cd1e 100644 --- a/src/gallium/drivers/radeonsi/ci/gfx11-navi31-flakes.csv +++ b/src/gallium/drivers/radeonsi/ci/gfx11-navi31-flakes.csv @@ -86,45 +86,6 @@ dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.39 dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.44 dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.94 -dEQP-GLES3.functional.occlusion_query.all_occluders -dEQP-GLES3.functional.occlusion_query.conservative_all_occluders -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_write -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.scissor -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.scissor_depth_write -dEQP-GLES3.functional.occlusion_query.scissor_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_stencil_write -dEQP-GLES3.functional.occlusion_query.stencil_clear -dEQP-GLES3.functional.occlusion_query.stencil_write -dEQP-GLES3.functional.occlusion_query.stencil_write_stencil_clear - dEQP-GLES31.functional.tessellation.invariance.primitive_set.triangles_equal_spacing_cw_point_mode dEQP-GLES31.functional.tessellation.invariance.primitive_set.triangles_fractional_even_spacing_ccw_point_mode dEQP-GLES31.functional.tessellation.invariance.primitive_set.triangles_fractional_even_spacing_cw_point_mode diff --git a/src/gallium/drivers/radeonsi/ci/gfx12-gfx1200-flakes.csv b/src/gallium/drivers/radeonsi/ci/gfx12-gfx1200-flakes.csv index 67e310959b9..2b16c1a9fab 100644 --- a/src/gallium/drivers/radeonsi/ci/gfx12-gfx1200-flakes.csv +++ b/src/gallium/drivers/radeonsi/ci/gfx12-gfx1200-flakes.csv @@ -38,34 +38,6 @@ KHR-GLES32.core.geometry_shader.primitive_counter.points_to_line_strip_rp KHR-GLES32.core.geometry_shader.primitive_counter.triangles_to_line_strip KHR-GLES32.core.geometry_shader.primitive_counter.triangles_to_line_strip_rp -dEQP-GLES3.functional.occlusion_query.conservative_all_occluders -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear -dEQP-GLES3.functional.occlusion_query.conservative_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_write -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_depth_clear_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_write -dEQP-GLES3.functional.occlusion_query.conservative_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.all_occluders -dEQP-GLES3.functional.occlusion_query.depth_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write_stencil_write_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear -dEQP-GLES3.functional.occlusion_query.scissor_depth_write_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.scissor_depth_write_stencil_write -dEQP-GLES3.functional.occlusion_query.scissor_stencil_write -dEQP-GLES3.functional.occlusion_query.stencil_clear -dEQP-GLES3.functional.occlusion_query.stencil_write - KHR-GL46.shaders.uniform_block.random.all_shared_buffer.12 # These pass when run separately, but fail when run via deqp-runner diff --git a/src/gallium/drivers/radeonsi/ci/gfx6-tahiti-flakes.csv b/src/gallium/drivers/radeonsi/ci/gfx6-tahiti-flakes.csv index 6a612bf19bd..be1b0939a90 100644 --- a/src/gallium/drivers/radeonsi/ci/gfx6-tahiti-flakes.csv +++ b/src/gallium/drivers/radeonsi/ci/gfx6-tahiti-flakes.csv @@ -16,18 +16,6 @@ KHR-GLES32.core.ext_texture_shadow_lod.texturelod.samplercubearrayshadow_fragmen dEQP-GLES2.functional.flush_finish.finish dEQP-GLES2.functional.flush_finish.finish_wait -dEQP-GLES3.functional.occlusion_query.conservative_depth_write_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write -dEQP-GLES3.functional.occlusion_query.conservative_scissor_depth_write_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.conservative_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.depth_write_depth_clear_stencil_write -dEQP-GLES3.functional.occlusion_query.scissor_depth_clear_stencil_clear -dEQP-GLES3.functional.occlusion_query.scissor_stencil_write - dEQP-GLES3.functional.texture.shadow.2d_array.linear_mipmap_linear.greater_or_equal_depth24_stencil8 dEQP-GLES3.functional.texture.shadow.2d_array.linear_mipmap_linear.less_depth_component32f dEQP-GLES3.functional.texture.shadow.cube.nearest_mipmap_linear.not_equal_depth_component32f diff --git a/src/gallium/drivers/radeonsi/si_fence.c b/src/gallium/drivers/radeonsi/si_fence.c index af6d655f65d..f1fa9a33360 100644 --- a/src/gallium/drivers/radeonsi/si_fence.c +++ b/src/gallium/drivers/radeonsi/si_fence.c @@ -538,7 +538,12 @@ static void si_flush_all_queues(struct pipe_context *ctx, } assert(!fine.buf); finish: - if (!(flags & (PIPE_FLUSH_DEFERRED | PIPE_FLUSH_ASYNC))) { + if (!(flags & (PIPE_FLUSH_DEFERRED | PIPE_FLUSH_ASYNC)) || + (flags & PIPE_FLUSH_HINT_FINISH)) { + /* sync if PIPE_FLUSH_HINT_FINISH is set: this is required to get the + * BOs' num_active_ioctls value updated before the fence status can be + * read. + */ ws->cs_sync_flush(&sctx->gfx_cs); } }