summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-12 11:56:52 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-12 12:07:31 -0400
commitdf28c380d301e805ece38f54310d4b2992eedfbd (patch)
tree6902634903f3f1c96947f9418739999203eae92c /src/lib/ecore_drm
parent956eb9318beeec16396e7daf94ce88935db3a901 (diff)
ecore-drm: Fix ecore_drm_output_edid_get to return a hex string
Summary: As we will use the edid string inside RandR code to store unique information about an output, we should be returning this edid in a "readable" form. @fix 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_output.c21
-rw-r--r--src/lib/ecore_drm/ecore_drm_private.h2
2 files changed, 20 insertions, 3 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 0d4ace305c..9b571d0ad6 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -165,7 +165,7 @@ _ecore_drm_output_edid_find(Ecore_Drm_Output *output, drmModeConnector *conn)
165 165
166 if (!blob) return; 166 if (!blob) return;
167 167
168 output->edid_blob = (char *)eina_memdup(blob->data, blob->length, 1); 168 output->edid_blob = eina_memdup(blob->data, blob->length, 1);
169 169
170 ret = _ecore_drm_output_edid_parse(output, blob->data, blob->length); 170 ret = _ecore_drm_output_edid_parse(output, blob->data, blob->length);
171 if (!ret) 171 if (!ret)
@@ -1235,10 +1235,27 @@ ecore_drm_output_backlight_get(Ecore_Drm_Output *output)
1235EAPI char * 1235EAPI char *
1236ecore_drm_output_edid_get(Ecore_Drm_Output *output) 1236ecore_drm_output_edid_get(Ecore_Drm_Output *output)
1237{ 1237{
1238 char *edid_str = NULL;
1239
1238 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL); 1240 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
1239 EINA_SAFETY_ON_NULL_RETURN_VAL(output->edid_blob, NULL); 1241 EINA_SAFETY_ON_NULL_RETURN_VAL(output->edid_blob, NULL);
1240 1242
1241 return strdup(output->edid_blob); 1243 edid_str = malloc((128 * 2) + 1);
1244 if (edid_str)
1245 {
1246 unsigned int k, kk;
1247 const char *hexch = "0123456789abcdef";
1248
1249 for (kk = 0, k = 0; k < 128; k++)
1250 {
1251 edid_str[kk] = hexch[(output->edid_blob[k] >> 4) & 0xf];
1252 edid_str[kk + 1] = hexch[output->edid_blob[k] & 0xf];
1253 kk += 2;
1254 }
1255 edid_str[kk] = 0;
1256 }
1257
1258 return edid_str;
1242} 1259}
1243 1260
1244EAPI Eina_List * 1261EAPI Eina_List *
diff --git a/src/lib/ecore_drm/ecore_drm_private.h b/src/lib/ecore_drm/ecore_drm_private.h
index 063ac06632..fc32801f02 100644
--- a/src/lib/ecore_drm/ecore_drm_private.h
+++ b/src/lib/ecore_drm/ecore_drm_private.h
@@ -123,7 +123,7 @@ struct _Ecore_Drm_Output
123 Ecore_Drm_Output_Mode *current_mode; 123 Ecore_Drm_Output_Mode *current_mode;
124 Eina_List *modes; 124 Eina_List *modes;
125 125
126 char *edid_blob; 126 unsigned char *edid_blob;
127 127
128 struct 128 struct
129 { 129 {