intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/icl: remove port A/E lane sharing limitation.
@ 2018-01-30  9:21 Mahesh Kumar
  2018-01-30 19:52 ` Pandiyan, Dhinakaran
  0 siblings, 1 reply; 9+ messages in thread
From: Mahesh Kumar @ 2018-01-30  9:21 UTC (permalink / raw)
  To: intel-gfx

From: "Kumar, Mahesh" <mahesh1.kumar@intel.com>

Platforms before Gen11 were sharing lanes between port-A & port-E.
This limitation is no more there.

Changes since V1:
 - optimize the code (Shashank/Jani)
 - create helper function to get max lanes (ville)

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 43 +++++++++++++++++-----------------------
 1 file changed, 18 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index e51559be2e3b..4bde742a8ff4 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2842,6 +2842,23 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
 	return false;
 }
 
+static int
+intel_ddi_max_lanes(struct drm_i915_private *dev_priv, enum port port)
+{
+	if (INTEL_GEN(dev_priv) >= 11)
+		return 4;
+
+	if (port == PORT_A || port == PORT_E) {
+		if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
+			return port == PORT_A ? 4 : 0;
+		else
+			/* Both A and E share 2 lanes */
+			return 2;
+	}
+
+	return 4;
+}
+
 void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 {
 	struct intel_digital_port *intel_dig_port;
@@ -2850,31 +2867,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 	bool init_hdmi, init_dp, init_lspcon = false;
 	int max_lanes;
 
-	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
-		switch (port) {
-		case PORT_A:
-			max_lanes = 4;
-			break;
-		case PORT_E:
-			max_lanes = 0;
-			break;
-		default:
-			max_lanes = 4;
-			break;
-		}
-	} else {
-		switch (port) {
-		case PORT_A:
-			max_lanes = 2;
-			break;
-		case PORT_E:
-			max_lanes = 2;
-			break;
-		default:
-			max_lanes = 4;
-			break;
-		}
-	}
+	max_lanes = intel_ddi_max_lanes(dev_priv, port);
 
 	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
 		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
-- 
2.14.1

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

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

* Re: [PATCH] drm/i915/icl: remove port A/E lane sharing limitation.
  2018-01-30  9:21 [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Mahesh Kumar
@ 2018-01-30 19:52 ` Pandiyan, Dhinakaran
  2018-01-30 20:13   ` Ville Syrjälä
  0 siblings, 1 reply; 9+ messages in thread
From: Pandiyan, Dhinakaran @ 2018-01-30 19:52 UTC (permalink / raw)
  To: Kumar, Mahesh1; +Cc: intel-gfx@lists.freedesktop.org


On Tue, 2018-01-30 at 14:51 +0530, Mahesh Kumar wrote:
> From: "Kumar, Mahesh" <mahesh1.kumar@intel.com>
> 
> Platforms before Gen11 were sharing lanes between port-A & port-E.
> This limitation is no more there.
> 
> Changes since V1:
>  - optimize the code (Shashank/Jani)
>  - create helper function to get max lanes (ville)
> 
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 43 +++++++++++++++++-----------------------
>  1 file changed, 18 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index e51559be2e3b..4bde742a8ff4 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2842,6 +2842,23 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
>  	return false;
>  }
>  
> +static int
> +intel_ddi_max_lanes(struct drm_i915_private *dev_priv, enum port port)
> +{
> +	if (INTEL_GEN(dev_priv) >= 11)
> +		return 4;
> +
> +	if (port == PORT_A || port == PORT_E) {
> +		if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)


Is the expectation that bios has already written the correct value
depending on the board?

The patch itself looks correct 
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>



> +			return port == PORT_A ? 4 : 0;
> +		else
> +			/* Both A and E share 2 lanes */
> +			return 2;
> +	}
> +
> +	return 4;
> +}
> +
>  void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>  {
>  	struct intel_digital_port *intel_dig_port;
> @@ -2850,31 +2867,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>  	bool init_hdmi, init_dp, init_lspcon = false;
>  	int max_lanes;
>  
> -	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
> -		switch (port) {
> -		case PORT_A:
> -			max_lanes = 4;
> -			break;
> -		case PORT_E:
> -			max_lanes = 0;
> -			break;
> -		default:
> -			max_lanes = 4;
> -			break;
> -		}
> -	} else {
> -		switch (port) {
> -		case PORT_A:
> -			max_lanes = 2;
> -			break;
> -		case PORT_E:
> -			max_lanes = 2;
> -			break;
> -		default:
> -			max_lanes = 4;
> -			break;
> -		}
> -	}
> +	max_lanes = intel_ddi_max_lanes(dev_priv, port);
>  
>  	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
>  		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/icl: remove port A/E lane sharing limitation.
  2018-01-30 19:52 ` Pandiyan, Dhinakaran
@ 2018-01-30 20:13   ` Ville Syrjälä
  0 siblings, 0 replies; 9+ messages in thread
From: Ville Syrjälä @ 2018-01-30 20:13 UTC (permalink / raw)
  To: Pandiyan, Dhinakaran; +Cc: intel-gfx@lists.freedesktop.org

On Tue, Jan 30, 2018 at 07:52:14PM +0000, Pandiyan, Dhinakaran wrote:
> 
> On Tue, 2018-01-30 at 14:51 +0530, Mahesh Kumar wrote:
> > From: "Kumar, Mahesh" <mahesh1.kumar@intel.com>
> > 
> > Platforms before Gen11 were sharing lanes between port-A & port-E.
> > This limitation is no more there.
> > 
> > Changes since V1:
> >  - optimize the code (Shashank/Jani)
> >  - create helper function to get max lanes (ville)
> > 
> > Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_ddi.c | 43 +++++++++++++++++-----------------------
> >  1 file changed, 18 insertions(+), 25 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> > index e51559be2e3b..4bde742a8ff4 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -2842,6 +2842,23 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
> >  	return false;
> >  }
> >  
> > +static int
> > +intel_ddi_max_lanes(struct drm_i915_private *dev_priv, enum port port)
> > +{
> > +	if (INTEL_GEN(dev_priv) >= 11)
> > +		return 4;
> > +
> > +	if (port == PORT_A || port == PORT_E) {
> > +		if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
> 
> 
> Is the expectation that bios has already written the correct value
> depending on the board?

We have a fixup later on for BIOS fails. Might be nice to try and
pull that in as well so that we would have all the logic in one
clear place.

> 
> The patch itself looks correct 
> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> 
> 
> 
> > +			return port == PORT_A ? 4 : 0;
> > +		else
> > +			/* Both A and E share 2 lanes */
> > +			return 2;
> > +	}
> > +
> > +	return 4;
> > +}
> > +
> >  void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> >  {
> >  	struct intel_digital_port *intel_dig_port;
> > @@ -2850,31 +2867,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> >  	bool init_hdmi, init_dp, init_lspcon = false;
> >  	int max_lanes;
> >  
> > -	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
> > -		switch (port) {
> > -		case PORT_A:
> > -			max_lanes = 4;
> > -			break;
> > -		case PORT_E:
> > -			max_lanes = 0;
> > -			break;
> > -		default:
> > -			max_lanes = 4;
> > -			break;
> > -		}
> > -	} else {
> > -		switch (port) {
> > -		case PORT_A:
> > -			max_lanes = 2;
> > -			break;
> > -		case PORT_E:
> > -			max_lanes = 2;
> > -			break;
> > -		default:
> > -			max_lanes = 4;
> > -			break;
> > -		}
> > -	}
> > +	max_lanes = intel_ddi_max_lanes(dev_priv, port);
> >  
> >  	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
> >  		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH] drm/i915/icl: remove port A/E lane sharing limitation.
@ 2018-02-02 12:21 Mahesh Kumar
  2018-02-02 12:40 ` ✓ Fi.CI.BAT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mahesh Kumar @ 2018-02-02 12:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: dinakaran.pandiyan

