aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-08-08 09:28:23 -0400
committerEric Anholt <eric@anholt.net>2010-08-09 17:11:28 -0400
commit8545423a912cf500009cbadfae57f706cf2b28e8 (patch)
treea1b3adb16dbc824ef9b09f2ec2ec1198a4e11d51 /drivers
parentaa40d6bbb9cf88f3fb296a57e046a52e9a68ab72 (diff)
drm/i915/sdvo: Only set is_lvds if we have a valid fixed mode.
If we have failed to ascertain the fixed mode for the LVDS panel, then trust the pixel clock ranges reported for the connection when determing valid modes. This makes intel_sdvo_mode_valid() consistent with intel_lvds_mode_valid() which is also a no-op is there is no fixed mode defined. (Since the mode is both validated by SDVO and LVDS, why are checking against an LVDS fixed mode in SDVO...) By only defining is_lvds to be true when we actually have an LVDS output with a fixed mode, we avoid various potential NULL deferences where the assumption is made that all LVDS outputs have a fixed mode. References: Bug 29449 - [Q35] failure to read EDID/vbios for LVDS, no mode => no output https://bugs.freedesktop.org/show_bug.cgi?id=29449 The primary failure in this bug is not finding the EDID and determining the correct fixed panel mode. However, this patch should fix the secondary issue of not enabling any of the standard modes for the panel either. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 69cf7241c3e0..5c765bb0845d 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1274,10 +1274,7 @@ static int intel_sdvo_mode_valid(struct drm_connector *connector,
1274 if (intel_sdvo->pixel_clock_max < mode->clock) 1274 if (intel_sdvo->pixel_clock_max < mode->clock)
1275 return MODE_CLOCK_HIGH; 1275 return MODE_CLOCK_HIGH;
1276 1276
1277 if (intel_sdvo->is_lvds == true) { 1277 if (intel_sdvo->is_lvds) {
1278 if (intel_sdvo->sdvo_lvds_fixed_mode == NULL)
1279 return MODE_PANEL;
1280
1281 if (mode->hdisplay > intel_sdvo->sdvo_lvds_fixed_mode->hdisplay) 1278 if (mode->hdisplay > intel_sdvo->sdvo_lvds_fixed_mode->hdisplay)
1282 return MODE_PANEL; 1279 return MODE_PANEL;
1283 1280
@@ -1534,7 +1531,7 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect
1534 intel_sdvo->base.needs_tv_clock = true; 1531 intel_sdvo->base.needs_tv_clock = true;
1535 } 1532 }
1536 if (response & SDVO_LVDS_MASK) 1533 if (response & SDVO_LVDS_MASK)
1537 intel_sdvo->is_lvds = true; 1534 intel_sdvo->is_lvds = intel_sdvo->sdvo_lvds_fixed_mode != NULL;
1538 } 1535 }
1539 1536
1540 return ret; 1537 return ret;
@@ -1697,6 +1694,7 @@ end:
1697 if (newmode->type & DRM_MODE_TYPE_PREFERRED) { 1694 if (newmode->type & DRM_MODE_TYPE_PREFERRED) {
1698 intel_sdvo->sdvo_lvds_fixed_mode = 1695 intel_sdvo->sdvo_lvds_fixed_mode =
1699 drm_mode_duplicate(connector->dev, newmode); 1696 drm_mode_duplicate(connector->dev, newmode);
1697 intel_sdvo->is_lvds = true;
1700 break; 1698 break;
1701 } 1699 }
1702 } 1700 }
@@ -2190,8 +2188,6 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
2190 encoder->encoder_type = DRM_MODE_ENCODER_LVDS; 2188 encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
2191 connector->connector_type = DRM_MODE_CONNECTOR_LVDS; 2189 connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
2192 2190
2193 intel_sdvo->is_lvds = true;
2194
2195 if (device == 0) { 2191 if (device == 0) {
2196 intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; 2192 intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0;
2197 intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0; 2193 intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0;