diff options
author | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-11 09:24:12 -0400 |
---|---|---|
committer | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-27 11:57:53 -0400 |
commit | b634f9485a837bd1a3a708a23f996c70d53ce138 (patch) | |
tree | ebde4f4d4918797d0938990346b6dc0503576d29 | |
parent | 758ce917193d82462d684ddbaad6d6a493a2cf41 (diff) | |
download | efl-b634f9485a837bd1a3a708a23f996c70d53ce138.tar.gz |
ecore-drm2: Add API functions to get/set if an output is enabled
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
-rw-r--r-- | src/lib/ecore_drm2/Ecore_Drm2.h | 23 | ||||
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_outputs.c | 23 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index bcbffcb958..3b4ffdfebc 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -415,6 +415,29 @@ EAPI Eina_Bool ecore_drm2_output_primary_get(Ecore_Drm2_Output *output); EAPI void ecore_drm2_output_primary_set(Ecore_Drm2_Output *output, Eina_Bool primary); /** + * Get if a given output is enabled + * + * @param output + * + * @return EINA_TRUE if enabled, EINA_FALSE otherwise. + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.18 + */ +EAPI Eina_Bool ecore_drm2_output_enabled_get(Ecore_Drm2_Output *output); + +/** + * Set if a given output is enabled + * + * @param output + * @param enabled + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.18 + */ +EAPI void ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled); + +/** * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions * * Functions that deal with setup of framebuffers diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 285ca84c91..553c91101c 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -931,3 +931,26 @@ ecore_drm2_output_primary_set(Ecore_Drm2_Output *output, Eina_Bool primary) EINA_SAFETY_ON_NULL_RETURN(output); output->primary = primary; } + +EAPI Eina_Bool +ecore_drm2_output_enabled_get(Ecore_Drm2_Output *output) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); + return output->enabled; +} + +EAPI void +ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled) +{ + EINA_SAFETY_ON_NULL_RETURN(output); + + if (output->enabled == enabled) return; + output->enabled = enabled; + + if (output->enabled) + ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON); + else + ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF); + + _output_event_send(output); +} |