Platforms before Gen11 were sharing lanes between port-A & port-E.
This limitation is no more there.

Changes since V1:
 - optimize the code (Shashank/Jani)
 - create helper function to get max lanes (ville)
Changes since V2:
 - Include BIOS fail fix-up in same helper function (ville)

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 71 +++++++++++++++++++---------------------
 1 file changed, 33 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index cfcd9cb37d5d..ee9ba78d19c8 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2842,39 +2842,44 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
 	return false;
 }
 
+static int
+intel_ddi_max_lanes(struct drm_i915_private *dev_priv,
+		    struct intel_digital_port *intel_dig_port)
+{
+	enum port port = intel_dig_port->base.port;
+	int max_lanes = 4;
+
+	if (INTEL_GEN(dev_priv) >= 11) {
+		return 4;
+	} else if (port == PORT_A || port == PORT_E) {
+		if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
+			max_lanes = port == PORT_A ? 4 : 0;
+		else
+			/* Both A and E share 2 lanes */
+			max_lanes = 2;
+	}
+
+	/*
+	 * Some BIOS might fail to set this bit on port A if eDP
+	 * wasn't lit up at boot.  Force this bit set when needed
+	 * so we use the proper lane count for our calculations.
+	 */
+	if (intel_ddi_a_force_4_lanes(intel_dig_port)) {
+		DRM_DEBUG_KMS("Forcing DDI_A_4_LANES for port A\n");
+		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
+		max_lanes = 4;
+	}
+
+	return max_lanes;
+}
+
 void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 {
 	struct intel_digital_port *intel_dig_port;
 	struct intel_encoder *intel_encoder;
 	struct drm_encoder *encoder;
 	bool init_hdmi, init_dp, init_lspcon = false;
-	int max_lanes;
 
-	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
-		switch (port) {
-		case PORT_A:
-			max_lanes = 4;
-			break;
-		case PORT_E:
-			max_lanes = 0;
-			break;
-		default:
-			max_lanes = 4;
-			break;
-		}
-	} else {
-		switch (port) {
-		case PORT_A:
-			max_lanes = 2;
-			break;
-		case PORT_E:
-			max_lanes = 2;
-			break;
-		default:
-			max_lanes = 4;
-			break;
-		}
-	}
 
 	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
 		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
@@ -2954,19 +2959,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 		MISSING_CASE(port);
 	}
 
-	/*
-	 * Some BIOS might fail to set this bit on port A if eDP
-	 * wasn't lit up at boot.  Force this bit set when needed
-	 * so we use the proper lane count for our calculations.
-	 */
-	if (intel_ddi_a_force_4_lanes(intel_dig_port)) {
-		DRM_DEBUG_KMS("Forcing DDI_A_4_LANES for port A\n");
-		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
-		max_lanes = 4;
-	}
-
 	intel_dig_port->dp.output_reg = INVALID_MMIO_REG;
-	intel_dig_port->max_lanes = max_lanes;
 
 	intel_encoder->type = INTEL_OUTPUT_DDI;
 	intel_encoder->power_domain = intel_port_to_power_domain(port);
@@ -2974,6 +2967,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
 	intel_encoder->cloneable = 0;
 
