summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
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 /src/lib/ecore_drm
parent130ad6d60fa7e67c50db7aeffa3fab37b92de404 (diff)
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>
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.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);
824 */ 824 */
825EAPI Eina_Bool ecore_drm_output_backlight_get(Ecore_Drm_Output *output); 825EAPI Eina_Bool ecore_drm_output_backlight_get(Ecore_Drm_Output *output);
826 826
827/**
828 * Get the edid of a given output
829 *
830 * @param output The Ecore_Drm_Output to get the backlight of
831 *
832 * @return A string representing the edid
833 *
834 * @ingroup Ecore_Drm_Output_Group
835 * @since 1.15
836 */
837EAPI char *ecore_drm_output_edid_get(Ecore_Drm_Output *output);
838
827#ifdef __cplusplus 839#ifdef __cplusplus
828} 840}
829#endif 841#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)
160 conn->prop_values[i]); 160 conn->prop_values[i]);
161 } 161 }
162 drmModeFreeProperty(prop); 162 drmModeFreeProperty(prop);
163 if (blob) break;
163 } 164 }
164 165
165 if (!blob) return; 166 if (!blob) return;
166 167
168 output->edid_blob = (char *)eina_memdup(blob->data, blob->length, 1);
169
167 ret = _ecore_drm_output_edid_parse(output, blob->data, blob->length); 170 ret = _ecore_drm_output_edid_parse(output, blob->data, blob->length);
168 if (!ret) 171 if (!ret)
169 { 172 {
@@ -1125,3 +1128,12 @@ ecore_drm_output_backlight_get(Ecore_Drm_Output *output)
1125 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); 1128 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
1126 return (output->backlight != NULL); 1129 return (output->backlight != NULL);
1127} 1130}
1131
1132EAPI char *
1133ecore_drm_output_edid_get(Ecore_Drm_Output *output)
1134{
1135 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
1136 EINA_SAFETY_ON_NULL_RETURN_VAL(output->edid_blob, NULL);
1137
1138 return strdup(output->edid_blob);
1139}
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
131 Ecore_Drm_Output_Mode *current_mode; 131 Ecore_Drm_Output_Mode *current_mode;
132 Eina_List *modes; 132 Eina_List *modes;
133 133
134 char *edid_blob;
135
134 struct 136 struct
135 { 137 {
136 char eisa[13]; 138 char eisa[13];