qxl: fix framebuffer unpinning
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 18 Sep 2017 07:41:45 +0000 (09:41 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 25 Sep 2017 06:35:53 +0000 (08:35 +0200)
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
drivers/gpu/drm/qxl/qxl_display.c

index e1dd05423e8629cdf7a1547f16b50e3024d39b82..afbf50d0c08fa1c89c49120717b7a51cb05d5b98 100644 (file)
@@ -702,14 +702,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);
 }