+	intel_dig_port->max_lanes = intel_ddi_max_lanes(dev_priv,
+							intel_dig_port);
 	intel_infoframe_init(intel_dig_port);
 
 	if (init_dp) {
-- 
2.14.1

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

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

* ✓ Fi.CI.BAT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2)
  2018-02-02 12:21 [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Mahesh Kumar
@ 2018-02-02 12:40 ` Patchwork
  2018-02-02 12:56 ` [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Jani Nikula
  2018-02-02 13:42 ` ✓ Fi.CI.IGT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2) Patchwork
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-02-02 12:40 UTC (permalink / raw)
  To: Mahesh Kumar; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: remove port A/E lane sharing limitation. (rev2)
URL   : https://patchwork.freedesktop.org/series/37325/
State : success

== Summary ==

Series 37325v2 drm/i915/icl: remove port A/E lane sharing limitation.
https://patchwork.freedesktop.org/api/1.0/series/37325/revisions/2/mbox/

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:419s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:427s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:371s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:493s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:283s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:485s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:470s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:456s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:561s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:415s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:280s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:514s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:390s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:398s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:419s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:459s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:456s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:494s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:455s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:582s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:432s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:528s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:484s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:481s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:415s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:428s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:402s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:469s

e1b21c16bfafa4fb3b3b656fcd44c901e558a111 drm-tip: 2018y-02m-02d-08h-21m-34s UTC integration manifest
a9f415e56773 drm/i915/icl: remove port A/E lane sharing limitation.

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7859/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/icl: remove port A/E lane sharing limitation.
  2018-02-02 12:21 [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Mahesh Kumar
  2018-02-02 12:40 ` ✓ Fi.CI.BAT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2) Patchwork
@ 2018-02-02 12:56 ` Jani Nikula
  2018-02-05  9:34   ` Kumar, Mahesh
  2018-02-02 13:42 ` ✓ Fi.CI.IGT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2) Patchwork
  2 siblings, 1 reply; 9+ messages in thread
From: Jani Nikula @ 2018-02-02 12:56 UTC (permalink / raw)
  To: Mahesh Kumar, intel-gfx; +Cc: dinakaran.pandiyan

On Fri, 02 Feb 2018, Mahesh Kumar <mahesh1.kumar@intel.com> wrote:
> Platforms before Gen11 were sharing lanes between port-A & port-E.
> This limitation is no more there.
>
> Changes since V1:
>  - optimize the code (Shashank/Jani)
>  - create helper function to get max lanes (ville)
> Changes since V2:
>  - Include BIOS fail fix-up in same helper function (ville)
>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 71 +++++++++++++++++++---------------------
>  1 file changed, 33 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index cfcd9cb37d5d..ee9ba78d19c8 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2842,39 +2842,44 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
>  	return false;
>  }
>  
> +static int
> +intel_ddi_max_lanes(struct drm_i915_private *dev_priv,
> +		    struct intel_digital_port *intel_dig_port)
> +{

Please ditch the dev_priv parameter and add:

	struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);

> +	enum port port = intel_dig_port->base.port;
> +	int max_lanes = 4;

Unnecessary initialization.

> +
> +	if (INTEL_GEN(dev_priv) >= 11) {
> +		return 4;

Please either set max_lanes = 4 here, or remove the else. On early
returns, you don't need the else. Having both is confusing.

> +	} else if (port == PORT_A || port == PORT_E) {
> +		if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
> +			max_lanes = port == PORT_A ? 4 : 0;
> +		else
> +			/* Both A and E share 2 lanes */
> +			max_lanes = 2;
> +	}
> +
> +	/*
> +	 * Some BIOS might fail to set this bit on port A if eDP
> +	 * wasn't lit up at boot.  Force this bit set when needed
> +	 * so we use the proper lane count for our calculations.
> +	 */
> +	if (intel_ddi_a_force_4_lanes(intel_dig_port)) {
> +		DRM_DEBUG_KMS("Forcing DDI_A_4_LANES for port A\n");
> +		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
> +		max_lanes = 4;
> +	}
> +
> +	return max_lanes;
> +}
> +
>  void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>  {
>  	struct intel_digital_port *intel_dig_port;
>  	struct intel_encoder *intel_encoder;
>  	struct drm_encoder *encoder;
>  	bool init_hdmi, init_dp, init_lspcon = false;
> -	int max_lanes;
>  
> -	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
> -		switch (port) {
> -		case PORT_A:
> -			max_lanes = 4;
> -			break;
> -		case PORT_E:
> -			max_lanes = 0;
> -			break;
> -		default:
> -			max_lanes = 4;
> -			break;
> -		}
> -	} else {
> -		switch (port) {
> -		case PORT_A:
> -			max_lanes = 2;
> -			break;
> -		case PORT_E:
> -			max_lanes = 2;
> -			break;
> -		default:
> -			max_lanes = 4;
> -			break;
> -		}
> -	}
>  
>  	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
>  		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
> @@ -2954,19 +2959,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>  		MISSING_CASE(port);
>  	}
>  
> -	/*
> -	 * Some BIOS might fail to set this bit on port A if eDP
> -	 * wasn't lit up at boot.  Force this bit set when needed
> -	 * so we use the proper lane count for our calculations.
> -	 */
> -	if (intel_ddi_a_force_4_lanes(intel_dig_port)) {
> -		DRM_DEBUG_KMS("Forcing DDI_A_4_LANES for port A\n");
> -		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
> -		max_lanes = 4;
> -	}
> -
>  	intel_dig_port->dp.output_reg = INVALID_MMIO_REG;
> -	intel_dig_port->max_lanes = max_lanes;
>  
>  	intel_encoder->type = INTEL_OUTPUT_DDI;
>  	intel_encoder->power_domain = intel_port_to_power_domain(port);
> @@ -2974,6 +2967,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>  	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
>  	intel_encoder->cloneable = 0;
>  
> +	intel_dig_port->max_lanes = intel_ddi_max_lanes(dev_priv,
> +							intel_dig_port);

Please keep this at the original location above.

BR,
Jani.

>  	intel_infoframe_init(intel_dig_port);
>  
>  	if (init_dp) {

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2)
  2018-02-02 12:21 [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Mahesh Kumar
  2018-02-02 12:40 ` ✓ Fi.CI.BAT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2) Patchwork
  2018-02-02 12:56 ` [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Jani Nikula
@ 2018-02-02 13:42 ` Patchwork
  2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-02-02 13:42 UTC (permalink / raw)
  To: Mahesh Kumar; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: remove port A/E lane sharing limitation. (rev2)
