[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] ioemu: Slown down refresh interval when SDL is minimized



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1204710183 0
# Node ID 854b0704962bcad84a431f0c8c0f597b2e2a8e93
# Parent  2909b03e05de48c39defaf05e4555f29a3e454e2
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>
---
 tools/ioemu/sdl.c |    9 +++++++++
 tools/ioemu/vl.c  |    6 +++++-
 tools/ioemu/vl.h  |    1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

diff -r 2909b03e05de -r 854b0704962b tools/ioemu/sdl.c
--- a/tools/ioemu/sdl.c Tue Mar 04 13:30:07 2008 +0000
+++ b/tools/ioemu/sdl.c Wed Mar 05 09:43:03 2008 +0000
@@ -518,6 +518,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 2909b03e05de -r 854b0704962b tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Tue Mar 04 13:30:07 2008 +0000
+++ b/tools/ioemu/vl.c  Wed Mar 05 09:43:03 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 2909b03e05de -r 854b0704962b tools/ioemu/vl.h
--- a/tools/ioemu/vl.h  Tue Mar 04 13:30:07 2008 +0000
+++ b/tools/ioemu/vl.h  Wed Mar 05 09:43:03 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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.