All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/bxt: Force port A DDI to use 4 lanes
@ 2015-11-05 22:53 Matt Roper
  2015-11-06  0:20 ` Bob Paauwe
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Roper @ 2015-11-05 22:53 UTC (permalink / raw)
  To: intel-gfx

The bspec indicates that DDI A using four lanes is the only valid
configuration for Broxton (Broxton doesn't have a DDI E to split these
lanes with); the DDI_A_4_LANES bit of port A's DDI_BUF_CTL should always
be set by the BIOS.  However some BIOS versions seem to only be setting
this bit if eDP is actually lit up at boot time; if the BIOS doesn't
turn on the eDP panel because an external display is plugged in, then
this bit is never properly initialized.  The end result of this is that
we wind up calculating a lower max data rate than we should and may wind
up rejecting the native mode for panels that we should be able to drive.

Let's workaround this BIOS bug by just turning the DDI_A_4_LANES bit on
in our driver's internal state if we recognize that're running on BXT
where it should have been on anyway.

Cc: Imre Deak <imre.deak@intel.com>
Cc: Bob Paauwe <bob.j.paauwe@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index b164122..672b86c 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -3234,6 +3234,19 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
 					  (DDI_BUF_PORT_REVERSAL |
 					   DDI_A_4_LANES);
 
+	/*
+	 * Bspec says that DDI_A_4_LANES is the only supported configuration
+	 * for Broxton.  Yet some BIOS fail to set this bit on port A if eDP
+	 * wasn't lit up at boot.  Force this bit on in our internal
+	 * configuration so that we use the proper lane count for our
+	 * calculations.
+	 */
+	if (IS_BROXTON(dev) && port == PORT_A)
+	    if (!(intel_dig_port->saved_port_bits & DDI_A_4_LANES)) {
+		DRM_DEBUG_KMS("BXT BIOS forgot to set DDI_A_4_LANES for port A; fixing\n");
+		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
+	}
+
 	intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
 	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
 	intel_encoder->cloneable = 0;
-- 
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] 2+ messages in thread

* Re: [PATCH] drm/i915/bxt: Force port A DDI to use 4 lanes
  2015-11-05 22:53 [PATCH] drm/i915/bxt: Force port A DDI to use 4 lanes Matt Roper
@ 2015-11-06  0:20 ` Bob Paauwe
  0 siblings, 0 replies; 2+ messages in thread
From: Bob Paauwe @ 2015-11-06  0:20 UTC (permalink / raw)
  To: Matt Roper; +Cc: intel-gfx

On Thu, 5 Nov 2015 14:53:32 -0800
Matt Roper <matthew.d.roper@intel.com> wrote:

> The bspec indicates that DDI A using four lanes is the only valid
> configuration for Broxton (Broxton doesn't have a DDI E to split these
> lanes with); the DDI_A_4_LANES bit of port A's DDI_BUF_CTL should always
> be set by the BIOS.  However some BIOS versions seem to only be setting
> this bit if eDP is actually lit up at boot time; if the BIOS doesn't
> turn on the eDP panel because an external display is plugged in, then
> this bit is never properly initialized.  The end result of this is that
> we wind up calculating a lower max data rate than we should and may wind
> up rejecting the native mode for panels that we should be able to drive.
> 
> Let's workaround this BIOS bug by just turning the DDI_A_4_LANES bit on
> in our driver's internal state if we recognize that're running on BXT
> where it should have been on anyway.
> 
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Bob Paauwe <bob.j.paauwe@intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index b164122..672b86c 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -3234,6 +3234,19 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
>  					  (DDI_BUF_PORT_REVERSAL |
>  					   DDI_A_4_LANES);
>  
> +	/*
> +	 * Bspec says that DDI_A_4_LANES is the only supported configuration
> +	 * for Broxton.  Yet some BIOS fail to set this bit on port A if eDP
> +	 * wasn't lit up at boot.  Force this bit on in our internal
> +	 * configuration so that we use the proper lane count for our
> +	 * calculations.
> +	 */
> +	if (IS_BROXTON(dev) && port == PORT_A)
> +	    if (!(intel_dig_port->saved_port_bits & DDI_A_4_LANES)) {
> +		DRM_DEBUG_KMS("BXT BIOS forgot to set DDI_A_4_LANES for port A; fixing\n");
> +		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
> +	}

The brace isn't lined up with the proper if.

> +
>  	intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
>  	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
>  	intel_encoder->cloneable = 0;

With the above formatting fixed.
Reviewed-by: Bob Paauwe <bob.j.paauwe@intel.com>
Tested-by: Bob Paauwe <bob.j.paauwe@intel.com>

-- 
--
Bob Paauwe                  
Bob.J.Paauwe@intel.com
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

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

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-05 22:53 [PATCH] drm/i915/bxt: Force port A DDI to use 4 lanes Matt Roper
2015-11-06  0:20 ` Bob Paauwe

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.