[PATCH 29/29] drm/amd/display: Fix Freesync enablement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With our recent change to save Freesync properties as part
of the atomic state we removed the call to enable freesync
when the property is being set. Apparently that is still
needed.

Signed-off-by: Harry Wentland <harry.wentland at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Harry Wentland <harry.wentland at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 6465a200578d..9fb4dfece5a5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2510,9 +2510,21 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector,
 		dm_new_state->underscan_enable = val;
 		ret = 0;
 	} else if (property == adev->mode_info.freesync_property) {
+		struct amdgpu_crtc *acrtc;
+		struct dm_crtc_state *acrtc_state;
+
 		dm_new_state->user_enable.enable_for_gaming = val;
 		dm_new_state->user_enable.enable_for_static = val;
 		dm_new_state->user_enable.enable_for_video = val;
+
+		if (adev->dm.freesync_module && connector_state->crtc) {
+			acrtc = to_amdgpu_crtc(connector_state->crtc);
+			acrtc_state = to_dm_crtc_state(connector_state->crtc->state);
+			mod_freesync_set_user_enable(adev->dm.freesync_module,
+						     &acrtc_state->stream, 1,
+						     &dm_new_state->user_enable);
+		}
+
 		ret = 0;
 	} else if (property == adev->mode_info.freesync_capable_property) {
 		dm_new_state->freesync_capable = val;
-- 
2.14.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux