[PATCH 18/24] drm/amd/display: Add lock around updating freesync property

Harry Wentland harry.wentland at amd.com
Tue Apr 25 18:39:07 UTC 2017


Getting rid of the WARN_ONs in atomic_get_property

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

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 70826c7739c2..4eb3d819404a 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
@@ -1193,6 +1193,7 @@ static int amdgpu_freesync_update_property_atomic(
 	dev  = connector->dev;
 	adev = dev->dev_private;
 
+	drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
 	ret = drm_object_property_get_value(
 			&connector->base,
 			adev->mode_info.freesync_property,
@@ -1202,6 +1203,8 @@ static int amdgpu_freesync_update_property_atomic(
 				&connector->base,
 				adev->mode_info.freesync_property,
 				val_capable);
+	drm_modeset_unlock(&dev->mode_config.connection_mutex);
+
 	return ret;
 
 }
-- 
2.11.0



More information about the amd-gfx mailing list