aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:41:40 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:43:04 -0400
commit760fb0326cece1a3bc024a0c5db7c54119316bb5 (patch)
tree709c22a7c2e868a92782930b39c8961b23b5959a /src
parentecore-xcb: Add implementation for missing API function (diff)
downloadefl-760fb0326cece1a3bc024a0c5db7c54119316bb5.tar.gz
ecore-xcb: Add implementation for missing API function
This patch adds an xcb implementation for missing ecore_x_randr_edid_display_serial_get function @fix Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_randr.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index e7245005f7..8cef0eecbd 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -1,8 +1,5 @@
/* TODO: List of missing functions
*
- * ecore_x_randr_edid_display_ascii_get
- * ecore_x_randr_edid_display_serial_get
- * ecore_x_randr_edid_dpms_standby_available_get
* ecore_x_randr_edid_dpms_suspend_available_get
* ecore_x_randr_edid_dpms_off_available_get
* ecore_x_randr_edid_display_aspect_ratio_preferred_get
@@ -3002,6 +2999,38 @@ ecore_x_randr_edid_display_ascii_get(unsigned char *edid, unsigned long edid_len
return NULL;
}
+EAPI char *
+ecore_x_randr_edid_display_serial_get(unsigned char *edid, unsigned long edid_length)
+{
+#ifdef ECORE_XCB_RANDR
+ unsigned char *block = NULL;
+ int version = 0;
+
+ version = ecore_x_randr_edid_version_get(edid, edid_length);
+ if (version < ECORE_X_RANDR_EDID_VERSION_13) return NULL;
+
+ _ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block)
+ {
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xff)
+ {
+ char *serial = NULL, *p = NULL;
+ const char *edid_serial;
+
+ edid_serial = (const char *)block + 5;
+
+ if (!(serial = malloc(14))) return NULL;
+ strncpy(serial, edid_serial, 13);
+ serial[13] = 0;
+ for (p = serial; *p; p++)
+ if ((*p < ' ') || (*p > '~')) *p = 0;
+
+ return serial;
+ }
+ }
+#endif
+ return NULL;
+}
+
EAPI Eina_Bool
ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long edid_length)
{