[PATCH weston 2/2] compositor: turn off the idle timer when sleeping
Philipp Brüschweiler
blei42 at gmail.com
Sun Mar 10 06:37:05 PDT 2013
Also updates the drm, fbdev and rpi backend to use
weston_compositor_sleep() and not set the state manually.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=61910 (rpi backend
untested).
---
src/compositor-drm.c | 2 +-
src/compositor-fbdev.c | 2 +-
src/compositor-rpi.c | 4 ++--
src/compositor.c | 1 +
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index d933c92..7b89940 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -2027,7 +2027,7 @@ vt_func(struct weston_compositor *compositor, int event)
compositor->focus = 0;
ec->prev_state = compositor->state;
- compositor->state = WESTON_COMPOSITOR_SLEEPING;
+ weston_compositor_sleep(compositor);
/* If we have a repaint scheduled (either from a
* pending pageflip or the idle handler), make sure we
diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index 070d187..c53d993 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -791,7 +791,7 @@ vt_func(struct weston_compositor *base, int event)
compositor->base.focus = 0;
compositor->prev_state = compositor->base.state;
- compositor->base.state = WESTON_COMPOSITOR_SLEEPING;
+ weston_compositor_sleep(&compositor->base);
/* If we have a repaint scheduled (from the idle handler), make
* sure we cancel that so we don't try to pageflip when we're
diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c
index d3767b9..4b20b8b 100644
--- a/src/compositor-rpi.c
+++ b/src/compositor-rpi.c
@@ -577,7 +577,7 @@ rpi_element_dmx_move(struct rpi_element *element,
&dst_rect,
&src_rect,
DISPMANX_NO_HANDLE,
- DISPMANX_NO_ROTATE);
+ VC_IMAGE_ROT0);
DBG("element %p move\n", element);
}
@@ -1381,7 +1381,7 @@ vt_func(struct weston_compositor *base, int event)
compositor->base.focus = 0;
compositor->prev_state = compositor->base.state;
- compositor->base.state = WESTON_COMPOSITOR_SLEEPING;
+ weston_compositor_sleep(&compositor->base);
/* If we have a repaint scheduled (either from a
* pending pageflip or the idle handler), make sure we
diff --git a/src/compositor.c b/src/compositor.c
index 7df9658..e32de07 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1624,6 +1624,7 @@ weston_compositor_sleep(struct weston_compositor *compositor)
if (compositor->state == WESTON_COMPOSITOR_SLEEPING)
return;
+ wl_event_source_timer_update(compositor->idle_source, 0);
compositor->state = WESTON_COMPOSITOR_SLEEPING;
weston_compositor_dpms(compositor, WESTON_DPMS_OFF);
}
--
1.8.1.5
More information about the wayland-devel
mailing list