aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-11-02 04:43:10 -0400
committerDave Airlie <airlied@redhat.com>2011-11-07 08:14:59 -0500
commit1543b4dd0c4b63975ffdadccd67c3a8805f28814 (patch)
treefb23465df4e17c0bb702914cef5f40cbcf69807f /drivers/gpu/drm/vmwgfx
parent0e708bc5d6403d1a64a0e4155f1b91e318318989 (diff)
vmwgfx: Make the preferred autofit mode have a 60Hz vrefresh
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index f9a0f980c300..1cebf64f1142 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -1662,6 +1662,28 @@ static struct drm_display_mode vmw_kms_connector_builtin[] = {
1662 { DRM_MODE("", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) }, 1662 { DRM_MODE("", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) },
1663}; 1663};
1664 1664
1665/**
1666 * vmw_guess_mode_timing - Provide fake timings for a
1667 * 60Hz vrefresh mode.
1668 *
1669 * @mode - Pointer to a struct drm_display_mode with hdisplay and vdisplay
1670 * members filled in.
1671 */
1672static void vmw_guess_mode_timing(struct drm_display_mode *mode)
1673{
1674 mode->hsync_start = mode->hdisplay + 50;
1675 mode->hsync_end = mode->hsync_start + 50;
1676 mode->htotal = mode->hsync_end + 50;
1677
1678 mode->vsync_start = mode->vdisplay + 50;
1679 mode->vsync_end = mode->vsync_start + 50;
1680 mode->vtotal = mode->vsync_end + 50;
1681
1682 mode->clock = (u32)mode->htotal * (u32)mode->vtotal / 100 * 6;
1683 mode->vrefresh = drm_mode_vrefresh(mode);
1684}
1685
1686
1665int vmw_du_connector_fill_modes(struct drm_connector *connector, 1687int vmw_du_connector_fill_modes(struct drm_connector *connector,
1666 uint32_t max_width, uint32_t max_height) 1688 uint32_t max_width, uint32_t max_height)
1667{ 1689{
@@ -1684,7 +1706,7 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector,
1684 return 0; 1706 return 0;
1685 mode->hdisplay = du->pref_width; 1707 mode->hdisplay = du->pref_width;
1686 mode->vdisplay = du->pref_height; 1708 mode->vdisplay = du->pref_height;
1687 mode->vrefresh = drm_mode_vrefresh(mode); 1709 vmw_guess_mode_timing(mode);
1688 if (vmw_kms_validate_mode_vram(dev_priv, mode->hdisplay * 2, 1710 if (vmw_kms_validate_mode_vram(dev_priv, mode->hdisplay * 2,
1689 mode->vdisplay)) { 1711 mode->vdisplay)) {
1690 drm_mode_probed_add(connector, mode); 1712 drm_mode_probed_add(connector, mode);