[PATCH weston v5 04/42] Remove DPMS-on when going offscreen

Daniel Stone daniels at collabora.com
Wed Nov 16 14:24:56 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.

Signed-off-by: Daniel Stone <daniels at collabora.com>

Differential Revision: https://phabricator.freedesktop.org/D1483
---
 libweston/compositor.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/libweston/compositor.c b/libweston/compositor.c
index d552e18..c403bfa 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -3940,10 +3940,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:
@@ -3959,10 +3958,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
@@ -3972,8 +3967,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