drm/vkms: avoid race-condition between flushing and destroying
After we flush the workqueue at the commit tale, we need to make sure that no work is queued until we destroy the state. Currently, new work can be queued in the workqueue, even after the commit tale, as the vblank thread is still running. Therefore, to avoid a race-condition that will lead to the trigger of a WARN_ON() at the function vkms_atomic_crtc_destroy_state(), add a mutex to protect the sections where the queue is manipulated. This way we can make sure that no work will be added to the workqueue between flushing the queue (at the commit tail) and destroying the state. Signed-off-by:Maíra Canal <mairacanal@riseup.net> Signed-off-by:
Louis Chauvet <louischauvet@bootlin.com>