URL   : https://patchwork.freedesktop.org/series/37325/
State : success

== Summary ==

Test kms_flip:
        Subgroup plain-flip-ts-check:
                pass       -> FAIL       (shard-hsw) fdo#100368
        Subgroup dpms-vs-vblank-race-interruptible:
                pass       -> FAIL       (shard-snb) fdo#103060
Test kms_vblank:
        Subgroup pipe-a-ts-continuation-suspend:
                fail       -> PASS       (shard-hsw) fdo#104783
Test perf:
        Subgroup blocking:
                fail       -> PASS       (shard-hsw) fdo#102252
        Subgroup oa-exponents:
                fail       -> PASS       (shard-apl) fdo#102254
        Subgroup buffer-fill:
                pass       -> FAIL       (shard-apl) fdo#103755
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-shrfb-msflip-blt:
                pass       -> DMESG-FAIL (shard-apl) fdo#101623 +2
        Subgroup fbc-1p-shrfb-fliptrack:
                pass       -> FAIL       (shard-apl) fdo#103167
Test gem_eio:
        Subgroup in-flight-contexts:
                pass       -> DMESG-WARN (shard-snb) fdo#104058
Test kms_atomic_transition:
        Subgroup plane-all-transition:
                skip       -> PASS       (shard-snb)
Test drv_selftest:
        Subgroup live_gtt:
                pass       -> INCOMPLETE (shard-apl) fdo#103927

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#104783 https://bugs.freedesktop.org/show_bug.cgi?id=104783
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927

