diff mbox series

[artful] qxl: fix framebuffer unpinning

Message ID 20171011171201.22911-1-seth.forshee@canonical.com
State New
Headers show
Series [artful] qxl: fix framebuffer unpinning | expand

Commit Message

Seth Forshee Oct. 11, 2017, 5:12 p.m. UTC
From: Gerd Hoffmann <kraxel@redhat.com>

BugLink: http://bugs.launchpad.net/bugs/1711358

qxl_plane_cleanup_fb() unpins the just activated framebuffer
instead of the old one.  Oops.  Fix it.

Cc: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Fixes: 1277eed5fecb8830c8cc414ad70c1ef640464bc0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170918074145.2257-1-kraxel@redhat.com
(cherry picked from commit 5f3d862a736398e7068fa67142133f1713fdee8c)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 drivers/gpu/drm/qxl/qxl_display.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Thadeu Lima de Souza Cascardo Oct. 11, 2017, 5:17 p.m. UTC | #1
On Wed, Oct 11, 2017 at 12:12:01PM -0500, Seth Forshee wrote:
> From: Gerd Hoffmann <kraxel@redhat.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1711358
> 
> qxl_plane_cleanup_fb() unpins the just activated framebuffer
> instead of the old one.  Oops.  Fix it.
> 
> Cc: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> Fixes: 1277eed5fecb8830c8cc414ad70c1ef640464bc0
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> Link: http://patchwork.freedesktop.org/patch/msgid/20170918074145.2257-1-kraxel@redhat.com
> (cherry picked from commit 5f3d862a736398e7068fa67142133f1713fdee8c)
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>

Clean cherry pick.

Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

> ---
>  drivers/gpu/drm/qxl/qxl_display.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index 03fe182203ce..274df74a128c 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -701,14 +701,15 @@ static void qxl_plane_cleanup_fb(struct drm_plane *plane,
>  	struct drm_gem_object *obj;
>  	struct qxl_bo *user_bo;
>  
> -	if (!plane->state->fb) {
> -		/* we never executed prepare_fb, so there's nothing to
> +	if (!old_state->fb) {
> +		/*
> +		 * we never executed prepare_fb, so there's nothing to
>  		 * unpin.
>  		 */
>  		return;
>  	}
>  
> -	obj = to_qxl_framebuffer(plane->state->fb)->obj;
> +	obj = to_qxl_framebuffer(old_state->fb)->obj;
>  	user_bo = gem_to_qxl_bo(obj);
>  	qxl_bo_unpin(user_bo);
>  }
> -- 
> 2.14.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Andy Whitcroft Oct. 11, 2017, 5:18 p.m. UTC | #2
On Wed, Oct 11, 2017 at 12:12:01PM -0500, Seth Forshee wrote:
> From: Gerd Hoffmann <kraxel@redhat.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1711358
> 
> qxl_plane_cleanup_fb() unpins the just activated framebuffer
> instead of the old one.  Oops.  Fix it.
> 
> Cc: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> Fixes: 1277eed5fecb8830c8cc414ad70c1ef640464bc0
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> Link: http://patchwork.freedesktop.org/patch/msgid/20170918074145.2257-1-kraxel@redhat.com
> (cherry picked from commit 5f3d862a736398e7068fa67142133f1713fdee8c)
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> ---
>  drivers/gpu/drm/qxl/qxl_display.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index 03fe182203ce..274df74a128c 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -701,14 +701,15 @@ static void qxl_plane_cleanup_fb(struct drm_plane *plane,
>  	struct drm_gem_object *obj;
>  	struct qxl_bo *user_bo;
>  
> -	if (!plane->state->fb) {
> -		/* we never executed prepare_fb, so there's nothing to
> +	if (!old_state->fb) {
> +		/*
> +		 * we never executed prepare_fb, so there's nothing to
>  		 * unpin.
>  		 */
>  		return;
>  	}
>  
> -	obj = to_qxl_framebuffer(plane->state->fb)->obj;
> +	obj = to_qxl_framebuffer(old_state->fb)->obj;
>  	user_bo = gem_to_qxl_bo(obj);
>  	qxl_bo_unpin(user_bo);
>  }

Looks to do what is claimed.  Specific to the driver and tested.

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw
Seth Forshee Oct. 11, 2017, 5:31 p.m. UTC | #3
On Wed, Oct 11, 2017 at 12:12:01PM -0500, Seth Forshee wrote:
> From: Gerd Hoffmann <kraxel@redhat.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1711358
> 
> qxl_plane_cleanup_fb() unpins the just activated framebuffer
> instead of the old one.  Oops.  Fix it.
> 
> Cc: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> Fixes: 1277eed5fecb8830c8cc414ad70c1ef640464bc0
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> Link: http://patchwork.freedesktop.org/patch/msgid/20170918074145.2257-1-kraxel@redhat.com
> (cherry picked from commit 5f3d862a736398e7068fa67142133f1713fdee8c)
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>

Applied to artful/master-next.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 03fe182203ce..274df74a128c 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -701,14 +701,15 @@  static void qxl_plane_cleanup_fb(struct drm_plane *plane,
 	struct drm_gem_object *obj;
 	struct qxl_bo *user_bo;
 
-	if (!plane->state->fb) {
-		/* we never executed prepare_fb, so there's nothing to
+	if (!old_state->fb) {
+		/*
+		 * we never executed prepare_fb, so there's nothing to
 		 * unpin.
 		 */
 		return;
 	}
 
-	obj = to_qxl_framebuffer(plane->state->fb)->obj;
+	obj = to_qxl_framebuffer(old_state->fb)->obj;
 	user_bo = gem_to_qxl_bo(obj);
 	qxl_bo_unpin(user_bo);
 }