summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:11:41 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-05 09:11:41 -0400
commit7c2e5a0c3ebdca4f0326ef4102790a37630cf798 (patch)
tree69a970b7eecdf1ce545d765cc5df5df09a4fa21a /src
parentdebc4da8378a7e476132e153d944352e91d7ea3b (diff)
ecore-xcb: Add missing API function
ecore_x_randr_edid_manufacturer_name_get This patch adds an implementation inside ecore-xcb for missing API function ecore_x_randr_manufacturer_name_get @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.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index 499cd9f..0532cd2 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -1,7 +1,5 @@
1/* TODO: List of missing functions 1/* TODO: List of missing functions
2 * 2 *
3 * ecore_x_randr_edid_info_has_valid_checksum
4 * ecore_x_randr_edid_manufacturer_name_get
5 * ecore_x_randr_edid_display_ascii_get 3 * ecore_x_randr_edid_display_ascii_get
6 * ecore_x_randr_edid_display_serial_get 4 * ecore_x_randr_edid_display_serial_get
7 * ecore_x_randr_edid_model_get 5 * ecore_x_randr_edid_model_get
@@ -56,6 +54,7 @@
56#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE 3 54#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE 3
57#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT 5 55#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT 5
58#define _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX 13 56#define _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX 13
57#define _ECORE_X_RANDR_EDID_MANUFACTURER 0x08
59 58
60#define _ECORE_X_RANDR_EDID_FOR_EACH_DESCRIPTOR_BLOCK(edid, block) \ 59#define _ECORE_X_RANDR_EDID_FOR_EACH_DESCRIPTOR_BLOCK(edid, block) \
61 for (block = edid + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK; block <= (edid + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK + (3 * 18)); block += 18) 60 for (block = edid + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK; block <= (edid + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK + (3 * 18)); block += 18)
@@ -3025,6 +3024,34 @@ ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, unsigned long ed
3025#endif 3024#endif
3026} 3025}
3027 3026
3027EAPI char *
3028ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid, unsigned long edid_length)
3029{
3030 LOGFN(__FILE__, __LINE__, __FUNCTION__);
3031 CHECK_XCB_CONN;
3032
3033#ifdef ECORE_XCB_RANDR
3034 if ((edid_length > _ECORE_X_RANDR_EDID_MANUFACTURER + 1) &&
3035 (ecore_x_randr_edid_has_valid_header(edid, edid_length)))
3036 {
3037 unsigned char *x;
3038 char *name;
3039
3040 name = malloc(sizeof(char) * 4);
3041 if (!name) return NULL;
3042
3043 x = (edid + _ECORE_X_RANDR_EDID_MANUFACTURER);
3044 name[0] = ((x[0] & 0x7c) >> 2) + '@';
3045 name[1] = ((x[0] & 0x03) << 3) + ((x[1] & 0xe0) >> 5) + '@';
3046 name[2] = (x[1] & 0x1f) + '@';
3047 name[3] = 0;
3048
3049 return name;
3050 }
3051#endif
3052 return NULL;
3053}
3054
3028/* local functions */ 3055/* local functions */
3029static Eina_Bool 3056static Eina_Bool
3030_ecore_xcb_randr_output_validate(Ecore_X_Window root, 3057_ecore_xcb_randr_output_validate(Ecore_X_Window root,