WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] ioemu: Slown down refresh interval when SDL is minim

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] ioemu: Slown down refresh interval when SDL is minimized
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Tue, 4 Mar 2008 15:38:25 +0000
Delivery-date: Tue, 04 Mar 2008 07:39:39 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
ioemu: Slown down refresh interval when SDL is minimized
as that saves us the VGA refresh scanning.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r c6cd384a48bf tools/ioemu/sdl.c
--- a/tools/ioemu/sdl.c Tue Mar 04 12:32:31 2008 +0000
+++ b/tools/ioemu/sdl.c Tue Mar 04 15:34:25 2008 +0000
@@ -515,6 +515,15 @@ static void sdl_refresh(DisplayState *ds
                 !ev->active.gain && !gui_fullscreen_initial_grab) {
                 sdl_grab_end();
             }
+           if (ev->active.state & SDL_APPACTIVE) {
+               if (ev->active.gain) {
+                   /* Back to default interval */
+                   ds->gui_timer_interval = 0;
+               } else {
+                   /* Sleeping interval */
+                   ds->gui_timer_interval = 500;
+               }
+           }
             break;
         default:
             break;
diff -r c6cd384a48bf tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Tue Mar 04 12:32:31 2008 +0000
+++ b/tools/ioemu/vl.c  Tue Mar 04 15:34:25 2008 +0000
@@ -6125,7 +6125,11 @@ void gui_update(void *opaque)
 void gui_update(void *opaque)
 {
     display_state.dpy_refresh(&display_state);
-    qemu_mod_timer(gui_timer, GUI_REFRESH_INTERVAL + qemu_get_clock(rt_clock));
+    qemu_mod_timer(gui_timer,
+            (display_state.gui_timer_interval ?
+                display_state.gui_timer_interval :
+                GUI_REFRESH_INTERVAL)
+            + qemu_get_clock(rt_clock));
 }
 
 struct vm_change_state_entry {
diff -r c6cd384a48bf tools/ioemu/vl.h
--- a/tools/ioemu/vl.h  Tue Mar 04 12:32:31 2008 +0000
+++ b/tools/ioemu/vl.h  Tue Mar 04 15:34:25 2008 +0000
@@ -935,6 +935,7 @@ struct DisplayState {
     int width;
     int height;
     void *opaque;
+    uint64_t gui_timer_interval;
 
     int switchbpp;
     int shared_buf;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] ioemu: Slown down refresh interval when SDL is minimized, Samuel Thibault <=