Skip to content

plugins: sleep before testing upload images

After commit 7663fa26 Gallium driver for Radeon started to crash intermittently when testing the upload of images with different color formats to a surface.

The backtraces are the same:

#0  0x00007ff886d9213d in __memcpy_ssse3 () at /lib64/libc.so.6
#1  0x00007ff87780e882 in memcpy (__len=<optimized out>, __src=<optimized out>, __dest=<optimized out>) at /usr/include/bits/string_fortified.h:34
#2  0x00007ff87780e882 in util_copy_rect
    (dst=<optimized out>, format=<optimized out>, dst_stride=256, dst_x=0, dst_y=<optimized out>, width=<optimized out>, height=<optimized out>, src=<optimized out>, src_stride=128, src_x=0, src_y=<optimized out
>) at ../src/gallium/auxiliary/util/u_surface.c:105
#3  0x00007ff87780e9af in util_copy_box
    (dst=0x7ff88400e000 <error: Cannot access memory at address 0x7ff88400e000>, format=PIPE_FORMAT_R16G16_UNORM, dst_stride=256, dst_slice_stride=8192, dst_x=dst_x@entry=0, dst_y=dst_y@entry=0, dst_z=0, width=3
2, height=32, depth=1, src=0x7ff87864b8d0 "", src_stride=128, src_slice_stride=0, src_x=0, src_y=0, src_z=0) at ../src/gallium/auxiliary/util/u_surface.c:131
#4  0x00007ff877b28046 in u_default_texture_subdata
    (pipe=0x7ff8783c7ae0, resource=0x7ff8786464c0, level=<optimized out>, usage=<optimized out>, box=0x7ff885cf31e0, data=0x7ff87864b8d0, stride=128, layer_stride=0)
    at ../src/gallium/auxiliary/util/u_transfer.c:67
#5  0x00007ff8777a4513 in vlVaPutImage
    (ctx=<optimized out>, surface=<optimized out>, image=<optimized out>, src_x=<optimized out>, src_y=<optimized out>, src_width=<optimized out>, src_height=64, dest_x=0, dest_y=0, dest_width=64, dest_height=64
) at ../src/gallium/state_trackers/va/image.c:607
#6  0x00007ff884aeb02d in gst_vaapi_surface_put_image (surface=0x7ff87803b2d0, image=0x148aab0) at ../subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapisurface.c:790
#7  0x00007ff884a98016 in extract_allowed_surface_formats (display=0x7ff878004d10, img_formats=0x7ff878641f80, specified_format=GST_VIDEO_FORMAT_UNKNOWN, direction=GST_PAD_SINK)
    at ../subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginbase.c:1315

It looks like a race condition with the driver.

This is a workaround to the issue by adding a sleep of 1 ms before testing the next image upload.

Merge request reports