Ville Syrjälä | b0f4df3 | 2015-12-03 19:01:21 +0200 | [diff] [blame] | 1 | #define GAMMA(x) (((x) * 100) - 100) |
| 2 | |
| 3 | #define MANUFACTURER_ID(a, b, c) (a - '@') << 2 | (b - '@') >> 3, \ |
| 4 | (b - '@') << 5 | (c - '@') |
| 5 | |
| 6 | |
| 7 | #define ab(x, y) ((x) & 0xff), ((y) & 0xff), (((x) & 0xf00) >> 4) | (((y) & 0xf00) >> 8) |
| 8 | #define op(ho, hp, vo, vp) ((ho) & 0xff), ((hp) & 0xff), \ |
| 9 | (((vo) & 0xf) << 4) | ((vp) & 0xf), \ |
| 10 | (((ho) & 0x300) >> 2) | (((hp) & 0x300) >> 4) \ |
| 11 | | (((vo) & 0x30) >> 2) | ((vp) & 0x30 >> 4) |
| 12 | |
| 13 | static unsigned char EDID_NAME[EDID_LENGTH] = { |
| 14 | 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, /* header */ |
| 15 | MANUFACTURER_ID('I', 'G', 'T'), |
| 16 | /* product code, serial number, week and year of manufacture */ |
| 17 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 18 | 0x01, 0x03, /* edid version (1.3) */ |
| 19 | /* basic display parameters */ |
| 20 | /* digital display, maximum horizontal image size, maximum vertical |
| 21 | * image size, gamma, features: RGB 4:4:4, native pixel format and |
| 22 | * refresh rate in descriptor 1 */ |
| 23 | 0x80, HSIZE, VSIZE, GAMMA(2.20), 0x02, |
| 24 | /* chromaticity coordinates */ |
| 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 26 | /* established timings: 640x480 60Hz, 800x600 60Hz, 1024x768 60Hz */ |
| 27 | 0x21, 0x08, 0x00, |
| 28 | /* standard timings */ |
| 29 | 0xd1, 0xc0, /* 1920x1080 60Hz */ |
| 30 | 0x81, 0xc0, /* 1280x720 60Hz */ |
| 31 | 0x61, 0x40, /* 1024x768 60Hz */ |
| 32 | 0x45, 0x40, /* 800x600 60Hz */ |
| 33 | 0x31, 0x40, /* 640x480 60Hz */ |
| 34 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, |
| 35 | /* descriptor 1 (preferred timing) */ |
| 36 | (CLOCK / 10) & 0x00ff, ((CLOCK / 10) & 0xff00) >> 8, |
| 37 | ab(HACTIVE, HBLANK), ab(VACTIVE, VBLANK), |
| 38 | op(HOFFSET, HPULSE, VOFFSET, VPULSE), |
| 39 | ab(HSIZE * 10, VSIZE * 10), |
| 40 | 0x00, 0x00, 0x00, |
| 41 | /* descriptor 2 (monitor range limits) */ |
| 42 | 0x00, 0x00, 0x00, 0xfd, 0x00, |
| 43 | VFREQ - 1, VFREQ + 1, /* minimum, maximum vertical field rate */ |
| 44 | (CLOCK / (HACTIVE + HBLANK)) - 1, /* minimum horizontal line rate */ |
| 45 | (CLOCK / (HACTIVE + HBLANK)) + 1, /* maximum horizontal line rate */ |
| 46 | (CLOCK / 10000) + 1, /* maximum pixel clock rate */ |
| 47 | 0x00, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, |
| 48 | /* descriptor 3 (name descriptor) */ |
| 49 | 0x00, 0x00, 0x00, 0xfc, 0x00, 'I', 'G', 'T', 0x0a, |
| 50 | 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, |
| 51 | /* descriptor 4 */ |
| 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 54 | /* extensions, checksum */ |
| 55 | 0x00, 0x00 |
| 56 | }; |
| 57 | |
| 58 | #undef EDID_NAME |
| 59 | #undef VFREQ |
| 60 | #undef CLOCK |
| 61 | #undef HACTIVE |
| 62 | #undef HBLANK |
| 63 | #undef VACTIVE |
| 64 | #undef VBLANK |
| 65 | #undef HOFFSET |
| 66 | #undef HPULSE |
| 67 | #undef VOFFSET |
| 68 | #undef VPULSE |
| 69 | #undef HSIZE |
| 70 | #undef VSIZE |
| 71 | #undef GAMMA |
| 72 | #undef MANUFACTURER_ID |
| 73 | #undef ab |
| 74 | #undef op |