ecore_drm2: Fix dpms shutdown while disabling outputs
authorDerek Foreman <derekf@osg.samsung.com>
Fri, 2 Jun 2017 16:39:34 +0000 (11:39 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Fri, 2 Jun 2017 20:50:08 +0000 (15:50 -0500)
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

index b288679..39fb847 100644 (file)
@@ -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);