aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-07 11:31:46 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-07 14:39:46 -0400
commit2145cb18c296b4269d52b57c000a9495ce8b71e1 (patch)
treeb8ee70fc83bdacc0a8302752fb56d2e7b4b9bd7f /src/lib/ecore_drm
parentecore-drm: Fix formatting (diff)
downloadefl-2145cb18c296b4269d52b57c000a9495ce8b71e1.tar.gz
ecore-drm: Add API function to find an output given a name
Summary: This adds a new API function to find an Ecore_Drm_Output which matches a given name. @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.h16
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c16
2 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index d0e97b5246..ad2ae4a9dd 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -880,6 +880,22 @@ EAPI Ecore_Drm_Output *ecore_drm_output_primary_get(Ecore_Drm_Device *dev);
*/
EAPI void ecore_drm_output_crtc_size_get(Ecore_Drm_Output *output, int *width, int *height);
+/**
+ * Find an Ecore_Drm_Output which has the given name
+ *
+ * This function will loop all the existing outputs in Ecore_Drm_Device and
+ * return an output if one exists that matches the given name.
+ *
+ * @param dev The Ecore_Drm_Device to search
+ * @param name The Ecore_Drm_Output matching this name
+ *
+ * @return An Ecore_Drm_Output if one exists at these coordinates or NULL
+ *
+ * @ingroup Ecore_Drm_Device_Group
+ * @since 1.15
+ */
+EAPI Ecore_Drm_Output *ecore_drm_device_output_name_find(Ecore_Drm_Device *dev, const char *name);
+
# ifdef __cplusplus
}
# endif
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index 81636c65e7..2a29b0e758 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -545,3 +545,19 @@ ecore_drm_screen_size_range_get(Ecore_Drm_Device *dev, int *minw, int *minh, int
if (maxw) *maxw = dev->max_width;
if (maxh) *maxh = dev->max_height;
}
+
+EAPI Ecore_Drm_Output *
+ecore_drm_device_output_name_find(Ecore_Drm_Device *dev, const char *name)
+{
+ Ecore_Drm_Output *output;
+ Eina_List *l;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(name, NULL);
+
+ EINA_LIST_FOREACH(dev->outputs, l, output)
+ if ((output->name) && (!strcmp(name, output->name)))
+ return output;
+
+ return NULL;
+}