Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit e06b196

Browse files
Tom Chunggregkh
Tom Chung
authored andcommitted
drm/amd/display: Fix VRR cannot enable
[ Upstream commit f91a9af ] [Why] Sometimes the VRR cannot enable after login to the desktop. User space may call the DRM_IOCTL_MODE_GETCONNECTOR right after the DRM_IOCTL_MODE_RMFB. After calling DRM_IOCTL_MODE_RMFB to remove all the frame buffer and it will cause the driver to disable the crtc and disable the link while calling the link_set_dpms_off(). It will cause the dpcd read failed in amdgpu_dm_update_freesync_caps() while try to get the DP_MSA_TIMING_PAR_IGNORED capability and think the sink side does not support VRR. [How] Use the dpcd_caps.allow_invalid_MSA_timing_param flag instead of reading from dpcd directly. dpcd_caps.allow_invalid_MSA_timing_param flag is updated during HPD. It is safe to replace the original method. Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com> Signed-off-by: Jerry Zuo <jerry.zuo@amd.com> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d43ced9 commit e06b196

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

+2-21
Original file line numberDiff line numberDiff line change
@@ -11812,25 +11812,6 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
1181211812
return ret;
1181311813
}
1181411814

11815-
static bool is_dp_capable_without_timing_msa(struct dc *dc,
11816-
struct amdgpu_dm_connector *amdgpu_dm_connector)
11817-
{
11818-
u8 dpcd_data;
11819-
bool capable = false;
11820-
11821-
if (amdgpu_dm_connector->dc_link &&
11822-
dm_helpers_dp_read_dpcd(
11823-
NULL,
11824-
amdgpu_dm_connector->dc_link,
11825-
DP_DOWN_STREAM_PORT_COUNT,
11826-
&dpcd_data,
11827-
sizeof(dpcd_data))) {
11828-
capable = (dpcd_data & DP_MSA_TIMING_PAR_IGNORED) ? true:false;
11829-
}
11830-
11831-
return capable;
11832-
}
11833-
1183411815
static bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm,
1183511816
unsigned int offset,
1183611817
unsigned int total_length,
@@ -12133,8 +12114,8 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
1213312114
sink->sink_signal == SIGNAL_TYPE_EDP)) {
1213412115
bool edid_check_required = false;
1213512116

12136-
if (is_dp_capable_without_timing_msa(adev->dm.dc,
12137-
amdgpu_dm_connector)) {
12117+
if (amdgpu_dm_connector->dc_link &&
12118+
amdgpu_dm_connector->dc_link->dpcd_caps.allow_invalid_MSA_timing_param) {
1213812119
if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
1213912120
amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
1214012121
amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;

0 commit comments

Comments
 (0)