* [Qemu-devel] [PATCH] vnc: return directly if no vnc client connected
@ 2014-09-29 7:00 arei.gonglei
2014-09-29 8:09 ` Gerd Hoffmann
0 siblings, 1 reply; 2+ messages in thread
From: arei.gonglei @ 2014-09-29 7:00 UTC (permalink / raw)
To: qemu-devel; +Cc: ChenLiang, Gonglei, weidong.huang, kraxel, armbru
From: ChenLiang <chenliang88@huawei.com>
graphic_hw_update and vnc_refresh_server_surface aren't
need to do when no vnc client connected. It can reduce
lock contention, because vnc_refresh will hold global big
lock two millisecond every three seconds.
Signed-off-by: ChenLiang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
ui/vnc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 0fe6eff..092ba2e 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2768,6 +2768,11 @@ static void vnc_refresh(DisplayChangeListener *dcl)
VncState *vs, *vn;
int has_dirty, rects = 0;
+ if (QTAILQ_EMPTY(&vd->clients)) {
+ update_displaychangelistener(&vd->dcl, VNC_REFRESH_INTERVAL_MAX);
+ return;
+ }
+
graphic_hw_update(NULL);
if (vnc_trylock_display(vd)) {
@@ -2783,11 +2788,6 @@ static void vnc_refresh(DisplayChangeListener *dcl)
/* vs might be free()ed here */
}
- if (QTAILQ_EMPTY(&vd->clients)) {
- update_displaychangelistener(&vd->dcl, VNC_REFRESH_INTERVAL_MAX);
- return;
- }
-
if (has_dirty && rects) {
vd->dcl.update_interval /= 2;
if (vd->dcl.update_interval < VNC_REFRESH_INTERVAL_BASE) {
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] vnc: return directly if no vnc client connected
2014-09-29 7:00 [Qemu-devel] [PATCH] vnc: return directly if no vnc client connected arei.gonglei
@ 2014-09-29 8:09 ` Gerd Hoffmann
0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2014-09-29 8:09 UTC (permalink / raw)
To: arei.gonglei; +Cc: ChenLiang, weidong.huang, qemu-devel, armbru
On Mo, 2014-09-29 at 15:00 +0800, arei.gonglei@huawei.com wrote:
> graphic_hw_update and vnc_refresh_server_surface aren't
> need to do when no vnc client connected. It can reduce
> lock contention, because vnc_refresh will hold global big
> lock two millisecond every three seconds.
Added to vnc patch queue.
thanks,
Gerd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-29 8:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-29 7:00 [Qemu-devel] [PATCH] vnc: return directly if no vnc client connected arei.gonglei
2014-09-29 8:09 ` Gerd Hoffmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.