Prechádzať zdrojové kódy

drm/core: Preserve the fb id on close.

Keep the fb_id, which means that any application exiting without
unsetting the framebuffer from all planes will preserve its contents.

This is similar to preserving the initial framebuffer, except all
planes are preserved.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
[danvet: Remove unused variable, reported by Stephen Rothwell.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Maarten Lankhorst 10 rokov pred
rodič
commit
73f7570bc6
1 zmenil súbory, kde vykonal 1 pridanie a 11 odobranie
  1. 1 11
      drivers/gpu/drm/drm_crtc.c

+ 1 - 11
drivers/gpu/drm/drm_crtc.c

@@ -3320,9 +3320,6 @@ int drm_mode_rmfb(struct drm_device *dev,
 	if (!found)
 	if (!found)
 		goto fail_lookup;
 		goto fail_lookup;
 
 
-	/* Mark fb as reaped, we still have a ref from fpriv->fbs. */
-	__drm_framebuffer_unregister(dev, fb);
-
 	list_del_init(&fb->filp_head);
 	list_del_init(&fb->filp_head);
 	mutex_unlock(&dev->mode_config.fb_lock);
 	mutex_unlock(&dev->mode_config.fb_lock);
 	mutex_unlock(&file_priv->fbs_lock);
 	mutex_unlock(&file_priv->fbs_lock);
@@ -3494,7 +3491,6 @@ out_err1:
  */
  */
 void drm_fb_release(struct drm_file *priv)
 void drm_fb_release(struct drm_file *priv)
 {
 {
-	struct drm_device *dev = priv->minor->dev;
 	struct drm_framebuffer *fb, *tfb;
 	struct drm_framebuffer *fb, *tfb;
 
 
 	/*
 	/*
@@ -3508,15 +3504,9 @@ void drm_fb_release(struct drm_file *priv)
 	 * at it any more.
 	 * at it any more.
 	 */
 	 */
 	list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) {
 	list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) {
-
-		mutex_lock(&dev->mode_config.fb_lock);
-		/* Mark fb as reaped, we still have a ref from fpriv->fbs. */
-		__drm_framebuffer_unregister(dev, fb);
-		mutex_unlock(&dev->mode_config.fb_lock);
-
 		list_del_init(&fb->filp_head);
 		list_del_init(&fb->filp_head);
 
 
-		/* This will also drop the fpriv->fbs reference. */
+		/* This drops the fpriv->fbs reference. */
 		drm_framebuffer_unreference(fb);
 		drm_framebuffer_unreference(fb);
 	}
 	}
 }
 }