summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_outputs.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-06-06 11:06:34 -0400
committerChris Michael <cp.michael@samsung.com>2017-06-06 11:06:34 -0400
commit96347d1ee21795220a462bc347fbe717bea82797 (patch)
treeb150d4858ebc8ba312176e9abeb61fce6165ca96 /src/lib/ecore_drm2/ecore_drm2_outputs.c
parent0dc439abbc44e90067c9ad3c2696787285be53d6 (diff)
ecore-drm2: Don't use Atomic functions to set DPMS levels
This was initially an experiment in trying to use Atomic properties to set dpms on/off, however it does not turn off backlight support when triggered so it is useless. Fixes T5462 @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_outputs.c')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c63
1 files changed, 2 insertions, 61 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 4af738041a..a30d04e0b7 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -412,60 +412,6 @@ _output_dpms_property_get(int fd, const drmModeConnector *conn)
412 return NULL; 412 return NULL;
413} 413}
414 414
415#ifdef HAVE_ATOMIC_DRM
416static Eina_Bool
417_output_dpms_atomic_set(Ecore_Drm2_Output *output, int level)
418{
419 Ecore_Drm2_Connector_State *cstate;
420 Ecore_Drm2_Crtc_State *rstate;
421 drmModeAtomicReq *req = NULL;
422 Eina_Bool ret = EINA_TRUE;
423
424 req = sym_drmModeAtomicAlloc();
425 if (!req) return EINA_FALSE;
426
427 sym_drmModeAtomicSetCursor(req, 0);
428
429 cstate = output->conn_state;
430 rstate = output->crtc_state;
431
432 if (sym_drmModeAtomicAddProperty(req, cstate->obj_id,
433 cstate->dpms.id, level) < 0)
434 {
435 ERR("Failed to add connector property DPMS");
436 ret = EINA_FALSE;
437 goto err;
438 }
439
440 if (sym_drmModeAtomicAddProperty(req, rstate->obj_id,
441 rstate->active.id,
442 ((level == 0) ? 1 : 0)) < 0)
443 {
444 ERR("Failed to add crtc active property");
445 ret = EINA_FALSE;
446 goto err;
447 }
448
449 if (sym_drmModeAtomicCommit(output->fd, req, 0, NULL))
450 {
451 ERR("Could not set dpms property: %m");
452 ret = EINA_FALSE;
453 goto err;
454 }
455
456 cstate->dpms.value = level;
457 if (level == 0)
458 rstate->active.value = 1;
459 else
460 rstate->active.value = 0;
461
462err:
463 sym_drmModeAtomicFree(req);
464
465 return ret;
466}
467#endif
468
469static double 415static double
470_output_backlight_value_get(Ecore_Drm2_Output *output, const char *attr) 416_output_backlight_value_get(Ecore_Drm2_Output *output, const char *attr)
471{ 417{
@@ -1090,13 +1036,8 @@ ecore_drm2_output_dpms_set(Ecore_Drm2_Output *output, int level)
1090 EINA_SAFETY_ON_NULL_RETURN(output); 1036 EINA_SAFETY_ON_NULL_RETURN(output);
1091 EINA_SAFETY_ON_TRUE_RETURN(!output->enabled); 1037 EINA_SAFETY_ON_TRUE_RETURN(!output->enabled);
1092 1038
1093#ifdef HAVE_ATOMIC_DRM 1039 sym_drmModeConnectorSetProperty(output->fd, output->conn_id,
1094 if (_ecore_drm2_use_atomic) 1040 output->dpms->prop_id, level);
1095 _output_dpms_atomic_set(output, level);
1096 else
1097#endif
1098 sym_drmModeConnectorSetProperty(output->fd, output->conn_id,
1099 output->dpms->prop_id, level);
1100 1041
1101 if (level == 0) /* DPMS on */ 1042 if (level == 0) /* DPMS on */
1102 ecore_drm2_fb_flip(NULL, output); 1043 ecore_drm2_fb_flip(NULL, output);