[PATCH 64/81] drm/amd/display: Get freesync properties

sunpeng.li at amd.com sunpeng.li at amd.com
Tue Jul 25 13:54:24 UTC 2017


From: Harry Wentland <harry.wentland at amd.com>

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.

Change-Id: Ie5b8fb77e9886ef9d56b321317f78098522d52f6
Signed-off-by: Harry Wentland <harry.wentland at amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at 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 15a3d01..cdecd2f 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
@@ -1228,6 +1228,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) {
@@ -1255,14 +1256,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



More information about the amd-gfx mailing list