From f38fd3c5776d15b638a681064b1061bbedf414a5 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Thu, 13 May 2021 16:50:45 +0300 Subject: [PATCH] turnip: place a limit on the growth of BOs There is a limit on IB size, which on freedreno is set to 0x100000. Going beyond it results in hangs, however I found that the last 0x100000 packet just doesn't get executed. Thus the real limit is 0x0FFFFF. This could be tested by appending nops to the cmdstream and placing e.g. CP_INTERRUPT at the end, at any position other than being 0x100000 packet it results in a hang. Fixes: dEQP-VK.api.command_buffers.record_many_draws_secondary_2 dEQP-VK.api.command_buffers.record_many_draws_primary_2 However these tests could trigger hangcheck timeouts. Also this fixes hangs when opening captures of games in RenderDoc. Signed-off-by: Danylo Piliaiev Part-of: --- src/freedreno/ci/deqp-freedreno-a630-fails.txt | 1 - src/freedreno/ci/deqp-freedreno-a630-flakes.txt | 4 ++++ src/freedreno/vulkan/tu_cs.c | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/freedreno/ci/deqp-freedreno-a630-fails.txt b/src/freedreno/ci/deqp-freedreno-a630-fails.txt index 3ead68cc544..44b3eab5d4b 100644 --- a/src/freedreno/ci/deqp-freedreno-a630-fails.txt +++ b/src/freedreno/ci/deqp-freedreno-a630-fails.txt @@ -7,7 +7,6 @@ KHR-GL33.transform_feedback.draw_xfb_instanced_test,Crash KHR-GL33.transform_feedback.draw_xfb_stream_instanced_test,Crash KHR-GL33.transform_feedback.query_vertex_interleaved_test,Fail KHR-GL33.transform_feedback.query_vertex_separate_test,Fail -dEQP-VK.api.command_buffers.record_many_draws_secondary_2,Fail dEQP-VK.api.copy_and_blit.core.resolve_image.whole_array_image_one_region.4_bit,Fail dEQP-VK.api.copy_and_blit.core.resolve_image.whole_copy_before_resolving.4_bit,Fail dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail,Fail diff --git a/src/freedreno/ci/deqp-freedreno-a630-flakes.txt b/src/freedreno/ci/deqp-freedreno-a630-flakes.txt index c1a0824090d..94666089091 100644 --- a/src/freedreno/ci/deqp-freedreno-a630-flakes.txt +++ b/src/freedreno/ci/deqp-freedreno-a630-flakes.txt @@ -86,3 +86,7 @@ dEQP-GLES31.functional.tessellation.invariance.primitive_set.quads_equal_spacing dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_basic dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_scale dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_stencil_only + +# Could trip hangcheck timeout +dEQP-VK.api.command_buffers.record_many_draws_primary_2 +dEQP-VK.api.command_buffers.record_many_draws_secondary_2 \ No newline at end of file diff --git a/src/freedreno/vulkan/tu_cs.c b/src/freedreno/vulkan/tu_cs.c index cce9b78836f..59f7f702296 100644 --- a/src/freedreno/vulkan/tu_cs.c +++ b/src/freedreno/vulkan/tu_cs.c @@ -372,8 +372,10 @@ tu_cs_reserve_space(struct tu_cs *cs, uint32_t reserved_size) tu_cs_emit(cs, CP_COND_REG_EXEC_1_DWORDS(0)); } - /* double the size for the next bo */ - new_size <<= 1; + /* double the size for the next bo, also there is an upper + * bound on IB size, which appears to be 0x0fffff + */ + new_size = MIN2(new_size << 1, 0x0fffff); if (cs->next_bo_size < new_size) cs->next_bo_size = new_size; }