]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Lock the CRTC when setting CRC source
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tue, 20 Aug 2019 17:15:25 +0000 (13:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Aug 2019 03:18:32 +0000 (22:18 -0500)
commiteb76b9bc065f1627bb48d1fbbcc2a33ad69c8a9a
treef8f438fcfe90086e0bcd8297fc94e74c860485d9
parente57b6a0decf7073933b17e7ef9ed6da7c5543d9f
drm/amd/display: Lock the CRTC when setting CRC source

[Why]
We need to ensure that we're holding the lock on the CRTC when setting
the CRC source since we're modifying the CRTC state directly.

We also need to wait for any outstanding non-blocking commits to finish
so they aren't reading state that's potentially being modified -
non-blocking commits don't hold the CRTC lock while doing commit tail
work.

[How]
Lock the CRTC using its mutex. While holding the lock check if there's
any commit active on the CRTC - if there is, it's non-blocking and
we should wait until it's finished by waiting for hw_done to be
signaled since that's the last point where we touch CRTC state.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c