All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers
@ 2020-04-28 17:10 ` Michal Orzel
  0 siblings, 0 replies; 34+ messages in thread
From: Michal Orzel @ 2020-04-28 17:10 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel
  Cc: Michal Orzel, dri-devel, linux-kernel, intel-gfx

As suggested by the TODO list for the kernel DRM subsystem, replace
the deprecated functions that take/drop modeset locks with new helpers.

Signed-off-by: Michal Orzel <michalorzel.eng@gmail.com>
---
 drivers/gpu/drm/drm_mode_object.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
index 35c2719..901b078 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -402,12 +402,13 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
 {
 	struct drm_mode_obj_get_properties *arg = data;
 	struct drm_mode_object *obj;
+	struct drm_modeset_acquire_ctx ctx;
 	int ret = 0;
 
 	if (!drm_core_check_feature(dev, DRIVER_MODESET))
 		return -EOPNOTSUPP;
 
-	drm_modeset_lock_all(dev);
+	DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
 
 	obj = drm_mode_object_find(dev, file_priv, arg->obj_id, arg->obj_type);
 	if (!obj) {
@@ -427,7 +428,7 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
 out_unref:
 	drm_mode_object_put(obj);
 out:
-	drm_modeset_unlock_all(dev);
+	DRM_MODESET_LOCK_ALL_END(ctx, ret);
 	return ret;
 }
 
@@ -449,12 +450,13 @@ static int set_property_legacy(struct drm_mode_object *obj,
 {
 	struct drm_device *dev = prop->dev;
 	struct drm_mode_object *ref;
+	struct drm_modeset_acquire_ctx ctx;
 	int ret = -EINVAL;
 
 	if (!drm_property_change_valid_get(prop, prop_value, &ref))
 		return -EINVAL;
 
-	drm_modeset_lock_all(dev);
+	DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
 	switch (obj->type) {
 	case DRM_MODE_OBJECT_CONNECTOR:
 		ret = drm_connector_set_obj_prop(obj, prop, prop_value);
@@ -468,7 +470,7 @@ static int set_property_legacy(struct drm_mode_object *obj,
 		break;
 	}
 	drm_property_change_valid_put(prop, ref);
-	drm_modeset_unlock_all(dev);
+	DRM_MODESET_LOCK_ALL_END(ctx, ret);
 
 	return ret;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 34+ messages in thread
* [PATCH] drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers
@ 2020-04-26 10:01 ` Michal Orzel
  0 siblings, 0 replies; 34+ messages in thread
From: Michal Orzel @ 2020-04-26 10:01 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel
  Cc: Michal Orzel, dri-devel, linux-kernel

As suggested by the TODO list for the kernel DRM subsystem, replace
the deprecated functions that take/drop modeset locks with new helpers.

Signed-off-by: Michal Orzel <michalorzel.eng@gmail.com>
---
 drivers/gpu/drm/drm_mode_object.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
index 35c2719..901b078 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -402,12 +402,13 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
 {
 	struct drm_mode_obj_get_properties *arg = data;
 	struct drm_mode_object *obj;
+	struct drm_modeset_acquire_ctx ctx;
 	int ret = 0;
 
 	if (!drm_core_check_feature(dev, DRIVER_MODESET))
 		return -EOPNOTSUPP;
 
-	drm_modeset_lock_all(dev);
+	DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
 
 	obj = drm_mode_object_find(dev, file_priv, arg->obj_id, arg->obj_type);
 	if (!obj) {
@@ -427,7 +428,7 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
 out_unref:
 	drm_mode_object_put(obj);
 out:
-	drm_modeset_unlock_all(dev);
+	DRM_MODESET_LOCK_ALL_END(ctx, ret);
 	return ret;
 }
 
@@ -449,12 +450,13 @@ static int set_property_legacy(struct drm_mode_object *obj,
 {
 	struct drm_device *dev = prop->dev;
 	struct drm_mode_object *ref;
+	struct drm_modeset_acquire_ctx ctx;
 	int ret = -EINVAL;
 
 	if (!drm_property_change_valid_get(prop, prop_value, &ref))
 		return -EINVAL;
 
-	drm_modeset_lock_all(dev);
+	DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
 	switch (obj->type) {
 	case DRM_MODE_OBJECT_CONNECTOR:
 		ret = drm_connector_set_obj_prop(obj, prop, prop_value);
@@ -468,7 +470,7 @@ static int set_property_legacy(struct drm_mode_object *obj,
 		break;
 	}
 	drm_property_change_valid_put(prop, ref);
-	drm_modeset_unlock_all(dev);
+	DRM_MODESET_LOCK_ALL_END(ctx, ret);
 
 	return ret;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2020-05-05  8:51 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 17:10 [PATCH] drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers Michal Orzel
2020-04-28 17:10 ` [Intel-gfx] " Michal Orzel
2020-04-28 17:10 ` Michal Orzel
2020-04-28 18:33 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers (rev2) Patchwork
2020-04-28 21:39 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-04-29  8:57 ` [PATCH] drm: Replace drm_modeset_lock/unlock_all with DRM_MODESET_LOCK_ALL_* helpers Jani Nikula
2020-04-29  8:57   ` [Intel-gfx] " Jani Nikula
2020-04-29  8:57   ` Jani Nikula
2020-04-30  5:52   ` Michał Orzeł
2020-04-30  5:52     ` [Intel-gfx] " Michał Orzeł
2020-04-30  5:52     ` Michał Orzeł
2020-04-30 15:37   ` Sean Paul
2020-04-30 15:37     ` [Intel-gfx] " Sean Paul
2020-04-30 15:37     ` Sean Paul
2020-04-30 18:30     ` Daniel Vetter
2020-04-30 18:30       ` [Intel-gfx] " Daniel Vetter
2020-04-30 18:30       ` Daniel Vetter
2020-05-01 15:49       ` Michał Orzeł
2020-05-01 15:49         ` [Intel-gfx] " Michał Orzeł
2020-05-01 15:49         ` Michał Orzeł
2020-05-04 11:53         ` Daniel Vetter
2020-05-04 11:53           ` [Intel-gfx] " Daniel Vetter
2020-05-04 11:53           ` Daniel Vetter
2020-05-05  5:55           ` Michał Orzeł
2020-05-05  5:55             ` [Intel-gfx] " Michał Orzeł
2020-05-05  5:55             ` Michał Orzeł
2020-05-05  8:51             ` Daniel Vetter
2020-05-05  8:51               ` [Intel-gfx] " Daniel Vetter
2020-05-05  8:51               ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2020-04-26 10:01 Michal Orzel
2020-04-26 10:01 ` Michal Orzel
2020-04-28 15:15 ` Daniel Vetter
2020-04-28 15:15   ` Daniel Vetter
2020-04-28 17:16   ` Michał Orzeł

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.