Commit bf9e37ba authored by Daniel Vetter's avatar Daniel Vetter

drm: Remove __drm_modeset_lock_all

The last user is gone, no need for trylocking any more in this legacy
helper.
Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parent dd908c86
...@@ -55,41 +55,27 @@ ...@@ -55,41 +55,27 @@
* drm_modeset_acquire_fini(&ctx); * drm_modeset_acquire_fini(&ctx);
*/ */
/** /**
* __drm_modeset_lock_all - internal helper to grab all modeset locks * drm_modeset_lock_all - take all modeset locks
* @dev: DRM device * @dev: drm device
* @trylock: trylock mode for atomic contexts
*
* This is a special version of drm_modeset_lock_all() which can also be used in
* atomic contexts. Then @trylock must be set to true.
* *
* Returns: * This function takes all modeset locks, suitable where a more fine-grained
* 0 on success or negative error code on failure. * scheme isn't (yet) implemented. Locks must be dropped with
* drm_modeset_unlock_all.
*/ */
int __drm_modeset_lock_all(struct drm_device *dev, void drm_modeset_lock_all(struct drm_device *dev)
bool trylock)
{ {
struct drm_mode_config *config = &dev->mode_config; struct drm_mode_config *config = &dev->mode_config;
struct drm_modeset_acquire_ctx *ctx; struct drm_modeset_acquire_ctx *ctx;
int ret; int ret;
ctx = kzalloc(sizeof(*ctx), ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
trylock ? GFP_ATOMIC : GFP_KERNEL); if (WARN_ON(!ctx))
if (!ctx) return;
return -ENOMEM;
if (trylock) {
if (!mutex_trylock(&config->mutex)) {
ret = -EBUSY;
goto out;
}
} else {
mutex_lock(&config->mutex); mutex_lock(&config->mutex);
}
drm_modeset_acquire_init(ctx, 0); drm_modeset_acquire_init(ctx, 0);
ctx->trylock_only = trylock;
retry: retry:
ret = drm_modeset_lock(&config->connection_mutex, ctx); ret = drm_modeset_lock(&config->connection_mutex, ctx);
...@@ -108,7 +94,7 @@ int __drm_modeset_lock_all(struct drm_device *dev, ...@@ -108,7 +94,7 @@ int __drm_modeset_lock_all(struct drm_device *dev,
drm_warn_on_modeset_not_all_locked(dev); drm_warn_on_modeset_not_all_locked(dev);
return 0; return;
fail: fail:
if (ret == -EDEADLK) { if (ret == -EDEADLK) {
...@@ -116,23 +102,7 @@ int __drm_modeset_lock_all(struct drm_device *dev, ...@@ -116,23 +102,7 @@ int __drm_modeset_lock_all(struct drm_device *dev,
goto retry; goto retry;
} }
out:
kfree(ctx); kfree(ctx);
return ret;
}
EXPORT_SYMBOL(__drm_modeset_lock_all);
/**
* drm_modeset_lock_all - take all modeset locks
* @dev: drm device
*
* This function takes all modeset locks, suitable where a more fine-grained
* scheme isn't (yet) implemented. Locks must be dropped with
* drm_modeset_unlock_all.
*/
void drm_modeset_lock_all(struct drm_device *dev)
{
WARN_ON(__drm_modeset_lock_all(dev, false) != 0);
} }
EXPORT_SYMBOL(drm_modeset_lock_all); EXPORT_SYMBOL(drm_modeset_lock_all);
......
...@@ -130,7 +130,6 @@ struct drm_crtc; ...@@ -130,7 +130,6 @@ struct drm_crtc;
struct drm_plane; struct drm_plane;
void drm_modeset_lock_all(struct drm_device *dev); void drm_modeset_lock_all(struct drm_device *dev);
int __drm_modeset_lock_all(struct drm_device *dev, bool trylock);
void drm_modeset_unlock_all(struct drm_device *dev); void drm_modeset_unlock_all(struct drm_device *dev);
void drm_modeset_lock_crtc(struct drm_crtc *crtc, void drm_modeset_lock_crtc(struct drm_crtc *crtc,
struct drm_plane *plane); struct drm_plane *plane);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment