Commit 13803132 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Daniel Vetter
Browse files

drm/core: Preserve the framebuffer after removing it.



Previously RMFB and fd close chose to disable any plane that had
an active framebuffer from this file. If it was a primary plane the
crtc was disabled. However the fbdev code or any system compositor
should restore the planes anyway so there's no need to do it twice.

The old fb_id is zero'd, so there's no danger of being able to
restore the fb from fb_id.

Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 4dfd6486
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3327,7 +3327,7 @@ int drm_mode_rmfb(struct drm_device *dev,
	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);


	drm_framebuffer_remove(fb);
	drm_framebuffer_unreference(fb);


	return 0;
	return 0;


@@ -3517,7 +3517,7 @@ void drm_fb_release(struct drm_file *priv)
		list_del_init(&fb->filp_head);
		list_del_init(&fb->filp_head);


		/* This will also drop the fpriv->fbs reference. */
		/* This will also drop the fpriv->fbs reference. */
		drm_framebuffer_remove(fb);
		drm_framebuffer_unreference(fb);
	}
	}
}
}