diff mbox

drm/i915: prefer VBT modes for SVDO-LVDS over EDID

Message ID 1370850478-28796-1-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter June 10, 2013, 7:47 a.m. UTC
In

commit 53d3b4d7778daf15900867336c85d3f8dd70600c
Author: Egbert Eich <eich@suse.de>
Date:   Tue Jun 4 17:13:21 2013 +0200

    drm/i915/sdvo: Use &intel_sdvo->ddc instead of intel_sdvo->i2c for DDC

Egbert Eich fixed a long-standing bug where we simply used a
non-working i2c controller to read the EDID for SDVO-LVDS panels.
Unfortunately some machines seem to not be able to cope with the mode
provided in the EDID (specifically they seem to not be able to cope
with a 4x pixel mutliplier instead of a 2x one).

Since it took forever to notice the breakage it's fairly safe to
assume that at least for SDVO-LVDS panels the VBT contains fairly sane
data. So just switch around the order and use VBT modes first.

v2: Also add EDID modes just in case, and spell Egbert correctly.

Cc: Egbert Eich <eich@suse.de>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65524
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_sdvo.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Chris Wilson June 10, 2013, 8:10 a.m. UTC | #1
On Mon, Jun 10, 2013 at 09:47:58AM +0200, Daniel Vetter wrote:
> In
> 
> commit 53d3b4d7778daf15900867336c85d3f8dd70600c
> Author: Egbert Eich <eich@suse.de>
> Date:   Tue Jun 4 17:13:21 2013 +0200
> 
>     drm/i915/sdvo: Use &intel_sdvo->ddc instead of intel_sdvo->i2c for DDC
> 
> Egbert Eich fixed a long-standing bug where we simply used a
> non-working i2c controller to read the EDID for SDVO-LVDS panels.
> Unfortunately some machines seem to not be able to cope with the mode
> provided in the EDID (specifically they seem to not be able to cope
> with a 4x pixel mutliplier instead of a 2x one).
> 
> Since it took forever to notice the breakage it's fairly safe to
> assume that at least for SDVO-LVDS panels the VBT contains fairly sane
> data. So just switch around the order and use VBT modes first.
> 
> v2: Also add EDID modes just in case, and spell Egbert correctly.
> 
> Cc: Egbert Eich <eich@suse.de>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65524
> Cc: stable@vger.kernel.org
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Daniel Vetter June 10, 2013, 8:17 a.m. UTC | #2
On Mon, Jun 10, 2013 at 09:10:51AM +0100, Chris Wilson wrote:
> On Mon, Jun 10, 2013 at 09:47:58AM +0200, Daniel Vetter wrote:
> > In
> > 
> > commit 53d3b4d7778daf15900867336c85d3f8dd70600c
> > Author: Egbert Eich <eich@suse.de>
> > Date:   Tue Jun 4 17:13:21 2013 +0200
> > 
> >     drm/i915/sdvo: Use &intel_sdvo->ddc instead of intel_sdvo->i2c for DDC
> > 
> > Egbert Eich fixed a long-standing bug where we simply used a
> > non-working i2c controller to read the EDID for SDVO-LVDS panels.
> > Unfortunately some machines seem to not be able to cope with the mode
> > provided in the EDID (specifically they seem to not be able to cope
> > with a 4x pixel mutliplier instead of a 2x one).
> > 
> > Since it took forever to notice the breakage it's fairly safe to
> > assume that at least for SDVO-LVDS panels the VBT contains fairly sane
> > data. So just switch around the order and use VBT modes first.
> > 
> > v2: Also add EDID modes just in case, and spell Egbert correctly.
> > 
> > Cc: Egbert Eich <eich@suse.de>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65524
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Tested-by: Chris Wilson <chris@chris-wilson.co.uk>

Picked up for -fixes, thanks for testing.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 4c47b44..2a449d1 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1777,10 +1777,13 @@  static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
 	 * arranged in priority order.
 	 */
 	intel_ddc_get_modes(connector, &intel_sdvo->ddc);
-	if (list_empty(&connector->probed_modes) == false)
-		goto end;
 
-	/* Fetch modes from VBT */
+	/*
+	 * Fetch modes from VBT. For SDVO prefer the VBT mode since some
+	 * SDVO->LVDS transcoders can't cope with the EDID mode. Since
+	 * drm_mode_probed_add adds the mode at the head of the list we add it
+	 * last.
+	 */
 	if (dev_priv->sdvo_lvds_vbt_mode != NULL) {
 		newmode = drm_mode_duplicate(connector->dev,
 					     dev_priv->sdvo_lvds_vbt_mode);
@@ -1792,7 +1795,6 @@  static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
 		}
 	}
 
-end:
 	list_for_each_entry(newmode, &connector->probed_modes, head) {
 		if (newmode->type & DRM_MODE_TYPE_PREFERRED) {
 			intel_sdvo->sdvo_lvds_fixed_mode =