summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-06 12:22:15 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-07 14:39:46 -0400
commit8120cdcc1369acb0b1f69d8995e9843a4656511c (patch)
tree6420ced50b75d1d7cfbb4a35e58bad7037ae6b1e /src/lib/ecore_drm
parent94adf30b93e7a1bc2f7d77ea98beddc81bffdd06 (diff)
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.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/Ecore_Drm.h12
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c14
2 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index 2177b3f49f..fcf784b2c2 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);
856 */ 856 */
857EAPI Eina_List *ecore_drm_output_modes_get(Ecore_Drm_Output *output); 857EAPI Eina_List *ecore_drm_output_modes_get(Ecore_Drm_Output *output);
858 858
859/**
860 * Get the output which is marked as primary
861 *
862 * @param dev The Ecore_Drm_Device to get the primary output from
863 *
864 * @return The primary Ecore_Drm_Output or NULL if no primary output is set
865 *
866 * @ingroup Ecore_Drm_Output_Group
867 * @since 1.15
868 */
869EAPI Ecore_Drm_Output *ecore_drm_output_primary_get(Ecore_Drm_Device *dev);
870
859#ifdef __cplusplus 871#ifdef __cplusplus
860} 872}
861#endif 873#endif
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 9ce8641363..d9283f1b06 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)
1249 1249
1250 return output->modes; 1250 return output->modes;
1251} 1251}
1252
1253EAPI Ecore_Drm_Output *
1254ecore_drm_output_primary_get(Ecore_Drm_Device *dev)
1255{
1256 Ecore_Drm_Output *ret;
1257 const Eina_List *l;
1258
1259 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
1260
1261 EINA_LIST_FOREACH(dev->outputs, l, ret)
1262 if (ret->primary) return ret;
1263
1264 return NULL;
1265}