gbm_surface_lock_front_buffer is returning the same buffer before it is released.
This happens when attempting to do triple buffering, the Xilinx Mali backend seems to only support double buffering but instead of returning an error when it runs out of buffers it locks the same buffer twice; before it has been safely released and is still on screen. Tearing then occurs.
gbm_surface_lock_front_buffer = A ✔️
gbm_surface_lock_front_buffer = B ✔️
gbm_surface_release_buffer(A) ✔️
gbm_surface_lock_front_buffer = A ✔️
gbm_surface_release_buffer(B) ✔️
gbm_surface_lock_front_buffer = B ✔️
gbm_surface_lock_front_buffer = A ❌ buffer returned before it was released (still on screen)
While this is a driver bug we could detect at runtime, ideally that shouldn't be necessary. The impact is low though. The buffers seem to be linear so the tearing is acceptable when it happens.