linux-stable/drivers/gpu/drm/vkms
Maíra Canal a0e6a017ab
drm/vkms: Fix race-condition between the hrtimer and the atomic commit
Currently, it is possible for the composer to be set as enabled and then
as disabled without a proper call for the vkms_vblank_simulate(). This
is problematic, because the driver would skip one CRC output, causing CRC
tests to fail. Therefore, we need to make sure that, for each time the
composer is set as enabled, a composer job is added to the queue.

In order to provide this guarantee, add a mutex that will lock before
the composer is set as enabled and will unlock only after the composer
job is added to the queue. This way, we can have a guarantee that the
driver won't skip a CRC entry.

This race-condition is affecting the IGT test "writeback-check-output",
making the test fail and also, leaking writeback framebuffers, as the
writeback job is queued, but it is not signaled. This patch avoids both
problems.

[v2]:
    * Create a new mutex and keep the spinlock across the atomic commit in
      order to avoid interrupts that could result in deadlocks.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Arthur Grillo <arthurgrillo@riseup.net>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230523123207.173976-1-mcanal@igalia.com
2023-07-27 20:32:50 -03:00
..
Makefile
vkms_composer.c drm/vkms: Fix race-condition between the hrtimer and the atomic commit 2023-07-27 20:32:50 -03:00
vkms_crtc.c drm/vkms: Fix race-condition between the hrtimer and the atomic commit 2023-07-27 20:32:50 -03:00
vkms_drv.c drm/vkms: Add support to 1D gamma LUT 2023-07-27 20:17:14 -03:00
vkms_drv.h drm/vkms: Fix race-condition between the hrtimer and the atomic commit 2023-07-27 20:32:50 -03:00
vkms_formats.c drm/vkms: Isolate writeback pixel conversion functions 2023-06-24 19:06:16 -03:00
vkms_formats.h drm/vkms: Isolate writeback pixel conversion functions 2023-06-24 19:06:16 -03:00
vkms_output.c drm/vkms: Remove <drm/drm_simple_kms_helper.h> include 2023-04-07 13:16:38 +02:00
vkms_plane.c drm/vkms: add rotate-270 property 2023-05-08 09:57:20 -03:00
vkms_writeback.c drm/vkms: Isolate writeback pixel conversion functions 2023-06-24 19:06:16 -03:00