devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8120cdcc1369acb0b1f69d8995e9843a4656511c
commit 8120cdcc1369acb0b1f69d8995e9843a4656511c Author: Chris Michael <cp.mich...@samsung.com> Date: Wed May 6 12:22:15 2015 -0400 ecore-drm: Add API function to return primary output Summary: This adds a new API function to return the output which is marked as the primary output. @feature Signed-off-by: Chris Michael <cp.mich...@samsung.com> --- src/lib/ecore_drm/Ecore_Drm.h | 12 ++++++++++++ src/lib/ecore_drm/ecore_drm_output.c | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h index 2177b3f..fcf784b 100644 --- a/src/lib/ecore_drm/Ecore_Drm.h +++ b/src/lib/ecore_drm/Ecore_Drm.h @@ -856,6 +856,18 @@ EAPI char *ecore_drm_output_edid_get(Ecore_Drm_Output *output); */ EAPI Eina_List *ecore_drm_output_modes_get(Ecore_Drm_Output *output); +/** + * Get the output which is marked as primary + * + * @param dev The Ecore_Drm_Device to get the primary output from + * + * @return The primary Ecore_Drm_Output or NULL if no primary output is set + * + * @ingroup Ecore_Drm_Output_Group + * @since 1.15 + */ +EAPI Ecore_Drm_Output *ecore_drm_output_primary_get(Ecore_Drm_Device *dev); + #ifdef __cplusplus } #endif diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c index 9ce8641..d9283f1 100644 --- a/src/lib/ecore_drm/ecore_drm_output.c +++ b/src/lib/ecore_drm/ecore_drm_output.c @@ -1249,3 +1249,17 @@ ecore_drm_output_modes_get(Ecore_Drm_Output *output) return output->modes; } + +EAPI Ecore_Drm_Output * +ecore_drm_output_primary_get(Ecore_Drm_Device *dev) +{ + Ecore_Drm_Output *ret; + const Eina_List *l; + + EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL); + + EINA_LIST_FOREACH(dev->outputs, l, ret) + if (ret->primary) return ret; + + return NULL; +} --