diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2017-09-04 12:48:36 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2017-09-08 10:39:37 +0200 |
commit | f46640b931e588aeec5285b4a9547b354ad10cd0 (patch) | |
tree | d45b3dc5e174ced0eb433f49f6091b6811a9c0f8 | |
parent | b44d5c0c105aa84b46caff9fdd606dc9a7b86419 (diff) |
drm/atomic: Return commit in drm_crtc_commit_get for better annotation
This will allow code to do x->commit = drm_crtc_commit_get(commit),
making it clearer where references are used.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170904104838.23822-5-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 3 | ||||
-rw-r--r-- | include/drm/drm_atomic.h | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 1bc32cd74d78..94ad11f76e0e 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1633,8 +1633,7 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock) return -EBUSY; } } else if (i == 1) { - stall_commit = commit; - drm_crtc_commit_get(stall_commit); + stall_commit = drm_crtc_commit_get(commit); break; } diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index f73b663c1f76..c0451e2a51af 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -252,10 +252,14 @@ void __drm_crtc_commit_free(struct kref *kref); * @commit: CRTC commit * * Increases the reference of @commit. + * + * Returns: + * The pointer to @commit, with reference increased. */ -static inline void drm_crtc_commit_get(struct drm_crtc_commit *commit) +static inline struct drm_crtc_commit *drm_crtc_commit_get(struct drm_crtc_commit *commit) { kref_get(&commit->ref); + return commit; } /** |