From 9d583b3fdbed686642dbc0d96d1e417485ca0077 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 2 Jun 2017 11:39:34 -0500 Subject: [PATCH] ecore_drm2: Fix dpms shutdown while disabling outputs We need to set output->enabled to disabled *after* dpms takes place or set it to enabled *before* dpms takes place. We can't just set it at the start of the function or one of enable/disable will hit the dpms path with a disabled display. --- src/lib/ecore_drm2/ecore_drm2_outputs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index b288679..39fb847 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -1237,16 +1237,19 @@ ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled) if (!output->connected) return; if (output->enabled == enabled) return; - output->enabled = enabled; if (output->enabled) - ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON); + { + output->enabled = enabled; + ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON); + } else { if (_ecore_drm2_use_atomic) ecore_drm2_fb_flip(NULL, output); ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF); + output->enabled = enabled; if (output->current.fb) _ecore_drm2_fb_buffer_release(output, &output->current); -- 2.7.4