aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMa Ling <ling.ma@intel.com>2009-05-12 23:20:06 -0400
committerEric Anholt <eric@anholt.net>2009-05-22 15:56:02 -0400
commit7086c87fb1446ceb37918ffa0941359a7c2ec6cf (patch)
treeeb4065bc70955e1b78d77a8646456a8ec7bab15c /drivers
parent8863170628da4b0b461eb96bf797df1dca0bd03e (diff)
drm/i915: Return SDVO LVDS VBT mode if no EDID modes are detected.
Some new SDVO LVDS hardware doesn't have DDC available, and this should fix the display on it. Signed-off-by: Ma Ling <ling.ma@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 9913651c1e17..f79ebf4de63c 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -69,6 +69,10 @@ struct intel_sdvo_priv {
69 * This is set if we treat the device as HDMI, instead of DVI. 69 * This is set if we treat the device as HDMI, instead of DVI.
70 */ 70 */
71 bool is_hdmi; 71 bool is_hdmi;
72 /**
73 * This is set if we detect output of sdvo device as LVDS.
74 */
75 bool is_lvds;
72 76
73 /** 77 /**
74 * Returned SDTV resolutions allowed for the current format, if the 78 * Returned SDTV resolutions allowed for the current format, if the
@@ -1543,6 +1547,37 @@ static void intel_sdvo_get_tv_modes(struct drm_connector *connector)
1543 } 1547 }
1544} 1548}
1545 1549
1550static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
1551{
1552 struct intel_output *intel_output = to_intel_output(connector);
1553 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1554 struct drm_i915_private *dev_priv = connector->dev->dev_private;
1555
1556 /*
1557 * Attempt to get the mode list from DDC.
1558 * Assume that the preferred modes are
1559 * arranged in priority order.
1560 */
1561 /* set the bus switch and get the modes */
1562 intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
1563 intel_ddc_get_modes(intel_output);
1564 if (list_empty(&connector->probed_modes) == false)
1565 return;
1566
1567 /* Fetch modes from VBT */
1568 if (dev_priv->sdvo_lvds_vbt_mode != NULL) {
1569 struct drm_display_mode *newmode;
1570 newmode = drm_mode_duplicate(connector->dev,
1571 dev_priv->sdvo_lvds_vbt_mode);
1572 if (newmode != NULL) {
1573 /* Guarantee the mode is preferred */
1574 newmode->type = (DRM_MODE_TYPE_PREFERRED |
1575 DRM_MODE_TYPE_DRIVER);
1576 drm_mode_probed_add(connector, newmode);
1577 }
1578 }
1579}
1580
1546static int intel_sdvo_get_modes(struct drm_connector *connector) 1581static int intel_sdvo_get_modes(struct drm_connector *connector)
1547{ 1582{
1548 struct intel_output *output = to_intel_output(connector); 1583 struct intel_output *output = to_intel_output(connector);
@@ -1550,6 +1585,8 @@ static int intel_sdvo_get_modes(struct drm_connector *connector)
1550 1585
1551 if (sdvo_priv->is_tv) 1586 if (sdvo_priv->is_tv)
1552 intel_sdvo_get_tv_modes(connector); 1587 intel_sdvo_get_tv_modes(connector);
1588 else if (sdvo_priv->is_lvds == true)
1589 intel_sdvo_get_lvds_modes(connector);
1553 else 1590 else
1554 intel_sdvo_get_ddc_modes(connector); 1591 intel_sdvo_get_ddc_modes(connector);
1555 1592
@@ -1720,6 +1757,8 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1720 } 1757 }
1721 } 1758 }
1722 1759
1760 /* In defaut case sdvo lvds is false */
1761 sdvo_priv->is_lvds = false;
1723 intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps); 1762 intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps);
1724 1763
1725 if (sdvo_priv->caps.output_flags & 1764 if (sdvo_priv->caps.output_flags &
@@ -1773,6 +1812,7 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1773 connector->display_info.subpixel_order = SubPixelHorizontalRGB; 1812 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1774 encoder_type = DRM_MODE_ENCODER_LVDS; 1813 encoder_type = DRM_MODE_ENCODER_LVDS;
1775 connector_type = DRM_MODE_CONNECTOR_LVDS; 1814 connector_type = DRM_MODE_CONNECTOR_LVDS;
1815 sdvo_priv->is_lvds = true;
1776 } 1816 }
1777 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS1) 1817 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS1)
1778 { 1818 {
@@ -1780,6 +1820,7 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1780 connector->display_info.subpixel_order = SubPixelHorizontalRGB; 1820 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1781 encoder_type = DRM_MODE_ENCODER_LVDS; 1821 encoder_type = DRM_MODE_ENCODER_LVDS;
1782 connector_type = DRM_MODE_CONNECTOR_LVDS; 1822 connector_type = DRM_MODE_CONNECTOR_LVDS;
1823 sdvo_priv->is_lvds = true;
1783 } 1824 }
1784 else 1825 else
1785 { 1826 {