[PATCH 07/23] drm: Make the fb refcount handover less magic

Ville Syrjala ville.syrjala at linux.intel.com
Thu Mar 22 15:22:57 UTC 2018


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

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ä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/drm_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
 		plane->old_fb = NULL;
 	} else {
 		plane->fb = fb;
-		/* Unref only the old framebuffer. */
-		fb = NULL;
+		drm_framebuffer_get(fb);
 	}
 
 out:
-- 
2.16.1



More information about the dri-devel mailing list