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.
This commit is contained in:
Derek Foreman 2017-06-02 11:39:34 -05:00
parent 0df7299526
commit 9d583b3fdb
1 changed files with 5 additions and 2 deletions

View 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);