qemu-kvm/kvm-vnc-detect-and-optimize-pageflips.patch
Danilo C. L. de Paula 797ce578a4 * Thu Apr 11 2019 Danilo Cesar Lemes de Paula <ddepaula@redhat.com> - 3.1.0-21.el8
- kvm-Remove-7-qcow2-and-luks-iotests-that-are-taking-25-s.patch [bz#1683473]
- kvm-spapr-fix-out-of-bounds-write-in-spapr_populate_drme.patch [bz#1674438]
- kvm-qcow2-include-LUKS-payload-overhead-in-qemu-img-meas.patch [bz#1655065]
- kvm-iotests-add-LUKS-payload-overhead-to-178-qemu-img-me.patch [bz#1655065]
- kvm-vnc-detect-and-optimize-pageflips.patch [bz#1666206]
- kvm-Load-kvm-module-during-boot.patch [bz#1676907 bz#1685995]
- kvm-hostmem-file-reject-invalid-pmem-file-sizes.patch [bz#1669053]
- kvm-iotests-Fix-test-200-on-s390x-without-virtio-pci.patch [bz#1687582]
- kvm-block-file-posix-do-not-fail-on-unlock-bytes.patch [bz#1652572]
- Resolves: bz#1652572
  (QEMU core dumped if stop nfs service during migration)
- Resolves: bz#1655065
  ([rhel.8.0][fast train]'qemu-img measure' size does not match the real allocated size for luks-inside-qcow2 image)
- Resolves: bz#1666206
  (vnc server should detect page-flips and avoid sending fullscreen updates then.)
- Resolves: bz#1669053
  (Guest call trace when boot with nvdimm device backed by /dev/dax)
- Resolves: bz#1674438
  (RHEL8.0 - Guest reboot fails after memory hotplug multiple times (kvm))
- Resolves: bz#1676907
  (/dev/kvm device exists but kernel module is not loaded on boot up causing VM start to fail in libvirt)
- Resolves: bz#1683473
  (Remove 7 qcow2 & luks iotests from rhel8 fast train build %check phase)
- Resolves: bz#1685995
  (/dev/kvm device exists but kernel module is not loaded on boot up causing VM start to fail in libvirt)
- Resolves: bz#1687582
  (QEMU IOTEST 200 fails with 'virtio-scsi-pci is not a valid device model name')
2019-04-11 14:06:53 -03:00

96 lines
3.2 KiB
Diff

From c233fdd40580baf460b34655aa72a9a489b4501b Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 7 Mar 2019 09:11:50 +0000
Subject: [PATCH 5/9] vnc: detect and optimize pageflips
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <20190307091150.6551-2-kraxel@redhat.com>
Patchwork-id: 84816
O-Subject: [RHEL-8.0/AV qemu-kvm PATCH 1/1] vnc: detect and optimize pageflips
Bugzilla: 1666206
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: John Snow <jsnow@redhat.com>
When size and format of the display surface stays the same we can just
tag the guest display as dirty and be done with it.
There is no need need to resize the vnc server display or to touch the
vnc client dirty bits. On the next refresh cycle
vnc_refresh_server_surface() will check for actual display content
changes and update the client dirty bits as needed.
The desktop resize and framebuffer format notifications to the vnc
client will be skipped too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190116101049.8929-1-kraxel@redhat.com
(cherry picked from commit 61e77a5f0c788495566aecb437bcf6b2cf9cda97)
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
ui/vnc.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index d7903a7..765bdc5 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -742,6 +742,17 @@ static void vnc_update_server_surface(VncDisplay *vd)
width, height);
}
+static bool vnc_check_pageflip(DisplaySurface *s1,
+ DisplaySurface *s2)
+{
+ return (s1 != NULL &&
+ s2 != NULL &&
+ surface_width(s1) == surface_width(s2) &&
+ surface_height(s1) == surface_height(s2) &&
+ surface_format(s1) == surface_format(s2));
+
+}
+
static void vnc_dpy_switch(DisplayChangeListener *dcl,
DisplaySurface *surface)
{
@@ -749,6 +760,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
"Display output is not active.";
static DisplaySurface *placeholder;
VncDisplay *vd = container_of(dcl, VncDisplay, dcl);
+ bool pageflip = vnc_check_pageflip(vd->ds, surface);
VncState *vs;
if (surface == NULL) {
@@ -761,14 +773,21 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
vnc_abort_display_jobs(vd);
vd->ds = surface;
- /* server surface */
- vnc_update_server_surface(vd);
-
/* guest surface */
qemu_pixman_image_unref(vd->guest.fb);
vd->guest.fb = pixman_image_ref(surface->image);
vd->guest.format = surface->format;
+ if (pageflip) {
+ vnc_set_area_dirty(vd->guest.dirty, vd, 0, 0,
+ surface_width(surface),
+ surface_height(surface));
+ return;
+ }
+
+ /* server surface */
+ vnc_update_server_surface(vd);
+
QTAILQ_FOREACH(vs, &vd->clients, next) {
vnc_colordepth(vs);
vnc_desktop_resize(vs);
--
1.8.3.1