mesa/src/egl/drivers
Pierre-Eric Pelloux-Prayer 6f47e87a60 egl/drm: flush before calling get_back_bo
Similar to what was done for Wayland in 58f90fd03f:
the glthread unmarhsal thread needs to be idle to avoid
concurrent calls to get_back_bo.

Also the existing code flushed after setting dri2_surf->back
to NULL so a new back buffer was always allocated by the
glthread flush:

|---------------> dri2_drm_swap_buffers
| get_back_bo (back=0x55eb93c6c488) >       # First get_back_bo call
| get_back_bo (back=0x55eb93c6c488 age: 0)<
|                                           # dri2_surf->back = NULL
|-----> FLUSH
| get_back_bo (back=nil) >                  # Another get_back_bo call
| get_back_bo (back=0x55eb93c6c4c8 age: 3)<
|-----< FLUSH
|---------------< dri2_drm_swap_buffers

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10437
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27143>
2024-02-01 09:26:33 +00:00
..
dri2 egl/drm: flush before calling get_back_bo 2024-02-01 09:26:33 +00:00
haiku egl/haiku: Remove some dead cleanup code 2023-11-22 19:38:59 +00:00
wgl mesa/st, dri2, wgl, glx: Restore flush_objects interop backward compat 2023-11-21 23:15:32 +00:00