From 893b936f9a189e0e6564634c7edad78ac959986c Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 8 Nov 2016 15:47:09 +0000 Subject: [PATCH] Remove DPMS-on when going offscreen 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 Reviewed-by: Quentin Glidic --- libweston/compositor.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 64578584..f20912ed 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -3932,10 +3932,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: @@ -3951,10 +3950,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 @@ -3964,8 +3959,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);