aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2009-09-02 21:33:46 -0400
committerDave Airlie <airlied@redhat.com>2009-09-07 02:03:35 -0400
commitaa9eaa1f0962152d0bde821149d82fe7b70a6f92 (patch)
tree4adc0e0ff7f62bbc179d60eec813ae793a1c55d8
parent13a8195b148615b15a4f4385f695f2a232095414 (diff)
drm/kms: Add the default mode table
When we add a standard timing mode in UMS, we will first check whether it can be found in default mode table. If it can't be found, then we will use cvt/gtf to add the standard timing mode. Add the default mode table so that we can check whether the given mode can be found in the default mode table as what we have done in UMS mode. If the status of one output device is connected but there is no EDID, it will have no correct mode. In such case we can add some default modes for it. Of course we only add the modes in the default modes list that visible part is not greater than 1024x768. The default mode is autogenerated from the DMT spec. And it is copied from xserver/hw/xfree86/modes/xf86EdidModes.c. But the mode with reduced blank feature is removed. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_edid.c237
1 files changed, 237 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index e4f1cb5fa60e..e64eb6bbce1a 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -243,6 +243,243 @@ static void edid_fixup_preferred(struct drm_connector *connector,
243 preferred_mode->type |= DRM_MODE_TYPE_PREFERRED; 243 preferred_mode->type |= DRM_MODE_TYPE_PREFERRED;
244} 244}
245 245
246/*
247 * Add the Autogenerated from the DMT spec.
248 * This table is copied from xfree86/modes/xf86EdidModes.c.
249 * But the mode with Reduced blank feature is deleted.
250 */
251static struct drm_display_mode drm_dmt_modes[] = {
252 /* 640x350@85Hz */
253 { DRM_MODE("640x350", DRM_MODE_TYPE_DRIVER, 31500, 640, 672,
254 736, 832, 0, 350, 382, 385, 445, 0,
255 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC) },
256 /* 640x400@85Hz */
257 { DRM_MODE("640x400", DRM_MODE_TYPE_DRIVER, 31500, 640, 672,
258 736, 832, 0, 400, 401, 404, 445, 0,
259 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
260 /* 720x400@85Hz */
261 { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 35500, 720, 756,
262 828, 936, 0, 400, 401, 404, 446, 0,
263 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
264 /* 640x480@60Hz */
265 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656,
266 752, 800, 0, 480, 489, 492, 525, 0,
267 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
268 /* 640x480@72Hz */
269 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 664,
270 704, 832, 0, 480, 489, 492, 520, 0,
271 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
272 /* 640x480@75Hz */
273 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 656,
274 720, 840, 0, 480, 481, 484, 500, 0,
275 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
276 /* 640x480@85Hz */
277 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 36000, 640, 696,
278 752, 832, 0, 480, 481, 484, 509, 0,
279 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
280 /* 800x600@56Hz */
281 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 36000, 800, 824,
282 896, 1024, 0, 600, 601, 603, 625, 0,
283 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
284 /* 800x600@60Hz */
285 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 40000, 800, 840,
286 968, 1056, 0, 600, 601, 605, 628, 0,
287 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
288 /* 800x600@72Hz */
289 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 50000, 800, 856,
290 976, 1040, 0, 600, 637, 643, 666, 0,
291 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
292 /* 800x600@75Hz */
293 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 49500, 800, 816,
294 896, 1056, 0, 600, 601, 604, 625, 0,
295 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
296 /* 800x600@85Hz */
297 { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 56250, 800, 832,
298 896, 1048, 0, 600, 601, 604, 631, 0,
299 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
300 /* 848x480@60Hz */
301 { DRM_MODE("848x480", DRM_MODE_TYPE_DRIVER, 33750, 848, 864,
302 976, 1088, 0, 480, 486, 494, 517, 0,
303 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
304 /* 1024x768@43Hz, interlace */
305 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 44900, 1024, 1032,
306 1208, 1264, 0, 768, 768, 772, 817, 0,
307 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
308 DRM_MODE_FLAG_INTERLACE) },
309 /* 1024x768@60Hz */
310 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 65000, 1024, 1048,
311 1184, 1344, 0, 768, 771, 777, 806, 0,
312 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
313 /* 1024x768@70Hz */
314 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 75000, 1024, 1048,
315 1184, 1328, 0, 768, 771, 777, 806, 0,
316 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
317 /* 1024x768@75Hz */
318 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 78750, 1024, 1040,
319 1136, 1312, 0, 768, 769, 772, 800, 0,
320 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
321 /* 1024x768@85Hz */
322 { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 94500, 1024, 1072,
323 1072, 1376, 0, 768, 769, 772, 808, 0,
324 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
325 /* 1152x864@75Hz */
326 { DRM_MODE("1152x864", DRM_MODE_TYPE_DRIVER, 108000, 1152, 1216,
327 1344, 1600, 0, 864, 865, 868, 900, 0,
328 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
329 /* 1280x768@60Hz */
330 { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 79500, 1280, 1344,
331 1472, 1664, 0, 768, 771, 778, 798, 0,
332 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
333 /* 1280x768@75Hz */
334 { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 102250, 1280, 1360,
335 1488, 1696, 0, 768, 771, 778, 805, 0,
336 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC) },
337 /* 1280x768@85Hz */
338 { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 117500, 1280, 1360,
339 1496, 1712, 0, 768, 771, 778, 809, 0,
340 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
341 /* 1280x800@60Hz */
342 { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 83500, 1280, 1352,
343 1480, 1680, 0, 800, 803, 809, 831, 0,
344 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC) },
345 /* 1280x800@75Hz */
346 { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 106500, 1280, 1360,
347 1488, 1696, 0, 800, 803, 809, 838, 0,
348 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
349 /* 1280x800@85Hz */
350 { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 122500, 1280, 1360,
351 1496, 1712, 0, 800, 803, 809, 843, 0,
352 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
353 /* 1280x960@60Hz */
354 { DRM_MODE("1280x960", DRM_MODE_TYPE_DRIVER, 108000, 1280, 1376,
355 1488, 1800, 0, 960, 961, 964, 1000, 0,
356 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
357 /* 1280x960@85Hz */
358 { DRM_MODE("1280x960", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1344,
359 1504, 1728, 0, 960, 961, 964, 1011, 0,
360 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
361 /* 1280x1024@60Hz */
362 { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 108000, 1280, 1328,
363 1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
364 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
365 /* 1280x1024@75Hz */
366 { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 135000, 1280, 1296,
367 1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
368 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
369 /* 1280x1024@85Hz */
370 { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 157500, 1280, 1344,
371 1504, 1728, 0, 1024, 1025, 1028, 1072, 0,
372 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
373 /* 1360x768@60Hz */
374 { DRM_MODE("1360x768", DRM_MODE_TYPE_DRIVER, 85500, 1360, 1424,
375 1536, 1792, 0, 768, 771, 777, 795, 0,
376 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
377 /* 1440x1050@60Hz */
378 { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 121750, 1400, 1488,
379 1632, 1864, 0, 1050, 1053, 1057, 1089, 0,
380 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
381 /* 1440x1050@75Hz */
382 { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 156000, 1400, 1504,
383 1648, 1896, 0, 1050, 1053, 1057, 1099, 0,
384 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
385 /* 1440x1050@85Hz */
386 { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 179500, 1400, 1504,
387 1656, 1912, 0, 1050, 1053, 1057, 1105, 0,
388 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
389 /* 1440x900@60Hz */
390 { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 106500, 1440, 1520,
391 1672, 1904, 0, 900, 903, 909, 934, 0,
392 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
393 /* 1440x900@75Hz */
394 { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 136750, 1440, 1536,
395 1688, 1936, 0, 900, 903, 909, 942, 0,
396 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
397 /* 1440x900@85Hz */
398 { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 157000, 1440, 1544,
399 1696, 1952, 0, 900, 903, 909, 948, 0,
400 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
401 /* 1600x1200@60Hz */
402 { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 162000, 1600, 1664,
403 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
404 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
405 /* 1600x1200@65Hz */
406 { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 175500, 1600, 1664,
407 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
408 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
409 /* 1600x1200@70Hz */
410 { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 189000, 1600, 1664,
411 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
412 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
413 /* 1600x1200@75Hz */
414 { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 2025000, 1600, 1664,
415 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
416 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
417 /* 1600x1200@85Hz */
418 { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 229500, 1600, 1664,
419 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
420 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
421 /* 1680x1050@60Hz */
422 { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 146250, 1680, 1784,
423 1960, 2240, 0, 1050, 1053, 1059, 1089, 0,
424 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
425 /* 1680x1050@75Hz */
426 { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 187000, 1680, 1800,
427 1976, 2272, 0, 1050, 1053, 1059, 1099, 0,
428 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
429 /* 1680x1050@85Hz */
430 { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 214750, 1680, 1808,
431 1984, 2288, 0, 1050, 1053, 1059, 1105, 0,
432 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
433 /* 1792x1344@60Hz */
434 { DRM_MODE("1792x1344", DRM_MODE_TYPE_DRIVER, 204750, 1792, 1920,
435 2120, 2448, 0, 1344, 1345, 1348, 1394, 0,
436 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
437 /* 1729x1344@75Hz */
438 { DRM_MODE("1792x1344", DRM_MODE_TYPE_DRIVER, 261000, 1792, 1888,
439 2104, 2456, 0, 1344, 1345, 1348, 1417, 0,
440 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
441 /* 1853x1392@60Hz */
442 { DRM_MODE("1856x1392", DRM_MODE_TYPE_DRIVER, 218250, 1856, 1952,
443 2176, 2528, 0, 1392, 1393, 1396, 1439, 0,
444 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
445 /* 1856x1392@75Hz */
446 { DRM_MODE("1856x1392", DRM_MODE_TYPE_DRIVER, 288000, 1856, 1984,
447 2208, 2560, 0, 1392, 1395, 1399, 1500, 0,
448 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
449 /* 1920x1200@60Hz */
450 { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 193250, 1920, 2056,
451 2256, 2592, 0, 1200, 1203, 1209, 1245, 0,
452 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
453 /* 1920x1200@75Hz */
454 { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 245250, 1920, 2056,
455 2264, 2608, 0, 1200, 1203, 1209, 1255, 0,
456 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
457 /* 1920x1200@85Hz */
458 { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 281250, 1920, 2064,
459 2272, 2624, 0, 1200, 1203, 1209, 1262, 0,
460 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
461 /* 1920x1440@60Hz */
462 { DRM_MODE("1920x1440", DRM_MODE_TYPE_DRIVER, 234000, 1920, 2048,
463 2256, 2600, 0, 1440, 1441, 1444, 1500, 0,
464 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
465 /* 1920x1440@75Hz */
466 { DRM_MODE("1920x1440", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2064,
467 2288, 2640, 0, 1440, 1441, 1444, 1500, 0,
468 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
469 /* 2560x1600@60Hz */
470 { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 348500, 2560, 2752,
471 3032, 3504, 0, 1600, 1603, 1609, 1658, 0,
472 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
473 /* 2560x1600@75HZ */
474 { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 443250, 2560, 2768,
475 3048, 3536, 0, 1600, 1603, 1609, 1672, 0,
476 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
477 /* 2560x1600@85HZ */
478 { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 505250, 2560, 2768,
479 3048, 3536, 0, 1600, 1603, 1609, 1682, 0,
480 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
481};
482
246/** 483/**
247 * drm_mode_std - convert standard mode info (width, height, refresh) into mode 484 * drm_mode_std - convert standard mode info (width, height, refresh) into mode
248 * @t: standard timing params 485 * @t: standard timing params