Lima cannot handle too many vertices because of limited pre-allocated buffer
Submitted by Icenowy Zheng
Assigned to mes..@..op.org
Link to original bug (#110408)
Description
When I try to run the bump:bump-render=high-poly test of glmark2-es2-drm on Lima, it crashes with a segfault.
The backtrace shows: #0 0x0000ffffb3ab03e0 lima_ctx_buff_va (sun4i-drm_dri.so) #1 (closed) 0x0000ffffb3ab43b4 lima_update_varying (sun4i-drm_dri.so) #2 (closed) 0x0000ffffb3619304 u_vbuf_draw_vbo (sun4i-drm_dri.so) #3 (closed) 0x0000ffffb37b15e4 st_draw_vbo (sun4i-drm_dri.so) #4 (closed) 0x0000ffffb3852938 _mesa_draw_arrays (sun4i-drm_dri.so) #5 (closed) 0x0000aaaade1d3954 _ZN4Mesh10render_vboEv (glmark2-es2-drm) #6 (closed) 0x0000aaaade16dce4 _ZN9SceneBump4drawEv (glmark2-es2-drm) #7 (closed) 0x0000aaaade156d10 _ZN8MainLoop4drawEv (glmark2-es2-drm) #8 (closed) 0x0000aaaade157540 _ZN8MainLoop4stepEv (glmark2-es2-drm) #9 (closed) 0x0000aaaade14aca0 _Z12do_benchmarkR6Canvas (glmark2-es2-drm) #10 (closed) 0x0000aaaade148948 main (glmark2-es2-drm) #11 (closed) 0x0000ffffb400c638 __libc_start_main (libc.so.6) #12 (closed) 0x0000aaaade14aaf0 $x (glmark2-es2-drm) #13 (closed) 0x0000aaaade14aaf0 $x (glmark2-es2-drm)
From inspection, lima_ctx_buff_va seems to be refering to a context buffer that haven't been successfully allocated, and in lima_update_varying() the allocation failure seems to be because the requested memory size is too big (because the vertex count is big, 144000 for bump:bump-render=high-poly).
Should we use some better way than u_suballocator to allocate the memory for the varying storage?
Version: git