aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0505-drm-amd-display-No-need-to-get-property-before-set.patch
blob: 87f3163c34356973b8ec5fbc22b0928691f57ef4 (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
From 0e83f224a429ec82cae3411ec22ba3f7d9b6164d Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Thu, 1 Jun 2017 12:21:34 -0400
Subject: [PATCH 0505/4131] drm/amd/display: No need to get property before set

Get property requires a lock but if we add it we get a deadlock
on MST display detection. There's really no need to get the
property before setting it.

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>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 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 2d8a9bb..a7e0ae8 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
@@ -1061,24 +1061,13 @@ static int amdgpu_freesync_update_property_atomic(
 				struct drm_connector *connector,
 				uint64_t val_capable)
 {
-	struct drm_device *dev;
-	struct amdgpu_device *adev;
-	int ret;
-	uint64_t val;
+	struct drm_device *dev = connector->dev;
+	struct amdgpu_device *adev = dev->dev_private;
 
-	dev  = connector->dev;
-	adev = dev->dev_private;
+	return drm_object_property_set_value(&connector->base,
+					     adev->mode_info.freesync_property,
+					     val_capable);
 
-	ret = drm_object_property_get_value(
-			&connector->base,
-			adev->mode_info.freesync_property,
-			&val);
-	if (ret == 0 && val != 0 && val_capable == 0)
-		ret = drm_object_property_set_value(
-				&connector->base,
-				adev->mode_info.freesync_property,
-				val_capable);
-	return ret;
 
 }
 
-- 
2.7.4