shard-apl        total:2814 pass:1722 dwarn:1   dfail:1   fail:25  skip:1064 time:11949s
shard-hsw        total:2836 pass:1732 dwarn:1   dfail:0   fail:12  skip:1090 time:11556s
shard-snb        total:2836 pass:1326 dwarn:2   dfail:0   fail:11  skip:1497 time:6476s
Blacklisted hosts:
shard-kbl        total:2836 pass:1873 dwarn:1   dfail:0   fail:22  skip:940 time:9434s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7859/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/icl: remove port A/E lane sharing limitation.
  2018-02-02 12:56 ` [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Jani Nikula
@ 2018-02-05  9:34   ` Kumar, Mahesh
  2018-02-05 10:03     ` Jani Nikula
  0 siblings, 1 reply; 9+ messages in thread
From: Kumar, Mahesh @ 2018-02-05  9:34 UTC (permalink / raw)
  To: Jani Nikula, intel-gfx; +Cc: dinakaran.pandiyan

Hi,


On 2/2/2018 6:26 PM, Jani Nikula wrote:
> On Fri, 02 Feb 2018, Mahesh Kumar <mahesh1.kumar@intel.com> wrote:
>> Platforms before Gen11 were sharing lanes between port-A & port-E.
>> This limitation is no more there.
>>
>> Changes since V1:
>>   - optimize the code (Shashank/Jani)
>>   - create helper function to get max lanes (ville)
>> Changes since V2:
>>   - Include BIOS fail fix-up in same helper function (ville)
>>
>> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
>> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_ddi.c | 71 +++++++++++++++++++---------------------
>>   1 file changed, 33 insertions(+), 38 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
>> index cfcd9cb37d5d..ee9ba78d19c8 100644
>> --- a/drivers/gpu/drm/i915/intel_ddi.c
>> +++ b/drivers/gpu/drm/i915/intel_ddi.c
>> @@ -2842,39 +2842,44 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
>>   	return false;
>>   }
>>   
>> +static int
>> +intel_ddi_max_lanes(struct drm_i915_private *dev_priv,
>> +		    struct intel_digital_port *intel_dig_port)
>> +{
> Please ditch the dev_priv parameter and add:
>
> 	struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
ok, sure.
>
>> +	enum port port = intel_dig_port->base.port;
>> +	int max_lanes = 4;
> Unnecessary initialization.
for ports other than PORT_A/E will have max_lanes=4 that's the reason 
initializing it here, will fix the usages.
>
>> +
>> +	if (INTEL_GEN(dev_priv) >= 11) {
>> +		return 4;
> Please either set max_lanes = 4 here, or remove the else. On early
> returns, you don't need the else. Having both is confusing.
yes, agree, will remove the else
>
>> +	} else if (port == PORT_A || port == PORT_E) {
>> +		if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
>> +			max_lanes = port == PORT_A ? 4 : 0;
>> +		else
>> +			/* Both A and E share 2 lanes */
>> +			max_lanes = 2;
>> +	}
>> +
>> +	/*
>> +	 * Some BIOS might fail to set this bit on port A if eDP
>> +	 * wasn't lit up at boot.  Force this bit set when needed
>> +	 * so we use the proper lane count for our calculations.
>> +	 */
>> +	if (intel_ddi_a_force_4_lanes(intel_dig_port)) {
>> +		DRM_DEBUG_KMS("Forcing DDI_A_4_LANES for port A\n");
>> +		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
>> +		max_lanes = 4;
>> +	}
>> +
>> +	return max_lanes;
>> +}
>> +
>>   void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>>   {
>>   	struct intel_digital_port *intel_dig_port;
>>   	struct intel_encoder *intel_encoder;
>>   	struct drm_encoder *encoder;
>>   	bool init_hdmi, init_dp, init_lspcon = false;
>> -	int max_lanes;
>>   
>> -	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
>> -		switch (port) {
>> -		case PORT_A:
>> -			max_lanes = 4;
>> -			break;
>> -		case PORT_E:
>> -			max_lanes = 0;
>> -			break;
>> -		default:
>> -			max_lanes = 4;
>> -			break;
>> -		}
>> -	} else {
>> -		switch (port) {
>> -		case PORT_A:
>> -			max_lanes = 2;
>> -			break;
>> -		case PORT_E:
>> -			max_lanes = 2;
>> -			break;
>> -		default:
>> -			max_lanes = 4;
>> -			break;
>> -		}
>> -	}
>>   
>>   	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
>>   		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
>> @@ -2954,19 +2959,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>>   		MISSING_CASE(port);
>>   	}
>>   
>> -	/*
>> -	 * Some BIOS might fail to set this bit on port A if eDP
>> -	 * wasn't lit up at boot.  Force this bit set when needed
>> -	 * so we use the proper lane count for our calculations.
>> -	 */
>> -	if (intel_ddi_a_force_4_lanes(intel_dig_port)) {
>> -		DRM_DEBUG_KMS("Forcing DDI_A_4_LANES for port A\n");
>> -		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
>> -		max_lanes = 4;
>> -	}
>> -
>>   	intel_dig_port->dp.output_reg = INVALID_MMIO_REG;
>> -	intel_dig_port->max_lanes = max_lanes;
>>   
>>   	intel_encoder->type = INTEL_OUTPUT_DDI;
>>   	intel_encoder->power_domain = intel_port_to_power_domain(port);
>> @@ -2974,6 +2967,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>>   	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
>>   	intel_encoder->cloneable = 0;
>>   
>> +	intel_dig_port->max_lanes = intel_ddi_max_lanes(dev_priv,
>> +							intel_dig_port);
> Please keep this at the original location above.
I moved this here because intel_encoder->port was not initialized in 
original location, will pass port along with intel_dig_port & move it to 
original location.
Thanks for review.

-Mahesh
>
> BR,
> Jani.
>
>>   	intel_infoframe_init(intel_dig_port);
>>   
>>   	if (init_dp) {

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

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

* Re: [PATCH] drm/i915/icl: remove port A/E lane sharing limitation.
  2018-02-05  9:34   ` Kumar, Mahesh
