From e506d6fde50e0a737234892eda31708692bdda29 Mon Sep 17 00:00:00 2001
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Tue, 13 Nov 2012 17:24:43 +0100
Subject: drm/i915: disable cloning on sdvo
Git-commit: e506d6fde50e0a737234892eda31708692bdda29
Patch-mainline: v3.7-rc8

After the recent pile of disable-cloning patches, e.g.

commit e3b86d6941c7e5f90be05d986fce1fcb40c68d6b
Author: Egbert Eich <eich@suse.de>
Date:   Sat Oct 13 14:30:15 2012 +0200

    DRM/i915: Don't clone SDVO LVDS with analog

and a bug report from Chris Wilson indicating that cloning doesn't
even work for DVI-SDVO and native VGA, let's just disable cloning on
sdvo encoders completely.

v2: Update the comment in the code as discussed with Paulo Zanoni.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29259
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Michal Srb <msrb@suse.com>
---
 drivers/gpu/drm/i915/intel_sdvo.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

Index: linux-3.0-SLE11-SP3/drivers/gpu/drm/i915/intel_sdvo.c
===================================================================
--- linux-3.0-SLE11-SP3.orig/drivers/gpu/drm/i915/intel_sdvo.c
+++ linux-3.0-SLE11-SP3/drivers/gpu/drm/i915/intel_sdvo.c
@@ -2192,7 +2192,6 @@ intel_sdvo_dvi_init(struct intel_sdvo *i
 		connector->connector_type = DRM_MODE_CONNECTOR_HDMIA;
 		intel_sdvo->is_hdmi = true;
 	}
-	intel_sdvo->base.cloneable = true;
 
 	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
 	if (intel_sdvo->is_hdmi)
@@ -2223,7 +2222,6 @@ intel_sdvo_tv_init(struct intel_sdvo *in
 
 	intel_sdvo->is_tv = true;
 	intel_sdvo->base.needs_tv_clock = true;
-	intel_sdvo->base.cloneable = false;
 
 	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
 
@@ -2266,8 +2264,6 @@ intel_sdvo_analog_init(struct intel_sdvo
 		intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
 	}
 
-	intel_sdvo->base.cloneable = true;
-
 	intel_sdvo_connector_init(intel_sdvo_connector,
 				  intel_sdvo);
 	return true;
@@ -2298,11 +2294,6 @@ intel_sdvo_lvds_init(struct intel_sdvo *
 		intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
 	}
 
-	/* SDVO LVDS is cloneable because the SDVO encoder does the upscaling,
-	 * as opposed to native LVDS, where we upscale with the panel-fitter
-	 * (and hence only the native LVDS resolution could be cloned). */
-	intel_sdvo->base.cloneable = true;
-
 	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
 	if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector))
 		goto err;
@@ -2714,6 +2705,16 @@ bool intel_sdvo_init(struct drm_device *
 		goto err_output;
 	}
 
+	/*
+	 * Cloning SDVO with anything is often impossible, since the SDVO
+	 * encoder can request a special input timing mode. And even if that's
+	 * not the case we have evidence that cloning a plain unscaled mode with
+	 * VGA doesn't really work. Furthermore the cloning flags are way too
+	 * simplistic anyway to express such constraints, so just give up on
+	 * cloning for SDVO encoders.
+	 */
+	intel_sdvo->base.cloneable = false;
+
 	/* Only enable the hotplug irq if we need it, to work around noisy
 	 * hotplug lines.
 	 */
