aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-09-23 08:53:32 -0400
committerChris Michael <cp.michael@samsung.com>2016-09-23 08:53:32 -0400
commitbcf311ae3c410f8d468d8f13a77b4f44ec3cd7c4 (patch)
tree20a500e209498c3001cbc2f90471a998f18363f5
parentecore-drm2: Remove useless if check for atomic_modeset flag (diff)
downloadefl-bcf311ae3c410f8d468d8f13a77b4f44ec3cd7c4.tar.gz
ecore-drm2: Use Atomic State to enable/disable an output
If Atomic Modesetting is supported, we can use that to enable/disable a given output. Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index b667546657..8171d11d16 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1169,20 +1169,23 @@ ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled)
if (output->enabled)
{
- Ecore_Drm2_Fb *fb = NULL;
-
- if (output->current) fb = output->current;
- else if (output->next) fb = output->next;
-
- if (fb) drmModeSetCrtc(output->fd, output->crtc_id, fb->id,
- output->x, output->y,
- &output->conn_id, 1,
- &output->current_mode->info);
-
+#ifdef HAVE_ATOMIC_DRM
+ if (_ecore_drm2_use_atomic)
+ output->crtc_state->active.value = 1;
+#endif
+ ecore_drm2_fb_flip(NULL, output);
ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON);
}
else
{
+#ifdef HAVE_ATOMIC_DRM
+ if (_ecore_drm2_use_atomic)
+ {
+ output->crtc_state->active.value = 0;
+ ecore_drm2_fb_flip(NULL, output);
+ }
+#endif
+
ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF);
output->current = NULL;
/* output->next = NULL; */