summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic.c
diff options
context:
space:
mode:
authorChris Wilson2016-11-25 16:32:30 +0100
committerDaniel Vetter2016-11-29 10:22:08 +0100
commit389f78b361fcdc52a9dbb5382c3922d80b52ed9f (patch)
treeb0d3804f2c02c83be798b028be5aec0a48d8ed59 /drivers/gpu/drm/drm_atomic.c
parentdrm/bridge: adv7511: Enable the audio data and clock pads on adv7533 (diff)
downloadkernel-qcow2-linux-389f78b361fcdc52a9dbb5382c3922d80b52ed9f.tar.gz
kernel-qcow2-linux-389f78b361fcdc52a9dbb5382c3922d80b52ed9f.tar.xz
kernel-qcow2-linux-389f78b361fcdc52a9dbb5382c3922d80b52ed9f.zip
drm: Introduce drm_framebuffer_assign()
In a couple of places currently, and with the intent to add more, we update a pointer to a framebuffer to hold a new fb reference (evicting the old). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161125153231.13255-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/drm_atomic.c')
-rw-r--r--drivers/gpu/drm/drm_atomic.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 89737e42fa83..19d7bcb88217 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1246,18 +1246,14 @@ void
drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state,
struct drm_framebuffer *fb)
{
- if (plane_state->fb)
- drm_framebuffer_unreference(plane_state->fb);
- if (fb)
- drm_framebuffer_reference(fb);
- plane_state->fb = fb;
-
if (fb)
DRM_DEBUG_ATOMIC("Set [FB:%d] for plane state %p\n",
fb->base.id, plane_state);
else
DRM_DEBUG_ATOMIC("Set [NOFB] for plane state %p\n",
plane_state);
+
+ drm_framebuffer_assign(&plane_state->fb, fb);
}
EXPORT_SYMBOL(drm_atomic_set_fb_for_plane);