devilhorns pushed a commit to branch master.

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

commit debc4da8378a7e476132e153d944352e91d7ea3b
Author: Chris Michael <cpmich...@osg.samsung.com>
Date:   Tue Apr 5 09:06:06 2016 -0400

    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 <cpmich...@osg.samsung.com>
---
 src/lib/ecore_x/xcb/ecore_xcb_randr.c | 38 ++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

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 @@
 /* TODO: List of missing functions
  *
- * ecore_x_randr_edid_version_get
  * ecore_x_randr_edid_info_has_valid_checksum
  * ecore_x_randr_edid_manufacturer_name_get
  * 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
    return EINA_FALSE;
 }
 
+EAPI Eina_Bool
+ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, unsigned long 
edid_length)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
+
+#ifdef ECORE_XCB_RANDR
+   unsigned char *iter = NULL;
+   char sum = 0;
+   int i = 0, version = 0;
+
+   if (edid_length < 128) return EINA_FALSE;
+
+   version = ecore_x_randr_edid_version_get(edid, edid_length);
+   if (version < RANDR_EDID_VERSION_13) return EINA_FALSE;
+
+   for (i = 0; i < 128; i++)
+     sum += edid[i];
+
+   if (sum) return EINA_FALSE;
+
+   for (iter = edid; iter < (edid + edid_length); iter += 128)
+     {
+        if (iter[0] == 0x02)
+          {
+             for (i = 0, sum = 0; i < 128; i++)
+               sum += iter[i];
+          }
+     }
+
+   if (sum) return EINA_FALSE;
+   return EINA_TRUE;
+#else
+   return EINA_FALSE;
+#endif
+}
+
 /* local functions */
 static Eina_Bool
 _ecore_xcb_randr_output_validate(Ecore_X_Window       root,

-- 


Reply via email to