All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID
@ 2013-06-09 20:58 Daniel Vetter
  2013-06-09 21:16 ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2013-06-09 20:58 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Egbert Eich, Chris Wilson, stable

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

Ebgert 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.

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 |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 4c47b44..da3da8d 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1771,17 +1771,9 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
 	struct drm_i915_private *dev_priv = connector->dev->dev_private;
 	struct drm_display_mode *newmode;
 
-	/*
-	 * Attempt to get the mode list from DDC.
-	 * Assume that the preferred modes are
-	 * 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 */
-	if (dev_priv->sdvo_lvds_vbt_mode != NULL) {
+	/* Fetch modes from VBT. For SDVO prefer the VBT mode since some
+	 * SDVO->LVDS transcoders can't cope with the EDID mode. */
+	if (dev_priv->vbt.sdvo_lvds_vbt_mode != NULL) {
 		newmode = drm_mode_duplicate(connector->dev,
 					     dev_priv->sdvo_lvds_vbt_mode);
 		if (newmode != NULL) {
@@ -1789,9 +1781,18 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
 			newmode->type = (DRM_MODE_TYPE_PREFERRED |
 					 DRM_MODE_TYPE_DRIVER);
 			drm_mode_probed_add(connector, newmode);
+
+			goto end;
 		}
 	}
 
+	/*
+	 * Attempt to get the mode list from DDC.
+	 * Assume that the preferred modes are
+	 * arranged in priority order.
+	 */
+	intel_ddc_get_modes(connector, &intel_sdvo->ddc);
+
 end:
 	list_for_each_entry(newmode, &connector->probed_modes, head) {
 		if (newmode->type & DRM_MODE_TYPE_PREFERRED) {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID
  2013-06-09 20:58 [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID Daniel Vetter
@ 2013-06-09 21:16 ` Chris Wilson
  2013-06-09 21:28   ` Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2013-06-09 21:16 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development, Egbert Eich, stable

On Sun, Jun 09, 2013 at 10:58:38PM +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
> 
> Ebgert 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.
> 
> 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>

I can accept the argument that we need to prefer the VBT mode here to
paper over the apparent regression, but to not pass on the full EDID
modes seems dubious.

Even if you do choose to skip the EDID if you have a VBT mode, you could
write the function a little cleaner. ;-)
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID
  2013-06-09 21:16 ` Chris Wilson
@ 2013-06-09 21:28   ` Daniel Vetter
  2013-06-09 22:48     ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2013-06-09 21:28 UTC (permalink / raw)
  To: Chris Wilson, Daniel Vetter, Intel Graphics Development,
	Egbert Eich, stable

On Sun, Jun 9, 2013 at 11:16 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Sun, Jun 09, 2013 at 10:58:38PM +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
>>
>> Ebgert 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.
>>
>> 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>
>
> I can accept the argument that we need to prefer the VBT mode here to
> paper over the apparent regression, but to not pass on the full EDID
> modes seems dubious.

I'm not sure there's any value in additional modes. We can't really
support frequency switching over sdvo (it'd very likely require a
mutliplier change) and for everything else we only ever let the fixed
mode through the fixup hook.

Or do you want to just add the edid so that userspace can drool in the
information provided in there (like the panel name or serial)?

> Even if you do choose to skip the EDID if you have a VBT mode, you could
> write the function a little cleaner. ;-)

I don't see the potential to improve it tbh. Care to help the numb?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID
  2013-06-09 21:28   ` Daniel Vetter
@ 2013-06-09 22:48     ` Chris Wilson
  2013-06-10  7:24       ` Egbert Eich
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2013-06-09 22:48 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development, Egbert Eich, stable

On Sun, Jun 09, 2013 at 11:28:12PM +0200, Daniel Vetter wrote:
> On Sun, Jun 9, 2013 at 11:16 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Sun, Jun 09, 2013 at 10:58:38PM +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
> >>
> >> Ebgert 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.
> >>
> >> 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>
> >
> > I can accept the argument that we need to prefer the VBT mode here to
> > paper over the apparent regression, but to not pass on the full EDID
> > modes seems dubious.
> 
> I'm not sure there's any value in additional modes. We can't really
> support frequency switching over sdvo (it'd very likely require a
> mutliplier change) and for everything else we only ever let the fixed
> mode through the fixup hook.

I am trying not to generalise from the broken behaviour on this machine.
On another machine, there may be some value in the extra modes.
Select the sanest default we can, then let the user go nuts with the
extra information.
 
> Or do you want to just add the edid so that userspace can drool in the
> information provided in there (like the panel name or serial)?

And who doesn't enjoy reading the vendor strings in the panel edid?
 
> > Even if you do choose to skip the EDID if you have a VBT mode, you could
> > write the function a little cleaner. ;-)
> 
> I don't see the potential to improve it tbh. Care to help the numb?

The goto here is a little overkill and adds more code than if you wrote
the function simply.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID
  2013-06-09 22:48     ` Chris Wilson
@ 2013-06-10  7:24       ` Egbert Eich
  2013-06-10  7:47         ` Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Egbert Eich @ 2013-06-10  7:24 UTC (permalink / raw)
  To: Chris Wilson
  Cc: Daniel Vetter, Intel Graphics Development, Egbert Eich, stable

Chris Wilson writes:
 > On Sun, Jun 09, 2013 at 11:28:12PM +0200, Daniel Vetter wrote:
 > > On Sun, Jun 9, 2013 at 11:16 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
 > > > On Sun, Jun 09, 2013 at 10:58:38PM +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
 > > >>
 > > >> Ebgert 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.
 > > >>
 > > >> 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>
 > > >
 > > > I can accept the argument that we need to prefer the VBT mode here to
 > > > paper over the apparent regression, but to not pass on the full EDID
 > > > modes seems dubious.
 > > 
 > > I'm not sure there's any value in additional modes. We can't really
 > > support frequency switching over sdvo (it'd very likely require a
 > > mutliplier change) and for everything else we only ever let the fixed
 > > mode through the fixup hook.
 > 
 > I am trying not to generalise from the broken behaviour on this machine.
 > On another machine, there may be some value in the extra modes.
 > Select the sanest default we can, then let the user go nuts with the
 > extra information.

While I'm not a fan of setting non-native modes on panels this seems
to be a requirement in some environments - not sure if there are any
real world use cases but at least many QA test scenarios seem to include 
such modes.
So adding the EDID modes (unflagging the preferred bit!) would be what 
I'd opt for - admittedly for a very selfish reason: it will spare me 
of lengthy, pointless discussions with some partners' QA departments 
next time we update the Intel driver.

Once again we go out of our ways to accomodate the most broken
devices by imposing more limitations on all others as well. At 
one point we may even have to give in face the grim reality and 
start blacklisting some of the broken crap.

And since we are so much into bikeshedding here - maybe you could
fix my name in the comment ;)

Cheers,
	Egbert.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID
  2013-06-10  7:24       ` Egbert Eich
@ 2013-06-10  7:47         ` Daniel Vetter
  2013-06-10  8:10           ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2013-06-10  7:47 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Egbert Eich, Chris Wilson, stable

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(-)

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 =
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID
  2013-06-10  7:47         ` Daniel Vetter
@ 2013-06-10  8:10           ` Chris Wilson
  2013-06-10  8:17             ` Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2013-06-10  8:10 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development, Egbert Eich, stable

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

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID
  2013-06-10  8:10           ` Chris Wilson
@ 2013-06-10  8:17             ` Daniel Vetter
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2013-06-10  8:17 UTC (permalink / raw)
  To: Chris Wilson, Daniel Vetter, Intel Graphics Development,
	Egbert Eich, stable

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
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-10  8:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-09 20:58 [PATCH] drm/i915: prefer VBT modes for SVDO-LVDS over EDID Daniel Vetter
2013-06-09 21:16 ` Chris Wilson
2013-06-09 21:28   ` Daniel Vetter
2013-06-09 22:48     ` Chris Wilson
2013-06-10  7:24       ` Egbert Eich
2013-06-10  7:47         ` Daniel Vetter
2013-06-10  8:10           ` Chris Wilson
2013-06-10  8:17             ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.