Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
drm_edid_modes.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2008 Intel Corporation
3  * Jesse Barnes <[email protected]>
4  * Copyright 2010 Red Hat, Inc.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sub license,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the
14  * next paragraph) shall be included in all copies or substantial portions
15  * of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23  * DEALINGS IN THE SOFTWARE.
24  */
25 
26 #include <linux/kernel.h>
27 #include <drm/drmP.h>
28 #include <drm/drm_edid.h>
29 
30 /*
31  * Autogenerated from the DMT spec.
32  * This table is copied from xfree86/modes/xf86EdidModes.c.
33  */
34 static const struct drm_display_mode drm_dmt_modes[] = {
35  /* 640x350@85Hz */
36  { DRM_MODE("640x350", DRM_MODE_TYPE_DRIVER, 31500, 640, 672,
37  736, 832, 0, 350, 382, 385, 445, 0,
39  /* 640x400@85Hz */
40  { DRM_MODE("640x400", DRM_MODE_TYPE_DRIVER, 31500, 640, 672,
41  736, 832, 0, 400, 401, 404, 445, 0,
43  /* 720x400@85Hz */
44  { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 35500, 720, 756,
45  828, 936, 0, 400, 401, 404, 446, 0,
47  /* 640x480@60Hz */
48  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656,
49  752, 800, 0, 480, 489, 492, 525, 0,
51  /* 640x480@72Hz */
52  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 664,
53  704, 832, 0, 480, 489, 492, 520, 0,
55  /* 640x480@75Hz */
56  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 656,
57  720, 840, 0, 480, 481, 484, 500, 0,
59  /* 640x480@85Hz */
60  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 36000, 640, 696,
61  752, 832, 0, 480, 481, 484, 509, 0,
63  /* 800x600@56Hz */
64  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 36000, 800, 824,
65  896, 1024, 0, 600, 601, 603, 625, 0,
67  /* 800x600@60Hz */
68  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 40000, 800, 840,
69  968, 1056, 0, 600, 601, 605, 628, 0,
71  /* 800x600@72Hz */
72  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 50000, 800, 856,
73  976, 1040, 0, 600, 637, 643, 666, 0,
75  /* 800x600@75Hz */
76  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 49500, 800, 816,
77  896, 1056, 0, 600, 601, 604, 625, 0,
79  /* 800x600@85Hz */
80  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 56250, 800, 832,
81  896, 1048, 0, 600, 601, 604, 631, 0,
83  /* 800x600@120Hz RB */
84  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 73250, 800, 848,
85  880, 960, 0, 600, 603, 607, 636, 0,
87  /* 848x480@60Hz */
88  { DRM_MODE("848x480", DRM_MODE_TYPE_DRIVER, 33750, 848, 864,
89  976, 1088, 0, 480, 486, 494, 517, 0,
91  /* 1024x768@43Hz, interlace */
92  { DRM_MODE("1024x768i", DRM_MODE_TYPE_DRIVER, 44900, 1024, 1032,
93  1208, 1264, 0, 768, 768, 772, 817, 0,
96  /* 1024x768@60Hz */
97  { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 65000, 1024, 1048,
98  1184, 1344, 0, 768, 771, 777, 806, 0,
100  /* 1024x768@70Hz */
101  { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 75000, 1024, 1048,
102  1184, 1328, 0, 768, 771, 777, 806, 0,
104  /* 1024x768@75Hz */
105  { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 78750, 1024, 1040,
106  1136, 1312, 0, 768, 769, 772, 800, 0,
108  /* 1024x768@85Hz */
109  { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 94500, 1024, 1072,
110  1168, 1376, 0, 768, 769, 772, 808, 0,
112  /* 1024x768@120Hz RB */
113  { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 115500, 1024, 1072,
114  1104, 1184, 0, 768, 771, 775, 813, 0,
116  /* 1152x864@75Hz */
117  { DRM_MODE("1152x864", DRM_MODE_TYPE_DRIVER, 108000, 1152, 1216,
118  1344, 1600, 0, 864, 865, 868, 900, 0,
120  /* 1280x768@60Hz RB */
121  { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 68250, 1280, 1328,
122  1360, 1440, 0, 768, 771, 778, 790, 0,
124  /* 1280x768@60Hz */
125  { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 79500, 1280, 1344,
126  1472, 1664, 0, 768, 771, 778, 798, 0,
128  /* 1280x768@75Hz */
129  { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 102250, 1280, 1360,
130  1488, 1696, 0, 768, 771, 778, 805, 0,
132  /* 1280x768@85Hz */
133  { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 117500, 1280, 1360,
134  1496, 1712, 0, 768, 771, 778, 809, 0,
136  /* 1280x768@120Hz RB */
137  { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 140250, 1280, 1328,
138  1360, 1440, 0, 768, 771, 778, 813, 0,
140  /* 1280x800@60Hz RB */
141  { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 71000, 1280, 1328,
142  1360, 1440, 0, 800, 803, 809, 823, 0,
144  /* 1280x800@60Hz */
145  { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 83500, 1280, 1352,
146  1480, 1680, 0, 800, 803, 809, 831, 0,
148  /* 1280x800@75Hz */
149  { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 106500, 1280, 1360,
150  1488, 1696, 0, 800, 803, 809, 838, 0,
152  /* 1280x800@85Hz */
153  { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 122500, 1280, 1360,
154  1496, 1712, 0, 800, 803, 809, 843, 0,
156  /* 1280x800@120Hz RB */
157  { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 146250, 1280, 1328,
158  1360, 1440, 0, 800, 803, 809, 847, 0,
160  /* 1280x960@60Hz */
161  { DRM_MODE("1280x960", DRM_MODE_TYPE_DRIVER, 108000, 1280, 1376,
162  1488, 1800, 0, 960, 961, 964, 1000, 0,
164  /* 1280x960@85Hz */
165  { DRM_MODE("1280x960", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1344,
166  1504, 1728, 0, 960, 961, 964, 1011, 0,
168  /* 1280x960@120Hz RB */
169  { DRM_MODE("1280x960", DRM_MODE_TYPE_DRIVER, 175500, 1280, 1328,
170  1360, 1440, 0, 960, 963, 967, 1017, 0,
172  /* 1280x1024@60Hz */
173  { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 108000, 1280, 1328,
174  1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
176  /* 1280x1024@75Hz */
177  { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 135000, 1280, 1296,
178  1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
180  /* 1280x1024@85Hz */
181  { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 157500, 1280, 1344,
182  1504, 1728, 0, 1024, 1025, 1028, 1072, 0,
184  /* 1280x1024@120Hz RB */
185  { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 187250, 1280, 1328,
186  1360, 1440, 0, 1024, 1027, 1034, 1084, 0,
188  /* 1360x768@60Hz */
189  { DRM_MODE("1360x768", DRM_MODE_TYPE_DRIVER, 85500, 1360, 1424,
190  1536, 1792, 0, 768, 771, 777, 795, 0,
192  /* 1360x768@120Hz RB */
193  { DRM_MODE("1360x768", DRM_MODE_TYPE_DRIVER, 148250, 1360, 1408,
194  1440, 1520, 0, 768, 771, 776, 813, 0,
196  /* 1400x1050@60Hz RB */
197  { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 101000, 1400, 1448,
198  1480, 1560, 0, 1050, 1053, 1057, 1080, 0,
200  /* 1400x1050@60Hz */
201  { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 121750, 1400, 1488,
202  1632, 1864, 0, 1050, 1053, 1057, 1089, 0,
204  /* 1400x1050@75Hz */
205  { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 156000, 1400, 1504,
206  1648, 1896, 0, 1050, 1053, 1057, 1099, 0,
208  /* 1400x1050@85Hz */
209  { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 179500, 1400, 1504,
210  1656, 1912, 0, 1050, 1053, 1057, 1105, 0,
212  /* 1400x1050@120Hz RB */
213  { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 208000, 1400, 1448,
214  1480, 1560, 0, 1050, 1053, 1057, 1112, 0,
216  /* 1440x900@60Hz RB */
217  { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 88750, 1440, 1488,
218  1520, 1600, 0, 900, 903, 909, 926, 0,
220  /* 1440x900@60Hz */
221  { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 106500, 1440, 1520,
222  1672, 1904, 0, 900, 903, 909, 934, 0,
224  /* 1440x900@75Hz */
225  { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 136750, 1440, 1536,
226  1688, 1936, 0, 900, 903, 909, 942, 0,
228  /* 1440x900@85Hz */
229  { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 157000, 1440, 1544,
230  1696, 1952, 0, 900, 903, 909, 948, 0,
232  /* 1440x900@120Hz RB */
233  { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 182750, 1440, 1488,
234  1520, 1600, 0, 900, 903, 909, 953, 0,
236  /* 1600x1200@60Hz */
237  { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 162000, 1600, 1664,
238  1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
240  /* 1600x1200@65Hz */
241  { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 175500, 1600, 1664,
242  1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
244  /* 1600x1200@70Hz */
245  { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 189000, 1600, 1664,
246  1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
248  /* 1600x1200@75Hz */
249  { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 202500, 1600, 1664,
250  1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
252  /* 1600x1200@85Hz */
253  { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 229500, 1600, 1664,
254  1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
256  /* 1600x1200@120Hz RB */
257  { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 268250, 1600, 1648,
258  1680, 1760, 0, 1200, 1203, 1207, 1271, 0,
260  /* 1680x1050@60Hz RB */
261  { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 119000, 1680, 1728,
262  1760, 1840, 0, 1050, 1053, 1059, 1080, 0,
264  /* 1680x1050@60Hz */
265  { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 146250, 1680, 1784,
266  1960, 2240, 0, 1050, 1053, 1059, 1089, 0,
268  /* 1680x1050@75Hz */
269  { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 187000, 1680, 1800,
270  1976, 2272, 0, 1050, 1053, 1059, 1099, 0,
272  /* 1680x1050@85Hz */
273  { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 214750, 1680, 1808,
274  1984, 2288, 0, 1050, 1053, 1059, 1105, 0,
276  /* 1680x1050@120Hz RB */
277  { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 245500, 1680, 1728,
278  1760, 1840, 0, 1050, 1053, 1059, 1112, 0,
280  /* 1792x1344@60Hz */
281  { DRM_MODE("1792x1344", DRM_MODE_TYPE_DRIVER, 204750, 1792, 1920,
282  2120, 2448, 0, 1344, 1345, 1348, 1394, 0,
284  /* 1792x1344@75Hz */
285  { DRM_MODE("1792x1344", DRM_MODE_TYPE_DRIVER, 261000, 1792, 1888,
286  2104, 2456, 0, 1344, 1345, 1348, 1417, 0,
288  /* 1792x1344@120Hz RB */
289  { DRM_MODE("1792x1344", DRM_MODE_TYPE_DRIVER, 333250, 1792, 1840,
290  1872, 1952, 0, 1344, 1347, 1351, 1423, 0,
292  /* 1856x1392@60Hz */
293  { DRM_MODE("1856x1392", DRM_MODE_TYPE_DRIVER, 218250, 1856, 1952,
294  2176, 2528, 0, 1392, 1393, 1396, 1439, 0,
296  /* 1856x1392@75Hz */
297  { DRM_MODE("1856x1392", DRM_MODE_TYPE_DRIVER, 288000, 1856, 1984,
298  2208, 2560, 0, 1392, 1395, 1399, 1500, 0,
300  /* 1856x1392@120Hz RB */
301  { DRM_MODE("1856x1392", DRM_MODE_TYPE_DRIVER, 356500, 1856, 1904,
302  1936, 2016, 0, 1392, 1395, 1399, 1474, 0,
304  /* 1920x1200@60Hz RB */
305  { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 154000, 1920, 1968,
306  2000, 2080, 0, 1200, 1203, 1209, 1235, 0,
308  /* 1920x1200@60Hz */
309  { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 193250, 1920, 2056,
310  2256, 2592, 0, 1200, 1203, 1209, 1245, 0,
312  /* 1920x1200@75Hz */
313  { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 245250, 1920, 2056,
314  2264, 2608, 0, 1200, 1203, 1209, 1255, 0,
316  /* 1920x1200@85Hz */
317  { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 281250, 1920, 2064,
318  2272, 2624, 0, 1200, 1203, 1209, 1262, 0,
320  /* 1920x1200@120Hz RB */
321  { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 317000, 1920, 1968,
322  2000, 2080, 0, 1200, 1203, 1209, 1271, 0,
324  /* 1920x1440@60Hz */
325  { DRM_MODE("1920x1440", DRM_MODE_TYPE_DRIVER, 234000, 1920, 2048,
326  2256, 2600, 0, 1440, 1441, 1444, 1500, 0,
328  /* 1920x1440@75Hz */
329  { DRM_MODE("1920x1440", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2064,
330  2288, 2640, 0, 1440, 1441, 1444, 1500, 0,
332  /* 1920x1440@120Hz RB */
333  { DRM_MODE("1920x1440", DRM_MODE_TYPE_DRIVER, 380500, 1920, 1968,
334  2000, 2080, 0, 1440, 1443, 1447, 1525, 0,
336  /* 2560x1600@60Hz RB */
337  { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 268500, 2560, 2608,
338  2640, 2720, 0, 1600, 1603, 1609, 1646, 0,
340  /* 2560x1600@60Hz */
341  { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 348500, 2560, 2752,
342  3032, 3504, 0, 1600, 1603, 1609, 1658, 0,
344  /* 2560x1600@75HZ */
345  { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 443250, 2560, 2768,
346  3048, 3536, 0, 1600, 1603, 1609, 1672, 0,
348  /* 2560x1600@85HZ */
349  { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 505250, 2560, 2768,
350  3048, 3536, 0, 1600, 1603, 1609, 1682, 0,
352  /* 2560x1600@120Hz RB */
353  { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 552750, 2560, 2608,
354  2640, 2720, 0, 1600, 1603, 1609, 1694, 0,
356 
357 };
358 static const int drm_num_dmt_modes =
359  sizeof(drm_dmt_modes) / sizeof(struct drm_display_mode);
360 
361 static const struct drm_display_mode edid_est_modes[] = {
362  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 40000, 800, 840,
363  968, 1056, 0, 600, 601, 605, 628, 0,
364  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 800x600@60Hz */
365  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 36000, 800, 824,
366  896, 1024, 0, 600, 601, 603, 625, 0,
367  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 800x600@56Hz */
368  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 656,
369  720, 840, 0, 480, 481, 484, 500, 0,
370  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 640x480@75Hz */
371  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 664,
372  704, 832, 0, 480, 489, 491, 520, 0,
373  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 640x480@72Hz */
374  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 30240, 640, 704,
375  768, 864, 0, 480, 483, 486, 525, 0,
376  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 640x480@67Hz */
377  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25200, 640, 656,
378  752, 800, 0, 480, 490, 492, 525, 0,
379  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 640x480@60Hz */
380  { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 35500, 720, 738,
381  846, 900, 0, 400, 421, 423, 449, 0,
382  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 720x400@88Hz */
383  { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 28320, 720, 738,
384  846, 900, 0, 400, 412, 414, 449, 0,
385  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 720x400@70Hz */
386  { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 135000, 1280, 1296,
387  1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
388  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 1280x1024@75Hz */
389  { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 78800, 1024, 1040,
390  1136, 1312, 0, 768, 769, 772, 800, 0,
391  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 1024x768@75Hz */
392  { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 75000, 1024, 1048,
393  1184, 1328, 0, 768, 771, 777, 806, 0,
394  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 1024x768@70Hz */
395  { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 65000, 1024, 1048,
396  1184, 1344, 0, 768, 771, 777, 806, 0,
397  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 1024x768@60Hz */
398  { DRM_MODE("1024x768i", DRM_MODE_TYPE_DRIVER,44900, 1024, 1032,
399  1208, 1264, 0, 768, 768, 776, 817, 0,
401  { DRM_MODE("832x624", DRM_MODE_TYPE_DRIVER, 57284, 832, 864,
402  928, 1152, 0, 624, 625, 628, 667, 0,
403  DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) }, /* 832x624@75Hz */
404  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 49500, 800, 816,
405  896, 1056, 0, 600, 601, 604, 625, 0,
406  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 800x600@75Hz */
407  { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 50000, 800, 856,
408  976, 1040, 0, 600, 637, 643, 666, 0,
409  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 800x600@72Hz */
410  { DRM_MODE("1152x864", DRM_MODE_TYPE_DRIVER, 108000, 1152, 1216,
411  1344, 1600, 0, 864, 865, 868, 900, 0,
412  DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, /* 1152x864@75Hz */
413 };
414 
415 struct minimode {
416  short w;
417  short h;
418  short r;
419  short rb;
420 };
421 
422 static const struct minimode est3_modes[] = {
423  /* byte 6 */
424  { 640, 350, 85, 0 },
425  { 640, 400, 85, 0 },
426  { 720, 400, 85, 0 },
427  { 640, 480, 85, 0 },
428  { 848, 480, 60, 0 },
429  { 800, 600, 85, 0 },
430  { 1024, 768, 85, 0 },
431  { 1152, 864, 75, 0 },
432  /* byte 7 */
433  { 1280, 768, 60, 1 },
434  { 1280, 768, 60, 0 },
435  { 1280, 768, 75, 0 },
436  { 1280, 768, 85, 0 },
437  { 1280, 960, 60, 0 },
438  { 1280, 960, 85, 0 },
439  { 1280, 1024, 60, 0 },
440  { 1280, 1024, 85, 0 },
441  /* byte 8 */
442  { 1360, 768, 60, 0 },
443  { 1440, 900, 60, 1 },
444  { 1440, 900, 60, 0 },
445  { 1440, 900, 75, 0 },
446  { 1440, 900, 85, 0 },
447  { 1400, 1050, 60, 1 },
448  { 1400, 1050, 60, 0 },
449  { 1400, 1050, 75, 0 },
450  /* byte 9 */
451  { 1400, 1050, 85, 0 },
452  { 1680, 1050, 60, 1 },
453  { 1680, 1050, 60, 0 },
454  { 1680, 1050, 75, 0 },
455  { 1680, 1050, 85, 0 },
456  { 1600, 1200, 60, 0 },
457  { 1600, 1200, 65, 0 },
458  { 1600, 1200, 70, 0 },
459  /* byte 10 */
460  { 1600, 1200, 75, 0 },
461  { 1600, 1200, 85, 0 },
462  { 1792, 1344, 60, 0 },
463  { 1792, 1344, 85, 0 },
464  { 1856, 1392, 60, 0 },
465  { 1856, 1392, 75, 0 },
466  { 1920, 1200, 60, 1 },
467  { 1920, 1200, 60, 0 },
468  /* byte 11 */
469  { 1920, 1200, 75, 0 },
470  { 1920, 1200, 85, 0 },
471  { 1920, 1440, 60, 0 },
472  { 1920, 1440, 75, 0 },
473 };
474 static const int num_est3_modes = ARRAY_SIZE(est3_modes);
475 
476 static const struct minimode extra_modes[] = {
477  { 1024, 576, 60, 0 },
478  { 1366, 768, 60, 0 },
479  { 1600, 900, 60, 0 },
480  { 1680, 945, 60, 0 },
481  { 1920, 1080, 60, 0 },
482  { 2048, 1152, 60, 0 },
483  { 2048, 1536, 60, 0 },
484 };
485 static const int num_extra_modes = ARRAY_SIZE(extra_modes);
486 
487 /*
488  * Probably taken from CEA-861 spec.
489  * This table is converted from xorg's hw/xfree86/modes/xf86EdidModes.c.
490  */
491 static const struct drm_display_mode edid_cea_modes[] = {
492  /* 1 - 640x480@60Hz */
493  { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656,
494  752, 800, 0, 480, 490, 492, 525, 0,
496  /* 2 - 720x480@60Hz */
497  { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 27000, 720, 736,
498  798, 858, 0, 480, 489, 495, 525, 0,
500  /* 3 - 720x480@60Hz */
501  { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 27000, 720, 736,
502  798, 858, 0, 480, 489, 495, 525, 0,
504  /* 4 - 1280x720@60Hz */
505  { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
506  1430, 1650, 0, 720, 725, 730, 750, 0,
508  /* 5 - 1920x1080i@60Hz */
509  { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
510  2052, 2200, 0, 1080, 1084, 1094, 1125, 0,
513  /* 6 - 1440x480i@60Hz */
514  { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1478,
515  1602, 1716, 0, 480, 488, 494, 525, 0,
518  /* 7 - 1440x480i@60Hz */
519  { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1478,
520  1602, 1716, 0, 480, 488, 494, 525, 0,
523  /* 8 - 1440x240@60Hz */
524  { DRM_MODE("1440x240", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1478,
525  1602, 1716, 0, 240, 244, 247, 262, 0,
528  /* 9 - 1440x240@60Hz */
529  { DRM_MODE("1440x240", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1478,
530  1602, 1716, 0, 240, 244, 247, 262, 0,
533  /* 10 - 2880x480i@60Hz */
534  { DRM_MODE("2880x480i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956,
535  3204, 3432, 0, 480, 488, 494, 525, 0,
538  /* 11 - 2880x480i@60Hz */
539  { DRM_MODE("2880x480i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956,
540  3204, 3432, 0, 480, 488, 494, 525, 0,
543  /* 12 - 2880x240@60Hz */
544  { DRM_MODE("2880x240", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956,
545  3204, 3432, 0, 240, 244, 247, 262, 0,
547  /* 13 - 2880x240@60Hz */
548  { DRM_MODE("2880x240", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956,
549  3204, 3432, 0, 240, 244, 247, 262, 0,
551  /* 14 - 1440x480@60Hz */
552  { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1472,
553  1596, 1716, 0, 480, 489, 495, 525, 0,
555  /* 15 - 1440x480@60Hz */
556  { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1472,
557  1596, 1716, 0, 480, 489, 495, 525, 0,
559  /* 16 - 1920x1080@60Hz */
560  { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
561  2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
563  /* 17 - 720x576@50Hz */
564  { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 27000, 720, 732,
565  796, 864, 0, 576, 581, 586, 625, 0,
567  /* 18 - 720x576@50Hz */
568  { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 27000, 720, 732,
569  796, 864, 0, 576, 581, 586, 625, 0,
571  /* 19 - 1280x720@50Hz */
572  { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
573  1760, 1980, 0, 720, 725, 730, 750, 0,
575  /* 20 - 1920x1080i@50Hz */
576  { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
577  2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
580  /* 21 - 1440x576i@50Hz */
581  { DRM_MODE("1440x576i", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1464,
582  1590, 1728, 0, 576, 580, 586, 625, 0,
585  /* 22 - 1440x576i@50Hz */
586  { DRM_MODE("1440x576i", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1464,
587  1590, 1728, 0, 576, 580, 586, 625, 0,
590  /* 23 - 1440x288@50Hz */
591  { DRM_MODE("1440x288", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1464,
592  1590, 1728, 0, 288, 290, 293, 312, 0,
595  /* 24 - 1440x288@50Hz */
596  { DRM_MODE("1440x288", DRM_MODE_TYPE_DRIVER, 27000, 1440, 1464,
597  1590, 1728, 0, 288, 290, 293, 312, 0,
600  /* 25 - 2880x576i@50Hz */
601  { DRM_MODE("2880x576i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928,
602  3180, 3456, 0, 576, 580, 586, 625, 0,
605  /* 26 - 2880x576i@50Hz */
606  { DRM_MODE("2880x576i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928,
607  3180, 3456, 0, 576, 580, 586, 625, 0,
610  /* 27 - 2880x288@50Hz */
611  { DRM_MODE("2880x288", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928,
612  3180, 3456, 0, 288, 290, 293, 312, 0,
614  /* 28 - 2880x288@50Hz */
615  { DRM_MODE("2880x288", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928,
616  3180, 3456, 0, 288, 290, 293, 312, 0,
618  /* 29 - 1440x576@50Hz */
619  { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1464,
620  1592, 1728, 0, 576, 581, 586, 625, 0,
622  /* 30 - 1440x576@50Hz */
623  { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1464,
624  1592, 1728, 0, 576, 581, 586, 625, 0,
626  /* 31 - 1920x1080@50Hz */
627  { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
628  2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
630  /* 32 - 1920x1080@24Hz */
631  { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
632  2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
634  /* 33 - 1920x1080@25Hz */
635  { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
636  2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
638  /* 34 - 1920x1080@30Hz */
639  { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
640  2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
642  /* 35 - 2880x480@60Hz */
643  { DRM_MODE("2880x480", DRM_MODE_TYPE_DRIVER, 108000, 2880, 2944,
644  3192, 3432, 0, 480, 489, 495, 525, 0,
646  /* 36 - 2880x480@60Hz */
647  { DRM_MODE("2880x480", DRM_MODE_TYPE_DRIVER, 108000, 2880, 2944,
648  3192, 3432, 0, 480, 489, 495, 525, 0,
650  /* 37 - 2880x576@50Hz */
651  { DRM_MODE("2880x576", DRM_MODE_TYPE_DRIVER, 108000, 2880, 2928,
652  3184, 3456, 0, 576, 581, 586, 625, 0,
654  /* 38 - 2880x576@50Hz */
655  { DRM_MODE("2880x576", DRM_MODE_TYPE_DRIVER, 108000, 2880, 2928,
656  3184, 3456, 0, 576, 581, 586, 625, 0,
658  /* 39 - 1920x1080i@50Hz */
659  { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 72000, 1920, 1952,
660  2120, 2304, 0, 1080, 1126, 1136, 1250, 0,
663  /* 40 - 1920x1080i@100Hz */
664  { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
665  2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
668  /* 41 - 1280x720@100Hz */
669  { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
670  1760, 1980, 0, 720, 725, 730, 750, 0,
672  /* 42 - 720x576@100Hz */
673  { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 54000, 720, 732,
674  796, 864, 0, 576, 581, 586, 625, 0,
676  /* 43 - 720x576@100Hz */
677  { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 54000, 720, 732,
678  796, 864, 0, 576, 581, 586, 625, 0,
680  /* 44 - 1440x576i@100Hz */
681  { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1464,
682  1590, 1728, 0, 576, 580, 586, 625, 0,
685  /* 45 - 1440x576i@100Hz */
686  { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1464,
687  1590, 1728, 0, 576, 580, 586, 625, 0,
690  /* 46 - 1920x1080i@120Hz */
691  { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
692  2052, 2200, 0, 1080, 1084, 1094, 1125, 0,
695  /* 47 - 1280x720@120Hz */
696  { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
697  1430, 1650, 0, 720, 725, 730, 750, 0,
699  /* 48 - 720x480@120Hz */
700  { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 54000, 720, 736,
701  798, 858, 0, 480, 489, 495, 525, 0,
703  /* 49 - 720x480@120Hz */
704  { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 54000, 720, 736,
705  798, 858, 0, 480, 489, 495, 525, 0,
707  /* 50 - 1440x480i@120Hz */
708  { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1478,
709  1602, 1716, 0, 480, 488, 494, 525, 0,
712  /* 51 - 1440x480i@120Hz */
713  { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1478,
714  1602, 1716, 0, 480, 488, 494, 525, 0,
717  /* 52 - 720x576@200Hz */
718  { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 108000, 720, 732,
719  796, 864, 0, 576, 581, 586, 625, 0,
721  /* 53 - 720x576@200Hz */
722  { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 108000, 720, 732,
723  796, 864, 0, 576, 581, 586, 625, 0,
725  /* 54 - 1440x576i@200Hz */
726  { DRM_MODE("1440x576i", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1464,
727  1590, 1728, 0, 576, 580, 586, 625, 0,
730  /* 55 - 1440x576i@200Hz */
731  { DRM_MODE("1440x576i", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1464,
732  1590, 1728, 0, 576, 580, 586, 625, 0,
735  /* 56 - 720x480@240Hz */
736  { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 108000, 720, 736,
737  798, 858, 0, 480, 489, 495, 525, 0,
739  /* 57 - 720x480@240Hz */
740  { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 108000, 720, 736,
741  798, 858, 0, 480, 489, 495, 525, 0,
743  /* 58 - 1440x480i@240 */
744  { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1478,
745  1602, 1716, 0, 480, 488, 494, 525, 0,
748  /* 59 - 1440x480i@240 */
749  { DRM_MODE("1440x480i", DRM_MODE_TYPE_DRIVER, 108000, 1440, 1478,
750  1602, 1716, 0, 480, 488, 494, 525, 0,
753  /* 60 - 1280x720@24Hz */
754  { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
755  3080, 3300, 0, 720, 725, 730, 750, 0,
757  /* 61 - 1280x720@25Hz */
758  { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
759  3740, 3960, 0, 720, 725, 730, 750, 0,
761  /* 62 - 1280x720@30Hz */
762  { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
763  3080, 3300, 0, 720, 725, 730, 750, 0,
765  /* 63 - 1920x1080@120Hz */
766  { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
767  2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
769  /* 64 - 1920x1080@100Hz */
770  { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
771  2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
773 };
774 static const int drm_num_cea_modes = ARRAY_SIZE(edid_cea_modes);