Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWGSp-0005jU-0Y for qemu-devel@nongnu.org; Thu, 21 Aug 2008 16:08:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWGSn-0005hp-Fz for qemu-devel@nongnu.org; Thu, 21 Aug 2008 16:08:58 -0400 Received: from [199.232.76.173] (port=55703 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWGSn-0005hX-5J for qemu-devel@nongnu.org; Thu, 21 Aug 2008 16:08:57 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35370 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KWGSm-0005m3-Sv for qemu-devel@nongnu.org; Thu, 21 Aug 2008 16:08:56 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KWGSm-0004Ql-B7 for qemu-devel@nongnu.org; Thu, 21 Aug 2008 20:08:56 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KWGSm-0004Qh-05 for qemu-devel@nongnu.org; Thu, 21 Aug 2008 20:08:56 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 21 Aug 2008 20:08:56 +0000 Subject: [Qemu-devel] [5056] add DisplayState->idle (Samuel Thibault) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5056 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5056 Author: aliguori Date: 2008-08-21 20:08:55 +0000 (Thu, 21 Aug 2008) Log Message: ----------- add DisplayState->idle (Samuel Thibault) Add idle field to DisplayState struct, so drivers can figure the display is idle and take advantage of that. The xen framebuffer driver will use this to communicate the idle state to the guest, so it knows it can stop doing updates to a virtual display which is invisible anyway. Signed-off-by: Gerd Hoffmann Signed-off-by: Samuel Thibault Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/console.h trunk/sdl.c trunk/vl.c trunk/vnc.c Modified: trunk/console.h =================================================================== --- trunk/console.h 2008-08-21 20:08:03 UTC (rev 5055) +++ trunk/console.h 2008-08-21 20:08:55 UTC (rev 5056) @@ -80,6 +80,7 @@ void *opaque; struct QEMUTimer *gui_timer; uint64_t gui_timer_interval; + int idle; void (*dpy_update)(struct DisplayState *s, int x, int y, int w, int h); void (*dpy_resize)(struct DisplayState *s, int w, int h); Modified: trunk/sdl.c =================================================================== --- trunk/sdl.c 2008-08-21 20:08:03 UTC (rev 5055) +++ trunk/sdl.c 2008-08-21 20:08:55 UTC (rev 5056) @@ -524,9 +524,11 @@ if (ev->active.gain) { /* Back to default interval */ ds->gui_timer_interval = 0; + ds->idle = 0; } else { /* Sleeping interval */ ds->gui_timer_interval = 500; + ds->idle = 1; } } break; Modified: trunk/vl.c =================================================================== --- trunk/vl.c 2008-08-21 20:08:03 UTC (rev 5055) +++ trunk/vl.c 2008-08-21 20:08:55 UTC (rev 5056) @@ -5976,6 +5976,8 @@ ds->dpy_update = dumb_update; ds->dpy_resize = dumb_resize; ds->dpy_refresh = dumb_refresh; + ds->gui_timer_interval = 500; + ds->idle = 1; } /***********************************************************/ Modified: trunk/vnc.c =================================================================== --- trunk/vnc.c 2008-08-21 20:08:03 UTC (rev 5055) +++ trunk/vnc.c 2008-08-21 20:08:55 UTC (rev 5056) @@ -660,6 +660,7 @@ qemu_set_fd_handler2(vs->csock, NULL, NULL, NULL, NULL); closesocket(vs->csock); vs->csock = -1; + vs->ds->idle = 1; buffer_reset(&vs->input); buffer_reset(&vs->output); vs->need_update = 0; @@ -1920,6 +1921,7 @@ static void vnc_connect(VncState *vs) { VNC_DEBUG("New client on socket %d\n", vs->csock); + vs->ds->idle = 0; socket_set_nonblock(vs->csock); qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, NULL, vs); vnc_write(vs, "RFB 003.008\n", 12); @@ -1959,6 +1961,7 @@ exit(1); ds->opaque = vs; + ds->idle = 1; vnc_state = vs; vs->display = NULL; vs->password = NULL;