cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-virtio-gpu-disable-scanout-when-backing-resource-is-.patch

26ba25
From 590e0651a901f793df8aeee41968b0b2f838e2e8 Mon Sep 17 00:00:00 2001
26ba25
From: Gerd Hoffmann <kraxel@redhat.com>
26ba25
Date: Wed, 4 Jul 2018 09:54:09 +0200
26ba25
Subject: [PATCH 189/268] virtio-gpu: disable scanout when backing resource is
26ba25
 destroyed
26ba25
MIME-Version: 1.0
26ba25
Content-Type: text/plain; charset=UTF-8
26ba25
Content-Transfer-Encoding: 8bit
26ba25
26ba25
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
26ba25
Message-id: <20180704095409.14514-4-kraxel@redhat.com>
26ba25
Patchwork-id: 81225
26ba25
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 3/3] virtio-gpu: disable scanout when backing resource is destroyed
26ba25
Bugzilla: 1589634
26ba25
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
26ba25
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
26ba25
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
26ba25
26ba25
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
26ba25
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
26ba25
Message-id: 20180702162443.16796-4-kraxel@redhat.com
26ba25
(cherry picked from commit 1fccd7c5a9a722a9cbf1bc91693f4618034f01ac)
26ba25
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
---
26ba25
 hw/display/virtio-gpu.c | 10 ++++++++++
26ba25
 1 file changed, 10 insertions(+)
26ba25
26ba25
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
26ba25
index 336dc59..08cd567 100644
26ba25
--- a/hw/display/virtio-gpu.c
26ba25
+++ b/hw/display/virtio-gpu.c
26ba25
@@ -430,6 +430,16 @@ static void virtio_gpu_disable_scanout(VirtIOGPU *g, int scanout_id)
26ba25
 static void virtio_gpu_resource_destroy(VirtIOGPU *g,
26ba25
                                         struct virtio_gpu_simple_resource *res)
26ba25
 {
26ba25
+    int i;
26ba25
+
26ba25
+    if (res->scanout_bitmask) {
26ba25
+        for (i = 0; i < g->conf.max_outputs; i++) {
26ba25
+            if (res->scanout_bitmask & (1 << i)) {
26ba25
+                virtio_gpu_disable_scanout(g, i);
26ba25
+            }
26ba25
+        }
26ba25
+    }
26ba25
+
26ba25
     pixman_image_unref(res->image);
26ba25
     virtio_gpu_cleanup_mapping(res);
26ba25
     QTAILQ_REMOVE(&g->reslist, res, next);
26ba25
-- 
26ba25
1.8.3.1
26ba25