Commit fc2157b6 authored by Liviu Dudau's avatar Liviu Dudau Committed by Daniel Vetter

drm: Improve kerneldoc for drm_modeset_lock

Explain better when the drm_modeset_acquire_ctx parameter can
be skipped for drm_modeset_lock() call.
Signed-off-by: default avatarLiviu Dudau <Liviu.Dudau@arm.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20170720160748.12856-1-Liviu.Dudau@arm.comSigned-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 14693a08
...@@ -52,7 +52,12 @@ ...@@ -52,7 +52,12 @@
* drm_modeset_drop_locks(&ctx); * drm_modeset_drop_locks(&ctx);
* drm_modeset_acquire_fini(&ctx); * drm_modeset_acquire_fini(&ctx);
* *
* On top of of these per-object locks using &ww_mutex there's also an overall * If all that is needed is a single modeset lock, then the &struct
* drm_modeset_acquire_ctx is not needed and the locking can be simplified
* by passing a NULL instead of ctx in the drm_modeset_lock()
* call and, when done, by calling drm_modeset_unlock().
*
* On top of these per-object locks using &ww_mutex there's also an overall
* &drm_mode_config.mutex, for protecting everything else. Mostly this means * &drm_mode_config.mutex, for protecting everything else. Mostly this means
* probe state of connectors, and preventing hotplug add/removal of connectors. * probe state of connectors, and preventing hotplug add/removal of connectors.
* *
...@@ -313,11 +318,14 @@ EXPORT_SYMBOL(drm_modeset_lock_init); ...@@ -313,11 +318,14 @@ EXPORT_SYMBOL(drm_modeset_lock_init);
* @lock: lock to take * @lock: lock to take
* @ctx: acquire ctx * @ctx: acquire ctx
* *
* If ctx is not NULL, then its ww acquire context is used and the * If @ctx is not NULL, then its ww acquire context is used and the
* lock will be tracked by the context and can be released by calling * lock will be tracked by the context and can be released by calling
* drm_modeset_drop_locks(). If -EDEADLK is returned, this means a * drm_modeset_drop_locks(). If -EDEADLK is returned, this means a
* deadlock scenario has been detected and it is an error to attempt * deadlock scenario has been detected and it is an error to attempt
* to take any more locks without first calling drm_modeset_backoff(). * to take any more locks without first calling drm_modeset_backoff().
*
* If @ctx is NULL then the function call behaves like a normal,
* non-nesting mutex_lock() call.
*/ */
int drm_modeset_lock(struct drm_modeset_lock *lock, int drm_modeset_lock(struct drm_modeset_lock *lock,
struct drm_modeset_acquire_ctx *ctx) struct drm_modeset_acquire_ctx *ctx)
......
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