diff mbox

drm/i915/sdvo: Only set is_lvds if we have a valid fixed mode.

Message ID 1281274103-4608-1-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Chris Wilson Aug. 8, 2010, 1:28 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 8baa596..8a1ae76 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1275,10 +1275,7 @@  static int intel_sdvo_mode_valid(struct drm_connector *connector,
 	if (intel_sdvo->pixel_clock_max < mode->clock)
 		return MODE_CLOCK_HIGH;
 
-	if (intel_sdvo->is_lvds == true) {
-		if (intel_sdvo->sdvo_lvds_fixed_mode == NULL)
-			return MODE_PANEL;
-
+	if (intel_sdvo->is_lvds) {
 		if (mode->hdisplay > intel_sdvo->sdvo_lvds_fixed_mode->hdisplay)
 			return MODE_PANEL;
 
@@ -1535,7 +1532,7 @@  static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect
 			intel_sdvo->base.needs_tv_clock = true;
 		}
 		if (response & SDVO_LVDS_MASK)
-			intel_sdvo->is_lvds = true;
+			intel_sdvo->is_lvds = intel_sdvo->sdvo_lvds_fixed_mode != NULL;
 	}
 
 	return ret;
@@ -1698,6 +1695,7 @@  end:
 		if (newmode->type & DRM_MODE_TYPE_PREFERRED) {
 			intel_sdvo->sdvo_lvds_fixed_mode =
 				drm_mode_duplicate(connector->dev, newmode);
+			intel_sdvo->is_lvds = true;
 			break;
 		}
 	}
@@ -2200,8 +2198,6 @@  intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
         encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
         connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
 
-        intel_sdvo->is_lvds = true;
-
         if (device == 0) {
                 intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0;
                 intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0;