diff options
author | Dave Airlie <airlied@redhat.com> | 2016-04-15 15:10:35 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-04-22 10:33:53 +1000 |
commit | 747a598ffa7dff499ee93d414b74a08af6ec657e (patch) | |
tree | b6606905e2e8ef261db4ef8e9ce8a26c11db2599 /include/drm | |
parent | 19ab3f8bb4edbc576d4a2cc94a80d0e28296b649 (diff) | |
download | op-kernel-dev-747a598ffa7dff499ee93d414b74a08af6ec657e.zip op-kernel-dev-747a598ffa7dff499ee93d414b74a08af6ec657e.tar.gz |
drm/mode: introduce wrapper to read framebuffer refcount.
Avoids drivers knowing where the kref is stored.
[airlied: add kerneldoc]
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_crtc.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 6f43f94..1c99ee0 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -2605,6 +2605,17 @@ static inline uint32_t drm_color_lut_extract(uint32_t user_input, return clamp_val(val, 0, max); } +/** + * drm_framebuffer_read_refcount - read the framebuffer reference count. + * @fb: framebuffer + * + * This functions returns the framebuffer's reference count. + */ +static inline uint32_t drm_framebuffer_read_refcount(struct drm_framebuffer *fb) +{ + return atomic_read(&fb->refcount.refcount); +} + /* Plane list iterator for legacy (overlay only) planes. */ #define drm_for_each_legacy_plane(plane, dev) \ list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) \ |