Codebase list edid-decode / eee377b
edid-decode: add support for QuantumData 980 EDID file format QuantumData 980 uses an XML format for storing EDIDs. Add support for those. Signed-off-by: Hans Verkuil <hansverk@cisco.com> Hans Verkuil 5 years ago
1 changed file(s) with 27 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
25042504 return out;
25052505 }
25062506
2507 start = strstr(ret, "<BLOCK");
2508 if (start) {
2509 /* Parse QuantumData 980 EDID files */
2510 do {
2511 start = strstr(start, ">");
2512 if (start)
2513 out = realloc(out, out_index + 128);
2514 if (!start || !out) {
2515 free(ret);
2516 free(out);
2517 return NULL;
2518 }
2519 start++;
2520 for (i = 0; i < 256; i += 2) {
2521 char buf[3];
2522
2523 buf[0] = start[i];
2524 buf[1] = start[i + 1];
2525 buf[2] = 0;
2526 out[out_index++] = strtol(buf, NULL, 16);
2527 }
2528 start = strstr(start, "<BLOCK");
2529 } while (start);
2530 edid_lines = out_index >> 4;
2531 return out;
2532 }
2533
25072534 /* Is the EDID provided in hex? */
25082535 for (i = 0; i < 32 && (isspace(ret[i]) || ret[i] == ',' ||
25092536 tolower(ret[i]) == 'x' || isxdigit(ret[i])); i++);