aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0613-drm-amd-display-Get-freesync-properties.patch
blob: 07747aa8d8ec68788913994214d15911aaf196cf (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
48
49
50
51
52
53
54
55
From 69fdf5342d98523e6ae0710d6259cce86e145eba Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Fri, 16 Jun 2017 14:09:23 -0400
Subject: [PATCH 0613/4131] drm/amd/display: Get freesync properties

Eventually we should create proper atomic properties for freesync
but currently freesync is broken and we still have the legacy
properties. Simply return the legacy properties.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@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_types.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index 7f57017..be24225 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -1212,6 +1212,7 @@ int amdgpu_dm_connector_atomic_get_property(
 	struct dm_connector_state *dm_state =
 		to_dm_connector_state(state);
 	int ret = -EINVAL;
+	int i;
 
 	if (property == dev->mode_config.scaling_mode_property) {
 		switch (dm_state->scaling) {
@@ -1239,14 +1240,14 @@ int amdgpu_dm_connector_atomic_get_property(
 	} else if (property == adev->mode_info.underscan_property) {
 		*val = dm_state->underscan_enable;
 		ret = 0;
-	} else if (property == adev->mode_info.freesync_property) {
-		//TODO
-		*val = 0;
-		ret = 0;
-	} else if (property == adev->mode_info.freesync_capable_property) {
-		//TODO
-		*val = 0;
-		ret = 0;
+	} else if ((property == adev->mode_info.freesync_property) ||
+		   (property == adev->mode_info.freesync_capable_property)) {
+		for (i = 0; i < connector->base.properties->count; i++) {
+			if (connector->base.properties->properties[i] == property) {
+				*val = connector->base.properties->values[i];
+				ret = 0;
+			}
+		}
 	}
 	return ret;
 }
-- 
2.7.4