aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2668-drm-amd-display-Fix-Freesync-enablement.patch
blob: 60c3d0fcb2929e13d227c01b6643f9a7f788face (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From a12ae6f937b04d618a837cbbe81c180053041634 Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Tue, 24 Oct 2017 09:19:32 -0400
Subject: [PATCH 2668/4131] drm/amd/display: Fix Freesync enablement

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@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@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 9c4b2d8..dd69c02 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2625,9 +2625,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.7.4