drm/amd/display: Fix race condition when turning off an output alone
authorAlan Liu <haoping.liu@amd.com>
Tue, 27 Jun 2023 04:21:51 +0000 (12:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 18 Jul 2023 15:14:56 +0000 (11:14 -0400)
commitfff7b95a5046be01df5883b3297139cf21bc8763
tree5943db2fc6f7e4adeb4c7973f1666a3c5c643cbc
parentc4ba2b50f2be8f0ce7bed41d9e5aca66dffc41d2
drm/amd/display: Fix race condition when turning off an output alone

[Why]
When 2 threads are doing commit_tail parallelly, one thread could
commit new streams to dc state but another thread remove it from dc
right away.

[How]
If we don't have new dm state change from commit_check, then we should
not call dc_commit_streams() in commit_tail. A new function
amdgpu_dm_commit_streams() is introduced to refator dc_commit_stream()
adjacent code and fix this issue.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Alan Liu <haoping.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c