turnip: place a limit on the growth of BOs
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Thu, 13 May 2021 13:50:45 +0000 (16:50 +0300)
committerMarge Bot <eric+marge@anholt.net>
Mon, 31 May 2021 17:38:26 +0000 (17:38 +0000)
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 <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10786>

src/freedreno/ci/deqp-freedreno-a630-fails.txt
src/freedreno/ci/deqp-freedreno-a630-flakes.txt
src/freedreno/vulkan/tu_cs.c

index 3ead68c..44b3eab 100644 (file)
@@ -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
index c1a0824..9466608 100644 (file)
@@ -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
index cce9b78..59f7f70 100644 (file)
@@ -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;
    }