summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-04 15:03:47 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-07 14:39:46 -0400
commit34664306a99100cdcebcba9b163d2d28ee3d1350 (patch)
tree115d70cc48d80ccb2bcd9726f8849ae530271554
parent130ad6d60fa7e67c50db7aeffa3fab37b92de404 (diff)
downloadefl-34664306a99100cdcebcba9b163d2d28ee3d1350.tar.gz
ecore-drm: Add API function to return the edid of a given output
Summary: This adds a new API function to return the EDID string of a given output. @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm/Ecore_Drm.h12
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c12
-rw-r--r--src/lib/ecore_drm/ecore_drm_private.h2
3 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 d0a2c3673a..e2b79a0567 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -824,6 +824,18 @@ EAPI unsigned int ecore_drm_output_connector_type_get(Ecore_Drm_Output *output);
*/
EAPI Eina_Bool ecore_drm_output_backlight_get(Ecore_Drm_Output *output);
+/**
+ * Get the edid of a given output
+ *
+ * @param output The Ecore_Drm_Output to get the backlight of
+ *
+ * @return A string representing the edid
+ *
+ * @ingroup Ecore_Drm_Output_Group
+ * @since 1.15
+ */
+EAPI char *ecore_drm_output_edid_get(Ecore_Drm_Output *output);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 3ffc131530..b6c44cc3a1 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -160,10 +160,13 @@ _ecore_drm_output_edid_find(Ecore_Drm_Output *output, drmModeConnector *conn)
conn->prop_values[i]);
}
drmModeFreeProperty(prop);
+ if (blob) break;
}
if (!blob) return;
+ output->edid_blob = (char *)eina_memdup(blob->data, blob->length, 1);
+
ret = _ecore_drm_output_edid_parse(output, blob->data, blob->length);
if (!ret)
{
@@ -1125,3 +1128,12 @@ ecore_drm_output_backlight_get(Ecore_Drm_Output *output)
EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
return (output->backlight != NULL);
}
+
+EAPI char *
+ecore_drm_output_edid_get(Ecore_Drm_Output *output)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(output->edid_blob, NULL);
+
+ return strdup(output->edid_blob);
+}
diff --git a/src/lib/ecore_drm/ecore_drm_private.h b/src/lib/ecore_drm/ecore_drm_private.h
index 9339a2ac5b..3bacef2334 100644
--- a/src/lib/ecore_drm/ecore_drm_private.h
+++ b/src/lib/ecore_drm/ecore_drm_private.h
@@ -131,6 +131,8 @@ struct _Ecore_Drm_Output
Ecore_Drm_Output_Mode *current_mode;
Eina_List *modes;
+ char *edid_blob;
+
struct
{
char eisa[13];