diff options
author | Thierry Reding <treding@nvidia.com> | 2017-02-28 17:46:40 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2017-02-28 18:15:03 +0300 |
commit | a4a69da06bc11a937a6e417938b1bb698ee1fa46 (patch) | |
tree | f27062e64385f44ddddabc08b8d3f98cc2700446 /drivers/gpu/drm/drm_plane.c | |
parent | ad09360750afa18a0a0ce0253d6ea6033abc22e7 (diff) | |
download | linux-a4a69da06bc11a937a6e417938b1bb698ee1fa46.tar.xz |
drm: Introduce drm_framebuffer_{get,put}()
For consistency with other reference counting APIs in the kernel, add
drm_framebuffer_get() and drm_framebuffer_put() to reference count DRM
framebuffers.
Compatibility aliases are added to keep existing code working. To help
speed up the transition, all the instances of the old functions in the
DRM core are already replaced in this commit.
The existing semantic patch for the DRM subsystem-wide conversion is
extended to account for these new helpers.
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-5-thierry.reding@gmail.com
Diffstat (limited to 'drivers/gpu/drm/drm_plane.c')
-rw-r--r-- | drivers/gpu/drm/drm_plane.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index f42590049a3a..a22e76837065 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -293,7 +293,7 @@ void drm_plane_force_disable(struct drm_plane *plane) return; } /* disconnect the plane from the fb and crtc: */ - drm_framebuffer_unreference(plane->old_fb); + drm_framebuffer_put(plane->old_fb); plane->old_fb = NULL; plane->fb = NULL; plane->crtc = NULL; @@ -520,9 +520,9 @@ static int __setplane_internal(struct drm_plane *plane, out: if (fb) - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); if (plane->old_fb) - drm_framebuffer_unreference(plane->old_fb); + drm_framebuffer_put(plane->old_fb); plane->old_fb = NULL; return ret; @@ -638,7 +638,7 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc, } else { fb = crtc->cursor->fb; if (fb) - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); } if (req->flags & DRM_MODE_CURSOR_MOVE) { @@ -902,9 +902,9 @@ out: if (ret && crtc->funcs->page_flip_target) drm_crtc_vblank_put(crtc); if (fb) - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); if (crtc->primary->old_fb) - drm_framebuffer_unreference(crtc->primary->old_fb); + drm_framebuffer_put(crtc->primary->old_fb); crtc->primary->old_fb = NULL; drm_modeset_unlock_crtc(crtc); |