|
|
9ae3a8 |
From 59bdfd752c491ce0e7253d78e379b0bd8c5cd00e Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: "Daniel P. Berrange" <berrange@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 8 Feb 2018 17:50:18 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 04/27] vnc: return directly if no vnc client connected
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20180208175041.5634-5-berrange@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 78950
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.5 qemu-kvm PATCH v1 04/27] vnc: return directly if no vnc client connected
|
|
|
9ae3a8 |
Bugzilla: 1527405
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: ChenLiang <chenliang88@huawei.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
graphic_hw_update and vnc_refresh_server_surface aren't
|
|
|
9ae3a8 |
need to do when no vnc client connected. It can reduce
|
|
|
9ae3a8 |
lock contention, because vnc_refresh will hold global big
|
|
|
9ae3a8 |
lock two millisecond every three seconds.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: ChenLiang <chenliang88@huawei.com>
|
|
|
9ae3a8 |
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 9d6b20704734fe1ab789400806ebd54f579d50a2)
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
ui/vnc.c | 10 +++++-----
|
|
|
9ae3a8 |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/ui/vnc.c b/ui/vnc.c
|
|
|
9ae3a8 |
index 42070b4..9047862 100644
|
|
|
9ae3a8 |
--- a/ui/vnc.c
|
|
|
9ae3a8 |
+++ b/ui/vnc.c
|
|
|
9ae3a8 |
@@ -2677,6 +2677,11 @@ static void vnc_refresh(DisplayChangeListener *dcl)
|
|
|
9ae3a8 |
VncState *vs, *vn;
|
|
|
9ae3a8 |
int has_dirty, rects = 0;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ if (QTAILQ_EMPTY(&vd->clients)) {
|
|
|
9ae3a8 |
+ update_displaychangelistener(&vd->dcl, VNC_REFRESH_INTERVAL_MAX);
|
|
|
9ae3a8 |
+ return;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
graphic_hw_update(NULL);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (vnc_trylock_display(vd)) {
|
|
|
9ae3a8 |
@@ -2692,11 +2697,6 @@ static void vnc_refresh(DisplayChangeListener *dcl)
|
|
|
9ae3a8 |
/* vs might be free()ed here */
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- if (QTAILQ_EMPTY(&vd->clients)) {
|
|
|
9ae3a8 |
- update_displaychangelistener(&vd->dcl, VNC_REFRESH_INTERVAL_MAX);
|
|
|
9ae3a8 |
- return;
|
|
|
9ae3a8 |
- }
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
if (has_dirty && rects) {
|
|
|
9ae3a8 |
vd->dcl.update_interval /= 2;
|
|
|
9ae3a8 |
if (vd->dcl.update_interval < VNC_REFRESH_INTERVAL_BASE) {
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|