[PATCH 21/27] drm/amd/display: No need to get property before set
Harry Wentland
harry.wentland at amd.com
Fri Jun 9 20:11:34 UTC 2017
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.
Change-Id: I67d523b856665f8b2b952c2747de56be74a136de
Signed-off-by: Harry Wentland <harry.wentland at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at 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 5d44687c144c..7aa24057c2a5 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
@@ -1077,24 +1077,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.11.0
More information about the amd-gfx
mailing list