Commit b3ba3f6f authored by Daniel Vetter's avatar Daniel Vetter

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: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161221130335.5321-1-daniel.vetter@ffwll.ch
parent 76fede2f
...@@ -35,19 +35,14 @@ ...@@ -35,19 +35,14 @@
#include "drm_crtc_internal.h" #include "drm_crtc_internal.h"
static void crtc_commit_free(struct kref *kref) void __drm_crtc_commit_free(struct kref *kref)
{ {
struct drm_crtc_commit *commit = struct drm_crtc_commit *commit =
container_of(kref, struct drm_crtc_commit, ref); container_of(kref, struct drm_crtc_commit, ref);
kfree(commit); kfree(commit);
} }
EXPORT_SYMBOL(__drm_crtc_commit_free);
void drm_crtc_commit_put(struct drm_crtc_commit *commit)
{
kref_put(&commit->ref, crtc_commit_free);
}
EXPORT_SYMBOL(drm_crtc_commit_put);
/** /**
* drm_atomic_state_default_release - * drm_atomic_state_default_release -
......
...@@ -189,12 +189,31 @@ struct drm_atomic_state { ...@@ -189,12 +189,31 @@ struct drm_atomic_state {
struct work_struct commit_work; 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) static inline void drm_crtc_commit_get(struct drm_crtc_commit *commit)
{ {
kref_get(&commit->ref); 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 struct drm_atomic_state * __must_check
drm_atomic_state_alloc(struct drm_device *dev); drm_atomic_state_alloc(struct drm_device *dev);
void drm_atomic_state_clear(struct drm_atomic_state *state); void drm_atomic_state_clear(struct drm_atomic_state *state);
......
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