@ 2018-02-05 10:03     ` Jani Nikula
  0 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2018-02-05 10:03 UTC (permalink / raw)
  To: Kumar, Mahesh, intel-gfx; +Cc: dinakaran.pandiyan

On Mon, 05 Feb 2018, "Kumar, Mahesh" <mahesh1.kumar@intel.com> wrote:
> Hi,
>
>
> On 2/2/2018 6:26 PM, Jani Nikula wrote:
>> On Fri, 02 Feb 2018, Mahesh Kumar <mahesh1.kumar@intel.com> wrote:
>>> Platforms before Gen11 were sharing lanes between port-A & port-E.
>>> This limitation is no more there.
>>>
>>> Changes since V1:
>>>   - optimize the code (Shashank/Jani)
>>>   - create helper function to get max lanes (ville)
>>> Changes since V2:
>>>   - Include BIOS fail fix-up in same helper function (ville)
>>>
>>> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
>>> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/intel_ddi.c | 71 +++++++++++++++++++---------------------
>>>   1 file changed, 33 insertions(+), 38 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
>>> index cfcd9cb37d5d..ee9ba78d19c8 100644
>>> --- a/drivers/gpu/drm/i915/intel_ddi.c
>>> +++ b/drivers/gpu/drm/i915/intel_ddi.c
>>> @@ -2842,39 +2842,44 @@ static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
>>>   	return false;
>>>   }
>>>   
>>> +static int
>>> +intel_ddi_max_lanes(struct drm_i915_private *dev_priv,
>>> +		    struct intel_digital_port *intel_dig_port)
>>> +{
>> Please ditch the dev_priv parameter and add:
>>
>> 	struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
> ok, sure.
>>
>>> +	enum port port = intel_dig_port->base.port;
>>> +	int max_lanes = 4;
>> Unnecessary initialization.
> for ports other than PORT_A/E will have max_lanes=4 that's the reason 
> initializing it here, will fix the usages.
>>
>>> +
>>> +	if (INTEL_GEN(dev_priv) >= 11) {
>>> +		return 4;
>> Please either set max_lanes = 4 here, or remove the else. On early
>> returns, you don't need the else. Having both is confusing.
> yes, agree, will remove the else
>>
>>> +	} else if (port == PORT_A || port == PORT_E) {
>>> +		if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)
>>> +			max_lanes = port == PORT_A ? 4 : 0;
>>> +		else
>>> +			/* Both A and E share 2 lanes */
>>> +			max_lanes = 2;
>>> +	}
>>> +
>>> +	/*
>>> +	 * Some BIOS might fail to set this bit on port A if eDP
>>> +	 * wasn't lit up at boot.  Force this bit set when needed
>>> +	 * so we use the proper lane count for our calculations.
>>> +	 */
>>> +	if (intel_ddi_a_force_4_lanes(intel_dig_port)) {
>>> +		DRM_DEBUG_KMS("Forcing DDI_A_4_LANES for port A\n");
>>> +		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
>>> +		max_lanes = 4;
>>> +	}
>>> +
>>> +	return max_lanes;
>>> +}
>>> +
>>>   void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>>>   {
>>>   	struct intel_digital_port *intel_dig_port;
>>>   	struct intel_encoder *intel_encoder;
>>>   	struct drm_encoder *encoder;
>>>   	bool init_hdmi, init_dp, init_lspcon = false;
>>> -	int max_lanes;
>>>   
>>> -	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
>>> -		switch (port) {
>>> -		case PORT_A:
>>> -			max_lanes = 4;
>>> -			break;
>>> -		case PORT_E:
>>> -			max_lanes = 0;
>>> -			break;
>>> -		default:
>>> -			max_lanes = 4;
>>> -			break;
>>> -		}
>>> -	} else {
>>> -		switch (port) {
>>> -		case PORT_A:
>>> -			max_lanes = 2;
>>> -			break;
>>> -		case PORT_E:
>>> -			max_lanes = 2;
>>> -			break;
>>> -		default:
>>> -			max_lanes = 4;
>>> -			break;
>>> -		}
>>> -	}
>>>   
>>>   	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
>>>   		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
>>> @@ -2954,19 +2959,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>>>   		MISSING_CASE(port);
>>>   	}
>>>   
>>> -	/*
>>> -	 * Some BIOS might fail to set this bit on port A if eDP
>>> -	 * wasn't lit up at boot.  Force this bit set when needed
>>> -	 * so we use the proper lane count for our calculations.
>>> -	 */
>>> -	if (intel_ddi_a_force_4_lanes(intel_dig_port)) {
>>> -		DRM_DEBUG_KMS("Forcing DDI_A_4_LANES for port A\n");
>>> -		intel_dig_port->saved_port_bits |= DDI_A_4_LANES;
>>> -		max_lanes = 4;
>>> -	}
>>> -
>>>   	intel_dig_port->dp.output_reg = INVALID_MMIO_REG;
>>> -	intel_dig_port->max_lanes = max_lanes;
>>>   
>>>   	intel_encoder->type = INTEL_OUTPUT_DDI;
>>>   	intel_encoder->power_domain = intel_port_to_power_domain(port);
>>> @@ -2974,6 +2967,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>>>   	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
>>>   	intel_encoder->cloneable = 0;
>>>   
>>> +	intel_dig_port->max_lanes = intel_ddi_max_lanes(dev_priv,
>>> +							intel_dig_port);
>> Please keep this at the original location above.
> I moved this here because intel_encoder->port was not initialized in 
> original location, will pass port along with intel_dig_port & move it to 
> original location.

Right, so alternatively you could move all the intel_dig_port init to
the same place.

BR,
Jani.

> Thanks for review.
>
> -Mahesh
>>
>> BR,
>> Jani.
>>
>>>   	intel_infoframe_init(intel_dig_port);
>>>   
>>>   	if (init_dp) {
>

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-02-05 10:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-02 12:21 [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Mahesh Kumar
2018-02-02 12:40 ` ✓ Fi.CI.BAT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2) Patchwork
2018-02-02 12:56 ` [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Jani Nikula
2018-02-05  9:34   ` Kumar, Mahesh
2018-02-05 10:03     ` Jani Nikula
2018-02-02 13:42 ` ✓ Fi.CI.IGT: success for drm/i915/icl: remove port A/E lane sharing limitation. (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2018-01-30  9:21 [PATCH] drm/i915/icl: remove port A/E lane sharing limitation Mahesh Kumar
2018-01-30 19:52 ` Pandiyan, Dhinakaran
2018-01-30 20:13   ` Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).