diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c index d434f2f..5bda332 100644 --- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c +++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c | |||
@@ -23,6 +23,10 @@ | |||
23 | /* Heavily modified by: Leif Middelschulte <leif.middelschulte@gmail.com> */ | 23 | /* Heavily modified by: Leif Middelschulte <leif.middelschulte@gmail.com> */ |
24 | 24 | ||
25 | #include "Ecore_X.h" | 25 | #include "Ecore_X.h" |
26 | #include <stdio.h> | ||
27 | #include <stdlib.h> | ||
28 | #include <unistd.h> | ||
29 | #include <string.h> | ||
26 | 30 | ||
27 | /* TODO: | 31 | /* TODO: |
28 | * - see other TODO's within this file. | 32 | * - see other TODO's within this file. |
@@ -100,7 +104,7 @@ typedef enum _Ecore_X_Randr_Edid_Aspect_Ratio_Preferred { | |||
100 | 104 | ||
101 | EAPI Eina_Bool | 105 | EAPI Eina_Bool |
102 | ecore_x_randr_edid_has_valid_header(unsigned char *edid, | 106 | ecore_x_randr_edid_has_valid_header(unsigned char *edid, |
103 | unsigned long edid_length) | 107 | unsigned long edid_length) |
104 | { | 108 | { |
105 | const unsigned char header[] = | 109 | const unsigned char header[] = |
106 | { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 }; | 110 | { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 }; |
@@ -112,7 +116,7 @@ ecore_x_randr_edid_has_valid_header(unsigned char *edid, | |||
112 | 116 | ||
113 | EAPI int | 117 | EAPI int |
114 | ecore_x_randr_edid_version_get(unsigned char *edid, | 118 | ecore_x_randr_edid_version_get(unsigned char *edid, |
115 | unsigned long edid_length) | 119 | unsigned long edid_length) |
116 | { | 120 | { |
117 | if ((edid_length > _ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR) && | 121 | if ((edid_length > _ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR) && |
118 | (ecore_x_randr_edid_has_valid_header(edid, edid_length))) | 122 | (ecore_x_randr_edid_has_valid_header(edid, edid_length))) |
@@ -123,7 +127,7 @@ ecore_x_randr_edid_version_get(unsigned char *edid, | |||
123 | 127 | ||
124 | EAPI int | 128 | EAPI int |
125 | ecore_x_randr_edid_manufacturer_model_get(unsigned char *edid, | 129 | ecore_x_randr_edid_manufacturer_model_get(unsigned char *edid, |
126 | unsigned long edid_length) | 130 | unsigned long edid_length) |
127 | { | 131 | { |
128 | if ((edid_length > 0x0b) && | 132 | if ((edid_length > 0x0b) && |
129 | (ecore_x_randr_edid_has_valid_header(edid, edid_length))) | 133 | (ecore_x_randr_edid_has_valid_header(edid, edid_length))) |
@@ -133,7 +137,7 @@ ecore_x_randr_edid_manufacturer_model_get(unsigned char *edid, | |||
133 | 137 | ||
134 | EAPI int | 138 | EAPI int |
135 | ecore_x_randr_edid_manufacturer_serial_number_get(unsigned char *edid, | 139 | ecore_x_randr_edid_manufacturer_serial_number_get(unsigned char *edid, |
136 | unsigned long edid_length) | 140 | unsigned long edid_length) |
137 | { | 141 | { |
138 | if ((edid_length > 0x0f) && | 142 | if ((edid_length > 0x0f) && |
139 | (ecore_x_randr_edid_has_valid_header(edid, edid_length))) | 143 | (ecore_x_randr_edid_has_valid_header(edid, edid_length))) |
@@ -144,7 +148,7 @@ ecore_x_randr_edid_manufacturer_serial_number_get(unsigned char *edid, | |||
144 | 148 | ||
145 | EAPI char * | 149 | EAPI char * |
146 | ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid, | 150 | ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid, |
147 | unsigned long edid_length) | 151 | unsigned long edid_length) |
148 | { | 152 | { |
149 | if ((edid_length > (_ECORE_X_RANDR_EDID_OFFSET_MANUFACTURER + 1)) && | 153 | if ((edid_length > (_ECORE_X_RANDR_EDID_OFFSET_MANUFACTURER + 1)) && |
150 | (ecore_x_randr_edid_has_valid_header(edid, edid_length))) | 154 | (ecore_x_randr_edid_has_valid_header(edid, edid_length))) |
@@ -166,7 +170,7 @@ ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid, | |||
166 | 170 | ||
167 | EAPI char * | 171 | EAPI char * |
168 | ecore_x_randr_edid_display_name_get(unsigned char *edid, | 172 | ecore_x_randr_edid_display_name_get(unsigned char *edid, |
169 | unsigned long edid_length) | 173 | unsigned long edid_length) |
170 | { | 174 | { |
171 | unsigned char *block = NULL; | 175 | unsigned char *block = NULL; |
172 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 176 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
@@ -196,7 +200,7 @@ ecore_x_randr_edid_display_name_get(unsigned char *edid, | |||
196 | 200 | ||
197 | EAPI Ecore_X_Randr_Edid_Aspect_Ratio | 201 | EAPI Ecore_X_Randr_Edid_Aspect_Ratio |
198 | ecore_x_randr_edid_display_aspect_ratio_preferred_get(unsigned char *edid, | 202 | ecore_x_randr_edid_display_aspect_ratio_preferred_get(unsigned char *edid, |
199 | unsigned long edid_length) | 203 | unsigned long edid_length) |
200 | { | 204 | { |
201 | unsigned char *block = NULL; | 205 | unsigned char *block = NULL; |
202 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 206 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
@@ -238,7 +242,7 @@ ecore_x_randr_edid_display_aspect_ratio_preferred_get(unsigned char *edid, | |||
238 | 242 | ||
239 | EAPI Ecore_X_Randr_Edid_Aspect_Ratio | 243 | EAPI Ecore_X_Randr_Edid_Aspect_Ratio |
240 | ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid, | 244 | ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid, |
241 | unsigned long edid_length) | 245 | unsigned long edid_length) |
242 | { | 246 | { |
243 | Ecore_X_Randr_Edid_Aspect_Ratio ret = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; | 247 | Ecore_X_Randr_Edid_Aspect_Ratio ret = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; |
244 | unsigned char *block = NULL; | 248 | unsigned char *block = NULL; |
@@ -267,7 +271,7 @@ ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid, | |||
267 | 271 | ||
268 | EAPI char * | 272 | EAPI char * |
269 | ecore_x_randr_edid_display_ascii_get(unsigned char *edid, | 273 | ecore_x_randr_edid_display_ascii_get(unsigned char *edid, |
270 | unsigned long edid_length) | 274 | unsigned long edid_length) |
271 | { | 275 | { |
272 | unsigned char *block = NULL; | 276 | unsigned char *block = NULL; |
273 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 277 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
@@ -300,7 +304,7 @@ ecore_x_randr_edid_display_ascii_get(unsigned char *edid, | |||
300 | 304 | ||
301 | EAPI char * | 305 | EAPI char * |
302 | ecore_x_randr_edid_display_serial_get(unsigned char *edid, | 306 | ecore_x_randr_edid_display_serial_get(unsigned char *edid, |
303 | unsigned long edid_length) | 307 | unsigned long edid_length) |
304 | { | 308 | { |
305 | unsigned char *block = NULL; | 309 | unsigned char *block = NULL; |
306 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 310 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
@@ -333,7 +337,7 @@ ecore_x_randr_edid_display_serial_get(unsigned char *edid, | |||
333 | 337 | ||
334 | EAPI Eina_Bool | 338 | EAPI Eina_Bool |
335 | ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, | 339 | ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, |
336 | unsigned long edid_length) | 340 | unsigned long edid_length) |
337 | { | 341 | { |
338 | unsigned char *cea_block_iter = NULL; | 342 | unsigned char *cea_block_iter = NULL; |
339 | char sum = 0; | 343 | char sum = 0; |
@@ -344,13 +348,15 @@ ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, | |||
344 | if (edid_length < 128) return EINA_FALSE; | 348 | if (edid_length < 128) return EINA_FALSE; |
345 | 349 | ||
346 | /* Check the EDID block itself */ | 350 | /* Check the EDID block itself */ |
347 | for (i = 0; i < 128; i++) sum += edid[i]; | 351 | for (i = 0; i < 128; i++) |
352 | sum += edid[i]; | ||
348 | if (sum) return EINA_FALSE; | 353 | if (sum) return EINA_FALSE; |
349 | 354 | ||
350 | /* Check the cea extension blocks */ | 355 | /* Check the cea extension blocks */ |
351 | _ECORE_X_RANDR_EDID_FOR_EACH_CEA_BLOCK(edid, edid_length, cea_block_iter) | 356 | _ECORE_X_RANDR_EDID_FOR_EACH_CEA_BLOCK(edid, edid_length, cea_block_iter) |
352 | { | 357 | { |
353 | for (i = 0, sum = 0; i < 128; i++) sum += cea_block_iter[i]; | 358 | for (i = 0, sum = 0; i < 128; i++) |
359 | sum += cea_block_iter[i]; | ||
354 | } | 360 | } |
355 | if (sum) return EINA_FALSE; | 361 | if (sum) return EINA_FALSE; |
356 | return EINA_TRUE; | 362 | return EINA_TRUE; |
@@ -358,7 +364,7 @@ ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, | |||
358 | 364 | ||
359 | EAPI Eina_Bool | 365 | EAPI Eina_Bool |
360 | ecore_x_randr_edid_dpms_available_get(unsigned char *edid, | 366 | ecore_x_randr_edid_dpms_available_get(unsigned char *edid, |
361 | unsigned long edid_length) | 367 | unsigned long edid_length) |
362 | { | 368 | { |
363 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 369 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
364 | 370 | ||
@@ -369,7 +375,7 @@ ecore_x_randr_edid_dpms_available_get(unsigned char *edid, | |||
369 | 375 | ||
370 | EAPI Eina_Bool | 376 | EAPI Eina_Bool |
371 | ecore_x_randr_edid_dpms_standby_available_get(unsigned char *edid, | 377 | ecore_x_randr_edid_dpms_standby_available_get(unsigned char *edid, |
372 | unsigned long edid_length) | 378 | unsigned long edid_length) |
373 | { | 379 | { |
374 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 380 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
375 | 381 | ||
@@ -382,7 +388,7 @@ ecore_x_randr_edid_dpms_standby_available_get(unsigned char *edid, | |||
382 | 388 | ||
383 | EAPI Eina_Bool | 389 | EAPI Eina_Bool |
384 | ecore_x_randr_edid_dpms_suspend_available_get(unsigned char *edid, | 390 | ecore_x_randr_edid_dpms_suspend_available_get(unsigned char *edid, |
385 | unsigned long edid_length) | 391 | unsigned long edid_length) |
386 | { | 392 | { |
387 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 393 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
388 | 394 | ||
@@ -395,7 +401,7 @@ ecore_x_randr_edid_dpms_suspend_available_get(unsigned char *edid, | |||
395 | 401 | ||
396 | EAPI Eina_Bool | 402 | EAPI Eina_Bool |
397 | ecore_x_randr_edid_dpms_off_available_get(unsigned char *edid, | 403 | ecore_x_randr_edid_dpms_off_available_get(unsigned char *edid, |
398 | unsigned long edid_length) | 404 | unsigned long edid_length) |
399 | { | 405 | { |
400 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 406 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
401 | 407 | ||
@@ -408,7 +414,7 @@ ecore_x_randr_edid_dpms_off_available_get(unsigned char *edid, | |||
408 | 414 | ||
409 | EAPI Eina_Bool | 415 | EAPI Eina_Bool |
410 | ecore_x_randr_edid_display_type_digital_get(unsigned char *edid, | 416 | ecore_x_randr_edid_display_type_digital_get(unsigned char *edid, |
411 | unsigned long edid_length) | 417 | unsigned long edid_length) |
412 | { | 418 | { |
413 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 419 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
414 | 420 | ||
@@ -419,7 +425,7 @@ ecore_x_randr_edid_display_type_digital_get(unsigned char *edid, | |||
419 | 425 | ||
420 | EAPI Ecore_X_Randr_Edid_Display_Colorscheme | 426 | EAPI Ecore_X_Randr_Edid_Display_Colorscheme |
421 | ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid, | 427 | ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid, |
422 | unsigned long edid_length) | 428 | unsigned long edid_length) |
423 | { | 429 | { |
424 | Ecore_X_Randr_Edid_Display_Colorscheme colorscheme = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; | 430 | Ecore_X_Randr_Edid_Display_Colorscheme colorscheme = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; |
425 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 431 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |
@@ -442,7 +448,7 @@ ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid, | |||
442 | 448 | ||
443 | EAPI Ecore_X_Randr_Edid_Display_Interface_Type | 449 | EAPI Ecore_X_Randr_Edid_Display_Interface_Type |
444 | ecore_x_randr_edid_display_interface_type_get(unsigned char *edid, | 450 | ecore_x_randr_edid_display_interface_type_get(unsigned char *edid, |
445 | unsigned long edid_length) | 451 | unsigned long edid_length) |
446 | { | 452 | { |
447 | Ecore_X_Randr_Edid_Display_Interface_Type type = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; | 453 | Ecore_X_Randr_Edid_Display_Interface_Type type = ECORE_X_RANDR_EDID_UNKNOWN_VALUE; |
448 | int version = ecore_x_randr_edid_version_get(edid, edid_length); | 454 | int version = ecore_x_randr_edid_version_get(edid, edid_length); |