ia64/xen-unstable

changeset 17186:854b0704962b

ioemu: Slown down refresh interval when SDL is minimized
as that saves us the VGA refresh scanning.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 05 09:43:03 2008 +0000 (2008-03-05)
parents 2909b03e05de
children 21532468020b
files tools/ioemu/sdl.c tools/ioemu/vl.c tools/ioemu/vl.h
line diff
     1.1 --- a/tools/ioemu/sdl.c	Tue Mar 04 13:30:07 2008 +0000
     1.2 +++ b/tools/ioemu/sdl.c	Wed Mar 05 09:43:03 2008 +0000
     1.3 @@ -518,6 +518,15 @@ static void sdl_refresh(DisplayState *ds
     1.4                  !ev->active.gain && !gui_fullscreen_initial_grab) {
     1.5                  sdl_grab_end();
     1.6              }
     1.7 +	    if (ev->active.state & SDL_APPACTIVE) {
     1.8 +		if (ev->active.gain) {
     1.9 +		    /* Back to default interval */
    1.10 +		    ds->gui_timer_interval = 0;
    1.11 +		} else {
    1.12 +		    /* Sleeping interval */
    1.13 +		    ds->gui_timer_interval = 500;
    1.14 +		}
    1.15 +	    }
    1.16              break;
    1.17          default:
    1.18              break;
     2.1 --- a/tools/ioemu/vl.c	Tue Mar 04 13:30:07 2008 +0000
     2.2 +++ b/tools/ioemu/vl.c	Wed Mar 05 09:43:03 2008 +0000
     2.3 @@ -6125,7 +6125,11 @@ QEMUMachine *find_machine(const char *na
     2.4  void gui_update(void *opaque)
     2.5  {
     2.6      display_state.dpy_refresh(&display_state);
     2.7 -    qemu_mod_timer(gui_timer, GUI_REFRESH_INTERVAL + qemu_get_clock(rt_clock));
     2.8 +    qemu_mod_timer(gui_timer,
     2.9 +            (display_state.gui_timer_interval ?
    2.10 +                display_state.gui_timer_interval :
    2.11 +                GUI_REFRESH_INTERVAL)
    2.12 +            + qemu_get_clock(rt_clock));
    2.13  }
    2.14  
    2.15  struct vm_change_state_entry {
     3.1 --- a/tools/ioemu/vl.h	Tue Mar 04 13:30:07 2008 +0000
     3.2 +++ b/tools/ioemu/vl.h	Wed Mar 05 09:43:03 2008 +0000
     3.3 @@ -935,6 +935,7 @@ struct DisplayState {
     3.4      int width;
     3.5      int height;
     3.6      void *opaque;
     3.7 +    uint64_t gui_timer_interval;
     3.8  
     3.9      int switchbpp;
    3.10      int shared_buf;