All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Ignore LVDS presence in VBT flag if the LVDS is enabled by BIOS
@ 2015-06-19 12:57 Chris Wilson
  2015-06-22 13:17 ` Damien Lespiau
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2015-06-19 12:57 UTC (permalink / raw)
  To: intel-gfx

On older gen, pre-Ironlake, parts there is no hardwired pin to report
the presence of an LVDS panel. Instead, we have to rely on the VBT to
declare whether the machine has a panel or not. Though notoriously
unreliable, so far we have erred on the side of false-positives and have
required a list of machines which end up falsely reporting a panel as
present. However, we now have reports of false-negatives, machines with
an LVDS that are being ignored due to the VBT not declaring the panel.
This patch ignores the VBT setting if the BIOS has already enabled the
LVDS panel (and on Ironlake+ we also have the hardware presence pin).

It fixes the Samsung NP680Z5E-X01FR in the bug report, but is likely to
result in more false-positives, and since we rely on the BIOS to enable
the panel, there are likely different circumstances where the BIOS will
not enable that panel (and so we may see the same machine with and
without a panel all on the whim of the BIOS).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90979
Reported-and-tested-by: lysxia@gmail.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_lvds.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 161ab26f81fb..bf1702a6e33d 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -942,12 +942,6 @@ void intel_lvds_init(struct drm_device *dev)
 	if (dmi_check_system(intel_no_lvds))
 		return;
 
-	pin = GMBUS_PIN_PANEL;
-	if (!lvds_is_present_in_vbt(dev, &pin)) {
-		DRM_DEBUG_KMS("LVDS is not present in VBT\n");
-		return;
-	}
-
 	if (HAS_PCH_SPLIT(dev)) {
 		if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0)
 			return;
@@ -957,6 +951,16 @@ void intel_lvds_init(struct drm_device *dev)
 		}
 	}
 
+	pin = GMBUS_PIN_PANEL;
+	if (!lvds_is_present_in_vbt(dev, &pin)) {
+		u32 reg = HAS_PCH_SPLIT(dev) ? PCH_LVDS : LVDS;
+		if ((I915_READ(reg) & LVDS_PORT_EN) == 0) {
+			DRM_DEBUG_KMS("LVDS is not present in VBT\n");
+			return;
+		}
+		DRM_DEBUG_KMS("LVDS is not present in VBT, but enabled anyway\n");
+	}
+
 	lvds_encoder = kzalloc(sizeof(*lvds_encoder), GFP_KERNEL);
 	if (!lvds_encoder)
 		return;
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Ignore LVDS presence in VBT flag if the LVDS is enabled by BIOS
  2015-06-19 12:57 [PATCH] drm/i915: Ignore LVDS presence in VBT flag if the LVDS is enabled by BIOS Chris Wilson
@ 2015-06-22 13:17 ` Damien Lespiau
  2015-06-22 14:14   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Damien Lespiau @ 2015-06-22 13:17 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Fri, Jun 19, 2015 at 01:57:43PM +0100, Chris Wilson wrote:
> On older gen, pre-Ironlake, parts there is no hardwired pin to report
> the presence of an LVDS panel. Instead, we have to rely on the VBT to
> declare whether the machine has a panel or not. Though notoriously
> unreliable, so far we have erred on the side of false-positives and have
> required a list of machines which end up falsely reporting a panel as
> present. However, we now have reports of false-negatives, machines with
> an LVDS that are being ignored due to the VBT not declaring the panel.
> This patch ignores the VBT setting if the BIOS has already enabled the
> LVDS panel (and on Ironlake+ we also have the hardware presence pin).
> 
> It fixes the Samsung NP680Z5E-X01FR in the bug report, but is likely to
> result in more false-positives, and since we rely on the BIOS to enable
> the panel, there are likely different circumstances where the BIOS will
> not enable that panel (and so we may see the same machine with and
> without a panel all on the whim of the BIOS).
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90979
> Reported-and-tested-by: lysxia@gmail.com
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_lvds.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index 161ab26f81fb..bf1702a6e33d 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -942,12 +942,6 @@ void intel_lvds_init(struct drm_device *dev)
>  	if (dmi_check_system(intel_no_lvds))
>  		return;
>  
> -	pin = GMBUS_PIN_PANEL;
> -	if (!lvds_is_present_in_vbt(dev, &pin)) {
> -		DRM_DEBUG_KMS("LVDS is not present in VBT\n");
> -		return;
> -	}
> -
>  	if (HAS_PCH_SPLIT(dev)) {
>  		if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0)
>  			return;
> @@ -957,6 +951,16 @@ void intel_lvds_init(struct drm_device *dev)
>  		}
>  	}
>  
> +	pin = GMBUS_PIN_PANEL;
> +	if (!lvds_is_present_in_vbt(dev, &pin)) {
> +		u32 reg = HAS_PCH_SPLIT(dev) ? PCH_LVDS : LVDS;
> +		if ((I915_READ(reg) & LVDS_PORT_EN) == 0) {
> +			DRM_DEBUG_KMS("LVDS is not present in VBT\n");
> +			return;
> +		}
> +		DRM_DEBUG_KMS("LVDS is not present in VBT, but enabled anyway\n");
> +	}
> +
>  	lvds_encoder = kzalloc(sizeof(*lvds_encoder), GFP_KERNEL);
>  	if (!lvds_encoder)
>  		return;
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Ignore LVDS presence in VBT flag if the LVDS is enabled by BIOS
  2015-06-22 13:17 ` Damien Lespiau
@ 2015-06-22 14:14   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2015-06-22 14:14 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx

On Mon, Jun 22, 2015 at 02:17:16PM +0100, Damien Lespiau wrote:
> On Fri, Jun 19, 2015 at 01:57:43PM +0100, Chris Wilson wrote:
> > On older gen, pre-Ironlake, parts there is no hardwired pin to report
> > the presence of an LVDS panel. Instead, we have to rely on the VBT to
> > declare whether the machine has a panel or not. Though notoriously
> > unreliable, so far we have erred on the side of false-positives and have
> > required a list of machines which end up falsely reporting a panel as
> > present. However, we now have reports of false-negatives, machines with
> > an LVDS that are being ignored due to the VBT not declaring the panel.
> > This patch ignores the VBT setting if the BIOS has already enabled the
> > LVDS panel (and on Ironlake+ we also have the hardware presence pin).
> > 
> > It fixes the Samsung NP680Z5E-X01FR in the bug report, but is likely to
> > result in more false-positives, and since we rely on the BIOS to enable
> > the panel, there are likely different circumstances where the BIOS will
> > not enable that panel (and so we may see the same machine with and
> > without a panel all on the whim of the BIOS).
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90979
> > Reported-and-tested-by: lysxia@gmail.com
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> 
> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

On popular request (Jani) queued for -next for a bit of soaking time,
thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-06-22 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-19 12:57 [PATCH] drm/i915: Ignore LVDS presence in VBT flag if the LVDS is enabled by BIOS Chris Wilson
2015-06-22 13:17 ` Damien Lespiau
2015-06-22 14:14   ` 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.