Commit 53f4da73 authored by Stylon Wang's avatar Stylon Wang Committed by Alex Deucher

drm/amd/display: Guard Freesync HDMI parsing with dc_lock

[Why]
All calls into DC must be guarded by dc_lock because DC code
is not safe against multi-thread or re-entry.

[How]
Hold dc_lock when calling DC interfaces to parse Freesync HDMI.
Reviewed-by: default avatarRoman Li <Roman.Li@amd.com>
Acked-by: default avatarAlan Liu <HaoPing.Liu@amd.com>
Signed-off-by: default avatarStylon Wang <stylon.wang@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3a9c6f9a
...@@ -10213,11 +10213,15 @@ static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector, ...@@ -10213,11 +10213,15 @@ static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector,
struct amdgpu_hdmi_vsdb_info *vsdb_info) struct amdgpu_hdmi_vsdb_info *vsdb_info)
{ {
struct amdgpu_device *adev = drm_to_adev(aconnector->base.dev); struct amdgpu_device *adev = drm_to_adev(aconnector->base.dev);
bool ret;
mutex_lock(&adev->dm.dc_lock);
if (adev->dm.dmub_srv) if (adev->dm.dmub_srv)
return parse_edid_cea_dmub(&adev->dm, edid_ext, len, vsdb_info); ret = parse_edid_cea_dmub(&adev->dm, edid_ext, len, vsdb_info);
else else
return parse_edid_cea_dmcu(&adev->dm, edid_ext, len, vsdb_info); ret = parse_edid_cea_dmcu(&adev->dm, edid_ext, len, vsdb_info);
mutex_unlock(&adev->dm.dc_lock);
return ret;
} }
static int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector, static int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment