From: Ville Syrjälä Date: Thu, 22 Mar 2018 15:22:57 +0000 (+0200) Subject: drm: Make the fb refcount handover less magic X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=23a5e1fb349d80d8c0eb97644dea16d2d7cfac26;p=openwrt%2Fstaging%2Fblogic.git drm: Make the fb refcount handover less magic Instead of assigning the plane->fb pointer and clearing the fb pointer to hand over the reference, let's just do it by grabbing another referece for plane->fb and let fb keep its original one. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-8-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter Reviewed-by: Maarten Lankhorst --- diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index bedceca7dd06..008f9456a5e8 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -1084,8 +1084,7 @@ retry: plane->old_fb = NULL; } else { plane->fb = fb; - /* Unref only the old framebuffer. */ - fb = NULL; + drm_framebuffer_get(fb); } out: