summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:06:06 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:06:06 -0400
commitdebc4da8378a7e476132e153d944352e91d7ea3b (patch)
tree7343da0a193cac34c66c1a62e49882e184265e1f /src
parentb89d2190930cdf0b7d4585c0ee8a56fcccf2a3da (diff)
ecore-xcb: Add missing API function ecore_x_randr_edid_info_has_valid_checksum
This patch adds an implementation for ecore_x_randr_edid_info_has_valid_checksum which was missing in the ecore-xcb codebase. @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.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index 1967b9c..499cd9f 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -1,6 +1,5 @@
1/* TODO: List of missing functions 1/* TODO: List of missing functions
2 * 2 *
3 * ecore_x_randr_edid_version_get
4 * ecore_x_randr_edid_info_has_valid_checksum 3 * ecore_x_randr_edid_info_has_valid_checksum
5 * ecore_x_randr_edid_manufacturer_name_get 4 * ecore_x_randr_edid_manufacturer_name_get
6 * ecore_x_randr_edid_display_ascii_get 5 * ecore_x_randr_edid_display_ascii_get
@@ -2989,6 +2988,43 @@ ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long edid_leng
2989 return EINA_FALSE; 2988 return EINA_FALSE;
2990} 2989}
2991 2990
2991EAPI Eina_Bool
2992ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, unsigned long edid_length)
2993{
2994 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2995 CHECK_XCB_CONN;
2996
2997#ifdef ECORE_XCB_RANDR
2998 unsigned char *iter = NULL;
2999 char sum = 0;
3000 int i = 0, version = 0;
3001
3002 if (edid_length < 128) return EINA_FALSE;
3003
3004 version = ecore_x_randr_edid_version_get(edid, edid_length);
3005 if (version < RANDR_EDID_VERSION_13) return EINA_FALSE;
3006
3007 for (i = 0; i < 128; i++)
3008 sum += edid[i];
3009
3010 if (sum) return EINA_FALSE;
3011
3012 for (iter = edid; iter < (edid + edid_length); iter += 128)
3013 {
3014 if (iter[0] == 0x02)
3015 {
3016 for (i = 0, sum = 0; i < 128; i++)
3017 sum += iter[i];
3018 }
3019 }
3020
3021 if (sum) return EINA_FALSE;
3022 return EINA_TRUE;
3023#else
3024 return EINA_FALSE;
3025#endif
3026}
3027
2992/* local functions */ 3028/* local functions */
2993static Eina_Bool 3029static Eina_Bool
2994_ecore_xcb_randr_output_validate(Ecore_X_Window root, 3030_ecore_xcb_randr_output_validate(Ecore_X_Window root,