[2/2] drm/core: Preserve the fb id on close.
diff mbox

Message ID 1441809657-11411-3-git-send-email-maarten.lankhorst@linux.intel.com
State New
Headers show

Commit Message

Maarten Lankhorst Sept. 9, 2015, 2:40 p.m. UTC
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>
---
 drivers/gpu/drm/drm_crtc.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

David Herrmann Sept. 22, 2015, 2:55 p.m. UTC | #1
Hi

On Wed, Sep 9, 2015 at 4:40 PM, Maarten Lankhorst
<maarten.lankhorst@linux.intel.com> wrote:
> 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>
> ---
>  drivers/gpu/drm/drm_crtc.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)

Same as 1/2:

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 626b0a57efbf..9d55c0c6aa95 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -3320,9 +3320,6 @@ int drm_mode_rmfb(struct drm_device *dev,
>         if (!found)
>                 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);
>         mutex_unlock(&dev->mode_config.fb_lock);
>         mutex_unlock(&file_priv->fbs_lock);
> @@ -3508,15 +3505,9 @@ void drm_fb_release(struct drm_file *priv)
>          * at it any more.
>          */
>         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);
>
> -               /* This will also drop the fpriv->fbs reference. */
> +               /* This drops the fpriv->fbs reference. */
>                 drm_framebuffer_unreference(fb);
>         }
>  }
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

Patch
diff mbox

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 626b0a57efbf..9d55c0c6aa95 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3320,9 +3320,6 @@  int drm_mode_rmfb(struct drm_device *dev,
 	if (!found)
 		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);
 	mutex_unlock(&dev->mode_config.fb_lock);
 	mutex_unlock(&file_priv->fbs_lock);
@@ -3508,15 +3505,9 @@  void drm_fb_release(struct drm_file *priv)
 	 * at it any more.
 	 */
 	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);
 
-		/* This will also drop the fpriv->fbs reference. */
+		/* This drops the fpriv->fbs reference. */
 		drm_framebuffer_unreference(fb);
 	}
 }