devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=34664306a99100cdcebcba9b163d2d28ee3d1350

commit 34664306a99100cdcebcba9b163d2d28ee3d1350
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon May 4 15:03:47 2015 -0400

    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.mich...@samsung.com>
---
 src/lib/ecore_drm/Ecore_Drm.h         | 12 ++++++++++++
 src/lib/ecore_drm/ecore_drm_output.c  | 12 ++++++++++++
 src/lib/ecore_drm/ecore_drm_private.h |  2 ++
 3 files changed, 26 insertions(+)

diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index d0a2c36..e2b79a0 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 3ffc131..b6c44cc 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 9339a2a..3bacef2 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];

-- 


Reply via email to