Skip to content

Hold surface read lock throughout QWaylandEglWindow::updateSurface

Vlad Zahorodnii requested to merge vladz/qtwayland:msurfacelock into kde/5.15

QWaylandEGLWindow::updateSurface is called from both the main and render threads. It is called on the render thread when making the surface current, which could be after the window is hidden if there are cleanup jobs to be done.

Whilst the getter wlSurface() holds a read lock, it's not enough as we need the instance alive between the two calls and throughout the mesa code.

This potentially fixes a crash seen in mesa where we crash creating a surface for an invalid wl_surface object.

Change-Id: I497356e752ffaf3549d174f10c4c268234b02cbd Reviewed-by: Eskil Abrahamsen Blomfeldt eskil.abrahamsen-blomfeldt@qt.io (cherry picked from commit 50f1ccc6)


CCBUG: 449027

It most likely fixes Mesa passing bad wl_surface to zwp_linux_dmabuf_v1::get_surface_feedback

Merge request reports