[Intel-gfx] [Patch 1/4] DRM: Add the default mode table
ykzhao
yakui.zhao at intel.com
Fri Sep 4 04:17:53 CEST 2009
On Thu, 2009-09-03 at 09:33 +0800, Zhao, Yakui wrote:
> From: Zhao Yakui <yakui.zhao at intel.com>
>
> 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.
Hi, Dave
Can you please review this patch set and see whether it can be
picked up?
Thanks.
>
> Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 237 +++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 237 insertions(+)
>
> Index: linux-2.6/drivers/gpu/drm/drm_edid.c
> ===================================================================
> --- linux-2.6.orig/drivers/gpu/drm/drm_edid.c 2009-09-03 08:56:50.000000000 +0800
> +++ linux-2.6/drivers/gpu/drm/drm_edid.c 2009-09-03 08:57:18.000000000 +0800
> @@ -243,6 +243,243 @@
> preferred_mode->type |= DRM_MODE_TYPE_PREFERRED;
> }
>
> +/*
> + * Add the Autogenerated from the DMT spec.
> + * This table is copied from xfree86/modes/xf86EdidModes.c.
> + * But the mode with Reduced blank feature is deleted.
> + */
> +static struct drm_display_mode drm_dmt_modes[] = {
> + /* 640x350 at 85Hz */
> + { DRM_MODE("640x350", DRM_MODE_TYPE_DRIVER, 31500, 640, 672,
> + 736, 832, 0, 350, 382, 385, 445, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 640x400 at 85Hz */
> + { DRM_MODE("640x400", DRM_MODE_TYPE_DRIVER, 31500, 640, 672,
> + 736, 832, 0, 400, 401, 404, 445, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 720x400 at 85Hz */
> + { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 35500, 720, 756,
> + 828, 936, 0, 400, 401, 404, 446, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 640x480 at 60Hz */
> + { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656,
> + 752, 800, 0, 480, 489, 492, 525, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 640x480 at 72Hz */
> + { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 664,
> + 704, 832, 0, 480, 489, 492, 520, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 640x480 at 75Hz */
> + { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 31500, 640, 656,
> + 720, 840, 0, 480, 481, 484, 500, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 640x480 at 85Hz */
> + { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 36000, 640, 696,
> + 752, 832, 0, 480, 481, 484, 509, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 800x600 at 56Hz */
> + { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 36000, 800, 824,
> + 896, 1024, 0, 600, 601, 603, 625, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 800x600 at 60Hz */
> + { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 40000, 800, 840,
> + 968, 1056, 0, 600, 601, 605, 628, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 800x600 at 72Hz */
> + { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 50000, 800, 856,
> + 976, 1040, 0, 600, 637, 643, 666, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 800x600 at 75Hz */
> + { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 49500, 800, 816,
> + 896, 1056, 0, 600, 601, 604, 625, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 800x600 at 85Hz */
> + { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 56250, 800, 832,
> + 896, 1048, 0, 600, 601, 604, 631, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 848x480 at 60Hz */
> + { DRM_MODE("848x480", DRM_MODE_TYPE_DRIVER, 33750, 848, 864,
> + 976, 1088, 0, 480, 486, 494, 517, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1024x768 at 43Hz, interlace */
> + { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 44900, 1024, 1032,
> + 1208, 1264, 0, 768, 768, 772, 817, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> + DRM_MODE_FLAG_INTERLACE) },
> + /* 1024x768 at 60Hz */
> + { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 65000, 1024, 1048,
> + 1184, 1344, 0, 768, 771, 777, 806, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 1024x768 at 70Hz */
> + { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 75000, 1024, 1048,
> + 1184, 1328, 0, 768, 771, 777, 806, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 1024x768 at 75Hz */
> + { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 78750, 1024, 1040,
> + 1136, 1312, 0, 768, 769, 772, 800, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1024x768 at 85Hz */
> + { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 94500, 1024, 1072,
> + 1072, 1376, 0, 768, 769, 772, 808, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1152x864 at 75Hz */
> + { DRM_MODE("1152x864", DRM_MODE_TYPE_DRIVER, 108000, 1152, 1216,
> + 1344, 1600, 0, 864, 865, 868, 900, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x768 at 60Hz */
> + { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 79500, 1280, 1344,
> + 1472, 1664, 0, 768, 771, 778, 798, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x768 at 75Hz */
> + { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 102250, 1280, 1360,
> + 1488, 1696, 0, 768, 771, 778, 805, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 1280x768 at 85Hz */
> + { DRM_MODE("1280x768", DRM_MODE_TYPE_DRIVER, 117500, 1280, 1360,
> + 1496, 1712, 0, 768, 771, 778, 809, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x800 at 60Hz */
> + { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 83500, 1280, 1352,
> + 1480, 1680, 0, 800, 803, 809, 831, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC) },
> + /* 1280x800 at 75Hz */
> + { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 106500, 1280, 1360,
> + 1488, 1696, 0, 800, 803, 809, 838, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x800 at 85Hz */
> + { DRM_MODE("1280x800", DRM_MODE_TYPE_DRIVER, 122500, 1280, 1360,
> + 1496, 1712, 0, 800, 803, 809, 843, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x960 at 60Hz */
> + { DRM_MODE("1280x960", DRM_MODE_TYPE_DRIVER, 108000, 1280, 1376,
> + 1488, 1800, 0, 960, 961, 964, 1000, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x960 at 85Hz */
> + { DRM_MODE("1280x960", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1344,
> + 1504, 1728, 0, 960, 961, 964, 1011, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x1024 at 60Hz */
> + { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 108000, 1280, 1328,
> + 1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x1024 at 75Hz */
> + { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 135000, 1280, 1296,
> + 1440, 1688, 0, 1024, 1025, 1028, 1066, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1280x1024 at 85Hz */
> + { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 157500, 1280, 1344,
> + 1504, 1728, 0, 1024, 1025, 1028, 1072, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1360x768 at 60Hz */
> + { DRM_MODE("1360x768", DRM_MODE_TYPE_DRIVER, 85500, 1360, 1424,
> + 1536, 1792, 0, 768, 771, 777, 795, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1440x1050 at 60Hz */
> + { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 121750, 1400, 1488,
> + 1632, 1864, 0, 1050, 1053, 1057, 1089, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1440x1050 at 75Hz */
> + { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 156000, 1400, 1504,
> + 1648, 1896, 0, 1050, 1053, 1057, 1099, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1440x1050 at 85Hz */
> + { DRM_MODE("1400x1050", DRM_MODE_TYPE_DRIVER, 179500, 1400, 1504,
> + 1656, 1912, 0, 1050, 1053, 1057, 1105, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1440x900 at 60Hz */
> + { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 106500, 1440, 1520,
> + 1672, 1904, 0, 900, 903, 909, 934, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1440x900 at 75Hz */
> + { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 136750, 1440, 1536,
> + 1688, 1936, 0, 900, 903, 909, 942, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1440x900 at 85Hz */
> + { DRM_MODE("1440x900", DRM_MODE_TYPE_DRIVER, 157000, 1440, 1544,
> + 1696, 1952, 0, 900, 903, 909, 948, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1600x1200 at 60Hz */
> + { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 162000, 1600, 1664,
> + 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1600x1200 at 65Hz */
> + { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 175500, 1600, 1664,
> + 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1600x1200 at 70Hz */
> + { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 189000, 1600, 1664,
> + 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1600x1200 at 75Hz */
> + { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 2025000, 1600, 1664,
> + 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1600x1200 at 85Hz */
> + { DRM_MODE("1600x1200", DRM_MODE_TYPE_DRIVER, 229500, 1600, 1664,
> + 1856, 2160, 0, 1200, 1201, 1204, 1250, 0,
> + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1680x1050 at 60Hz */
> + { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 146250, 1680, 1784,
> + 1960, 2240, 0, 1050, 1053, 1059, 1089, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1680x1050 at 75Hz */
> + { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 187000, 1680, 1800,
> + 1976, 2272, 0, 1050, 1053, 1059, 1099, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1680x1050 at 85Hz */
> + { DRM_MODE("1680x1050", DRM_MODE_TYPE_DRIVER, 214750, 1680, 1808,
> + 1984, 2288, 0, 1050, 1053, 1059, 1105, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1792x1344 at 60Hz */
> + { DRM_MODE("1792x1344", DRM_MODE_TYPE_DRIVER, 204750, 1792, 1920,
> + 2120, 2448, 0, 1344, 1345, 1348, 1394, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1729x1344 at 75Hz */
> + { DRM_MODE("1792x1344", DRM_MODE_TYPE_DRIVER, 261000, 1792, 1888,
> + 2104, 2456, 0, 1344, 1345, 1348, 1417, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1853x1392 at 60Hz */
> + { DRM_MODE("1856x1392", DRM_MODE_TYPE_DRIVER, 218250, 1856, 1952,
> + 2176, 2528, 0, 1392, 1393, 1396, 1439, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1856x1392 at 75Hz */
> + { DRM_MODE("1856x1392", DRM_MODE_TYPE_DRIVER, 288000, 1856, 1984,
> + 2208, 2560, 0, 1392, 1395, 1399, 1500, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1920x1200 at 60Hz */
> + { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 193250, 1920, 2056,
> + 2256, 2592, 0, 1200, 1203, 1209, 1245, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1920x1200 at 75Hz */
> + { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 245250, 1920, 2056,
> + 2264, 2608, 0, 1200, 1203, 1209, 1255, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1920x1200 at 85Hz */
> + { DRM_MODE("1920x1200", DRM_MODE_TYPE_DRIVER, 281250, 1920, 2064,
> + 2272, 2624, 0, 1200, 1203, 1209, 1262, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1920x1440 at 60Hz */
> + { DRM_MODE("1920x1440", DRM_MODE_TYPE_DRIVER, 234000, 1920, 2048,
> + 2256, 2600, 0, 1440, 1441, 1444, 1500, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 1920x1440 at 75Hz */
> + { DRM_MODE("1920x1440", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2064,
> + 2288, 2640, 0, 1440, 1441, 1444, 1500, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 2560x1600 at 60Hz */
> + { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 348500, 2560, 2752,
> + 3032, 3504, 0, 1600, 1603, 1609, 1658, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 2560x1600 at 75HZ */
> + { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 443250, 2560, 2768,
> + 3048, 3536, 0, 1600, 1603, 1609, 1672, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> + /* 2560x1600 at 85HZ */
> + { DRM_MODE("2560x1600", DRM_MODE_TYPE_DRIVER, 505250, 2560, 2768,
> + 3048, 3536, 0, 1600, 1603, 1609, 1682, 0,
> + DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC) },
> +};
> +
> /**
> * drm_mode_std - convert standard mode info (width, height, refresh) into mode
> * @t: standard timing params
More information about the Intel-gfx
mailing list