Skip to content

Commit

Permalink
drm/atomic: Return commit in drm_crtc_commit_get for better annotation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maarten Lankhorst committed Sep 8, 2017
1 parent b44d5c0 commit f46640b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/drm_atomic_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 5 additions & 1 deletion include/drm/drm_atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit f46640b

Please sign in to comment.