ecore-drm: Add API function to return primary output
authorChris Michael <cp.michael@samsung.com>
Wed, 6 May 2015 16:22:15 +0000 (12:22 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 7 May 2015 18:39:46 +0000 (14:39 -0400)
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>
src/lib/ecore_drm/Ecore_Drm.h
src/lib/ecore_drm/ecore_drm_output.c

index 2177b3f..fcf784b 100644 (file)
@@ -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
index 9ce8641..d9283f1 100644 (file)
@@ -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;
+}