[PATCH weston 06/68] Remove DPMS-on when going offscreen

Daniel Stone daniels at collabora.com
Fri Dec 9 19:57:21 UTC 2016


Forcing DPMS on when we lose our session may force an expensive modeset
operation, which is pointless if the next consumer (another compositor,
or the console) is going to do a modeset. These should force DPMS on
regardless.

This actively causes problems for the DRM backend, in that it may
actually require a repaint to set coherent state for DPMS off -> DPMS on
transitions, which is very much not what we want when going offscreen.

As DRM is the only backend which actually implements DPMS, just remove
this call.

Differential Revision: https://phabricator.freedesktop.org/D1483

Signed-off-by: Daniel Stone <daniels at collabora.com>
---
 libweston/compositor.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/libweston/compositor.c b/libweston/compositor.c
index ad59156..895a040 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -3933,10 +3933,9 @@ weston_compositor_wake(struct weston_compositor *compositor)
 
 	switch (old_state) {
 	case WESTON_COMPOSITOR_SLEEPING:
-		weston_compositor_dpms(compositor, WESTON_DPMS_ON);
-		/* fall through */
 	case WESTON_COMPOSITOR_IDLE:
 	case WESTON_COMPOSITOR_OFFSCREEN:
+		weston_compositor_dpms(compositor, WESTON_DPMS_ON);
 		wl_signal_emit(&compositor->wake_signal, compositor);
 		/* fall through */
 	default:
@@ -3952,10 +3951,6 @@ weston_compositor_wake(struct weston_compositor *compositor)
  * This is used for example to prevent further rendering while the
  * compositor is shutting down.
  *
- * \note When offscreen state is entered, outputs will be powered
- * back on if they were sleeping (in DPMS off mode), even though
- * no rendering will be performed.
- *
  * Stops the idle timer.
  */
 WL_EXPORT void
@@ -3965,8 +3960,6 @@ weston_compositor_offscreen(struct weston_compositor *compositor)
 	case WESTON_COMPOSITOR_OFFSCREEN:
 		return;
 	case WESTON_COMPOSITOR_SLEEPING:
-		weston_compositor_dpms(compositor, WESTON_DPMS_ON);
-		/* fall through */
 	default:
 		compositor->state = WESTON_COMPOSITOR_OFFSCREEN;
 		wl_event_source_timer_update(compositor->idle_source, 0);
-- 
2.9.3



More information about the wayland-devel mailing list