aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_modeset_lock.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-04-03 10:32:51 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-04-05 09:26:07 +0200
commitb95ff0319a829d5e707d64a3994c75f012f6b6ec (patch)
tree84cbb607f6e7806595ed5d413bf7aa475ed5b566 /drivers/gpu/drm/drm_modeset_lock.c
parentdrm: Make drm_modeset_lock_crtc internal (diff)
downloadlinux-dev-b95ff0319a829d5e707d64a3994c75f012f6b6ec.tar.xz
linux-dev-b95ff0319a829d5e707d64a3994c75f012f6b6ec.zip
drm: Remove drm_modeset_(un)lock_crtc
The last user, the cursor ioctl, can just open-code this too. We simply have to move the acquire ctx dance from the universal function up into the top-level ioctl handler. Reviewed-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170403083304.9083-3-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_modeset_lock.c')
-rw-r--r--drivers/gpu/drm/drm_modeset_lock.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
index c94eff9d7544..c3ca6b859236 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -148,51 +148,6 @@ void drm_modeset_unlock_all(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_modeset_unlock_all);
-void drm_modeset_lock_crtc(struct drm_crtc *crtc,
- struct drm_plane *plane)
-{
- struct drm_modeset_acquire_ctx *ctx;
- int ret;
-
- ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
- if (WARN_ON(!ctx))
- return;
-
- drm_modeset_acquire_init(ctx, 0);
-
-retry:
- ret = drm_modeset_lock(&crtc->mutex, ctx);
- if (ret)
- goto fail;
-
- if (plane) {
- ret = drm_modeset_lock(&plane->mutex, ctx);
- if (ret)
- goto fail;
-
- if (plane->crtc) {
- ret = drm_modeset_lock(&plane->crtc->mutex, ctx);
- if (ret)
- goto fail;
- }
- }
-
- WARN_ON(crtc->acquire_ctx);
-
- /* now we hold the locks, so now that it is safe, stash the
- * ctx for drm_modeset_unlock_crtc():
- */
- crtc->acquire_ctx = ctx;
-
- return;
-
-fail:
- if (ret == -EDEADLK) {
- drm_modeset_backoff(ctx);
- goto retry;
- }
-}
-
/**
* drm_modeset_legacy_acquire_ctx - find acquire ctx for legacy ioctls
* @crtc: drm crtc
@@ -215,28 +170,6 @@ drm_modeset_legacy_acquire_ctx(struct drm_crtc *crtc)
EXPORT_SYMBOL(drm_modeset_legacy_acquire_ctx);
/**
- * drm_modeset_unlock_crtc - drop crtc lock
- * @crtc: drm crtc
- *
- * This drops the crtc lock acquire with drm_modeset_lock_crtc() and all other
- * locks acquired through the hidden context.
- */
-void drm_modeset_unlock_crtc(struct drm_crtc *crtc)
-{
- struct drm_modeset_acquire_ctx *ctx = crtc->acquire_ctx;
-
- if (WARN_ON(!ctx))
- return;
-
- crtc->acquire_ctx = NULL;
- drm_modeset_drop_locks(ctx);
- drm_modeset_acquire_fini(ctx);
-
- kfree(ctx);
-}
-EXPORT_SYMBOL(drm_modeset_unlock_crtc);
-
-/**
* drm_warn_on_modeset_not_all_locked - check that all modeset locks are locked
* @dev: device
*