···5555 * drm_modeset_acquire_fini(&ctx);5656 */57575858-5958/**6060- * __drm_modeset_lock_all - internal helper to grab all modeset locks6161- * @dev: DRM device6262- * @trylock: trylock mode for atomic contexts5959+ * drm_modeset_lock_all - take all modeset locks6060+ * @dev: drm device6361 *6464- * This is a special version of drm_modeset_lock_all() which can also be used in6565- * atomic contexts. Then @trylock must be set to true.6666- *6767- * Returns:6868- * 0 on success or negative error code on failure.6262+ * This function takes all modeset locks, suitable where a more fine-grained6363+ * scheme isn't (yet) implemented. Locks must be dropped with6464+ * drm_modeset_unlock_all.6965 */7070-int __drm_modeset_lock_all(struct drm_device *dev,7171- bool trylock)6666+void drm_modeset_lock_all(struct drm_device *dev)7267{7368 struct drm_mode_config *config = &dev->mode_config;7469 struct drm_modeset_acquire_ctx *ctx;7570 int ret;76717777- ctx = kzalloc(sizeof(*ctx),7878- trylock ? GFP_ATOMIC : GFP_KERNEL);7979- if (!ctx)8080- return -ENOMEM;7272+ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);7373+ if (WARN_ON(!ctx))7474+ return;81758282- if (trylock) {8383- if (!mutex_trylock(&config->mutex)) {8484- ret = -EBUSY;8585- goto out;8686- }8787- } else {8888- mutex_lock(&config->mutex);8989- }7676+ mutex_lock(&config->mutex);90779178 drm_modeset_acquire_init(ctx, 0);9292- ctx->trylock_only = trylock;93799480retry:9581 ret = drm_modeset_lock(&config->connection_mutex, ctx);···9410895109 drm_warn_on_modeset_not_all_locked(dev);961109797- return 0;111111+ return;9811299113fail:100114 if (ret == -EDEADLK) {···102116 goto retry;103117 }104118105105-out:106119 kfree(ctx);107107- return ret;108108-}109109-EXPORT_SYMBOL(__drm_modeset_lock_all);110110-111111-/**112112- * drm_modeset_lock_all - take all modeset locks113113- * @dev: drm device114114- *115115- * This function takes all modeset locks, suitable where a more fine-grained116116- * scheme isn't (yet) implemented. Locks must be dropped with117117- * drm_modeset_unlock_all.118118- */119119-void drm_modeset_lock_all(struct drm_device *dev)120120-{121121- WARN_ON(__drm_modeset_lock_all(dev, false) != 0);122120}123121EXPORT_SYMBOL(drm_modeset_lock_all);124122