Blame SOURCES/kvm-virtio-gpu-update-old-resource-too.patch

357786
From 10ece778cf0de01b5fb9c853fc27ea3bb7d40a5e Mon Sep 17 00:00:00 2001
357786
From: Gerd Hoffmann <kraxel@redhat.com>
357786
Date: Wed, 4 Jul 2018 09:54:08 +0200
357786
Subject: [PATCH 14/89] virtio-gpu: update old resource too.
357786
MIME-Version: 1.0
357786
Content-Type: text/plain; charset=UTF-8
357786
Content-Transfer-Encoding: 8bit
357786
357786
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
357786
Message-id: <20180704095409.14514-3-kraxel@redhat.com>
357786
Patchwork-id: 81227
357786
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 2/3] virtio-gpu: update old resource too.
357786
Bugzilla: 1589634
357786
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
357786
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
357786
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
357786
357786
When switching scanout from one resource to another we must update the
357786
scanout_bitmask field for both new (set bit) and old (clear bit)
357786
resource.
357786
357786
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
357786
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
357786
Message-id: 20180702162443.16796-3-kraxel@redhat.com
357786
(cherry picked from commit c806cfa036a7ec991170eb9899f3a676bfcc3253)
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 hw/display/virtio-gpu.c | 7 ++++++-
357786
 1 file changed, 6 insertions(+), 1 deletion(-)
357786
357786
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
357786
index 054ec73..336dc59 100644
357786
--- a/hw/display/virtio-gpu.c
357786
+++ b/hw/display/virtio-gpu.c
357786
@@ -590,7 +590,7 @@ static void virtio_unref_resource(pixman_image_t *image, void *data)
357786
 static void virtio_gpu_set_scanout(VirtIOGPU *g,
357786
                                    struct virtio_gpu_ctrl_command *cmd)
357786
 {
357786
-    struct virtio_gpu_simple_resource *res;
357786
+    struct virtio_gpu_simple_resource *res, *ores;
357786
     struct virtio_gpu_scanout *scanout;
357786
     pixman_format_code_t format;
357786
     uint32_t offset;
357786
@@ -664,6 +664,11 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g,
357786
         dpy_gfx_replace_surface(g->scanout[ss.scanout_id].con, scanout->ds);
357786
     }
357786
 
357786
+    ores = virtio_gpu_find_resource(g, scanout->resource_id);
357786
+    if (ores) {
357786
+        ores->scanout_bitmask &= ~(1 << ss.scanout_id);
357786
+    }
357786
+
357786
     res->scanout_bitmask |= (1 << ss.scanout_id);
357786
     scanout->resource_id = ss.resource_id;
357786
     scanout->x = ss.r.x;
357786
-- 
357786
1.8.3.1
357786