Selaa lähdekoodia

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ä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-8-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Ville Syrjälä 7 vuotta sitten
vanhempi
commit
23a5e1fb34
1 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  1. 1 2
      drivers/gpu/drm/drm_plane.c

+ 1 - 2
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: