diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-21 14:03:35 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-01-05 08:55:02 +0100 |
commit | b3ba3f6fab873a8d757fbcd9f83c3f69e369cddf (patch) | |
tree | 545a411e23e055c693b93e1ee47d1296d6c90a81 /include/drm/drm_atomic.h | |
parent | 76fede2fa79d0d02f6874f023a39b8bd5f52e297 (diff) | |
download | linux-stable-b3ba3f6fab873a8d757fbcd9f83c3f69e369cddf.tar.gz linux-stable-b3ba3f6fab873a8d757fbcd9f83c3f69e369cddf.tar.bz2 linux-stable-b3ba3f6fab873a8d757fbcd9f83c3f69e369cddf.zip |
drm: Add kernel-doc for drm_crtc_commit_get/put
I was lazy, rectify that! Also align with drm_atomic_state_get/put for
ocd.
v2: Git add helps.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161221130335.5321-1-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm/drm_atomic.h')
-rw-r--r-- | include/drm/drm_atomic.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index fd2d971bca32..f96220ed4004 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -189,12 +189,31 @@ struct drm_atomic_state { struct work_struct commit_work; }; -void drm_crtc_commit_put(struct drm_crtc_commit *commit); +void __drm_crtc_commit_free(struct kref *kref); + +/** + * drm_crtc_commit_get - acquire a reference to the CRTC commit + * @commit: CRTC commit + * + * Increases the reference of @commit. + */ static inline void drm_crtc_commit_get(struct drm_crtc_commit *commit) { kref_get(&commit->ref); } +/** + * drm_crtc_commit_put - release a reference to the CRTC commmit + * @commit: CRTC commit + * + * This releases a reference to @commit which is freed after removing the + * final reference. No locking required and callable from any context. + */ +static inline void drm_crtc_commit_put(struct drm_crtc_commit *commit) +{ + kref_put(&commit->ref, __drm_crtc_commit_free); +} + struct drm_atomic_state * __must_check drm_atomic_state_alloc(struct drm_device *dev); void drm_atomic_state_clear(struct drm_atomic_state *state); |