summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_client_modeset.c
diff options
context:
space:
mode:
authorFernando Ramos <greenfoo@u92.eu>2021-09-24 09:43:08 +0300
committerSean Paul <seanpaul@chromium.org>2021-10-01 19:59:40 +0300
commit21dde40902d2636f70766b3154931de57e1215e9 (patch)
tree8cc6a9dea60e73e9aeeb40afbfbe6c6f3f86179d /drivers/gpu/drm/drm_client_modeset.c
parent4bb2d367a5a2807185a04949ae922d247f650576 (diff)
downloadlinux-21dde40902d2636f70766b3154931de57e1215e9.tar.xz
drm: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN()
As requested in Documentation/gpu/todo.rst, replace the boilerplate code surrounding drm_modeset_lock_all_ctx() with DRM_MODESET_LOCK_ALL_BEGIN() and DRM_MODESET_LOCK_ALL_END() Signed-off-by: Fernando Ramos <greenfoo@u92.eu> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20210924064324.229457-2-greenfoo@u92.eu
Diffstat (limited to 'drivers/gpu/drm/drm_client_modeset.c')
-rw-r--r--drivers/gpu/drm/drm_client_modeset.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
index ced09c7c06f9..5f5184f071ed 100644
--- a/drivers/gpu/drm/drm_client_modeset.c
+++ b/drivers/gpu/drm/drm_client_modeset.c
@@ -574,6 +574,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,
int num_connectors_detected = 0;
int num_tiled_conns = 0;
struct drm_modeset_acquire_ctx ctx;
+ int err;
if (!drm_drv_uses_atomic_modeset(dev))
return false;
@@ -585,10 +586,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,
if (!save_enabled)
return false;
- drm_modeset_acquire_init(&ctx, 0);
-
- while (drm_modeset_lock_all_ctx(dev, &ctx) != 0)
- drm_modeset_backoff(&ctx);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, err);
memcpy(save_enabled, enabled, count);
mask = GENMASK(count - 1, 0);
@@ -743,8 +741,7 @@ bail:
ret = false;
}
- drm_modeset_drop_locks(&ctx);
- drm_modeset_acquire_fini(&ctx);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, err);
kfree(save_enabled);
return ret;