* [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed.
@ 2017-10-20 23:11 Rodrigo Vivi
2017-10-20 23:30 ` ✓ Fi.CI.BAT: success for " Patchwork
` (6 more replies)
0 siblings, 7 replies; 13+ messages in thread
From: Rodrigo Vivi @ 2017-10-20 23:11 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Rodrigo Vivi
As we faced in BXT, on CNL DDI_A_4_LANES is not
set as expected when system is boot with multiple
monitors connected. This result in wrong lane
setup impacting the max data rate available and
consequently blocking modeset on eDP, resulting
in a blank screen.
Most of CNL SKUs don't support DDI-E.
The only SKU that supports DDI-E is the same
that supports the full A/E split called DDI-F.
Also when DDI-F is used DDI-E cannot be used because
they share Interrupts. So DDI-E is almost useless.
Anyways let's consider this is possible and rely on
VBT for that.
Since this become a trend this commit also adds
an extra commit message so in the future we have
an extra insight when we are dealing with this
same case.
This patch was initialy start by Clint, but required
many changes including full commit message. So
Credits entirely to Clint for finding this.
Suggested-by: Clint Taylor <clinton.a.taylor@intel.com>
Cc: Clint Taylor <clinton.a.taylor@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/i915/intel_ddi.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index adf51b328844..8acacf800a24 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2803,17 +2803,29 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
}
/*
- * 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
+ * Some BIOS might fail to set this bit on port A if eDP
+ * wasn't lit up at boot. Force this bit when needed on in our internal
* configuration so that we use the proper lane count for our
* calculations.
*/
- if (IS_GEN9_LP(dev_priv) && 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");
+ if (port == PORT_A &&
+ !(intel_dig_port->saved_port_bits & DDI_A_4_LANES)) {
+
+ /* Broxton: Bspec says that DDI_A_4_LANES is the only supported
+ * configuration
+ * Cannonlake: Most of SKUs don't support DDI_E, and the only
+ * one who does also have a full A/E split called
+ * DDI_F what makes DDI_E useless. However for this
+ * case let's trust VBT info.
+ */
+ if (IS_GEN9_LP(dev_priv) ||
+ ((IS_CANNONLAKE(dev_priv)) &&
+ !intel_bios_is_port_present(dev_priv, PORT_E))) {
+ 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;
+ } else {
+ DRM_DEBUG_KMS("DDI A configured for 2 lanes\n");
}
}
--
2.13.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 13+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed.
2017-10-20 23:11 [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed Rodrigo Vivi
@ 2017-10-20 23:30 ` Patchwork
2017-10-21 0:52 ` ✓ Fi.CI.IGT: " Patchwork
` (5 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-20 23:30 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cnl: Force DDI_A_4_LANES when needed.
URL : https://patchwork.freedesktop.org/series/32398/
State : success
== Summary ==
Series 32398v1 drm/i915/cnl: Force DDI_A_4_LANES when needed.
https://patchwork.freedesktop.org/api/1.0/series/32398/revisions/1/mbox/
Test chamelium:
Subgroup dp-hpd-fast:
incomplete -> SKIP (fi-bdw-gvtdvm) fdo#102332
Subgroup dp-crc-fast:
fail -> PASS (fi-kbl-7500u) fdo#102514
Test gem_ringfill:
Subgroup basic-default-hang:
dmesg-warn -> PASS (fi-pnv-d510) fdo#101600
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
pass -> DMESG-WARN (fi-byt-j1900) fdo#101705
fdo#102332 https://bugs.freedesktop.org/show_bug.cgi?id=102332
fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#101600 https://bugs.freedesktop.org/show_bug.cgi?id=101600
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:442s
fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:450s
fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:379s
fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:526s
fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:265s
fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:497s
fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:497s
fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:0 skip:35 time:495s
fi-byt-n2820 total:289 pass:249 dwarn:1 dfail:0 fail:0 skip:39 time:479s
fi-cfl-s total:289 pass:253 dwarn:4 dfail:0 fail:0 skip:32 time:567s
fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:417s
fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:252s
fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:580s
fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:456s
fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:428s
fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:432s
fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:499s
fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:458s
fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:493s
fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:575s
fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:480s
fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:590s
fi-pnv-d510 total:289 pass:223 dwarn:0 dfail:0 fail:0 skip:66 time:547s
fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:452s
fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:653s
fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:518s
fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:502s
fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:466s
fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:564s
fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:421s
0760516f31272c1c7cbdb6e415b4f367d3681d8e drm-tip: 2017y-10m-20d-18h-40m-36s UTC integration manifest
06df7d3664b5 drm/i915/cnl: Force DDI_A_4_LANES when needed.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6133/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed.
2017-10-20 23:11 [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed Rodrigo Vivi
2017-10-20 23:30 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-10-21 0:52 ` Patchwork
2017-10-23 13:11 ` [PATCH] " Ville Syrjälä
` (4 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-21 0:52 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cnl: Force DDI_A_4_LANES when needed.
URL : https://patchwork.freedesktop.org/series/32398/
State : success
== Summary ==
Test kms_busy:
Subgroup extended-modeset-hang-newfb-with-reset-render-B:
dmesg-warn -> PASS (shard-hsw) fdo#103038
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-hsw) fdo#99912
fdo#103038 https://bugs.freedesktop.org/show_bug.cgi?id=103038
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
shard-hsw total:2540 pass:1429 dwarn:1 dfail:0 fail:9 skip:1101 time:9277s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6133/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed.
2017-10-20 23:11 [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed Rodrigo Vivi
2017-10-20 23:30 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-21 0:52 ` ✓ Fi.CI.IGT: " Patchwork
@ 2017-10-23 13:11 ` Ville Syrjälä
2017-10-23 17:12 ` Rodrigo Vivi
2017-10-23 17:31 ` ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2) Patchwork
` (3 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Ville Syrjälä @ 2017-10-23 13:11 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: Jani Nikula, intel-gfx
On Fri, Oct 20, 2017 at 04:11:27PM -0700, Rodrigo Vivi wrote:
> As we faced in BXT, on CNL DDI_A_4_LANES is not
> set as expected when system is boot with multiple
> monitors connected. This result in wrong lane
> setup impacting the max data rate available and
> consequently blocking modeset on eDP, resulting
> in a blank screen.
>
> Most of CNL SKUs don't support DDI-E.
> The only SKU that supports DDI-E is the same
> that supports the full A/E split called DDI-F.
>
> Also when DDI-F is used DDI-E cannot be used because
> they share Interrupts. So DDI-E is almost useless.
> Anyways let's consider this is possible and rely on
> VBT for that.
>
> Since this become a trend this commit also adds
> an extra commit message so in the future we have
> an extra insight when we are dealing with this
> same case.
>
> This patch was initialy start by Clint, but required
> many changes including full commit message. So
> Credits entirely to Clint for finding this.
>
> Suggested-by: Clint Taylor <clinton.a.taylor@intel.com>
> Cc: Clint Taylor <clinton.a.taylor@intel.com>
> Cc: Mika Kahola <mika.kahola@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 24 ++++++++++++++++++------
> 1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index adf51b328844..8acacf800a24 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2803,17 +2803,29 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> }
>
> /*
> - * 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
> + * Some BIOS might fail to set this bit on port A if eDP
> + * wasn't lit up at boot. Force this bit when needed on in our internal
> * configuration so that we use the proper lane count for our
> * calculations.
> */
> - if (IS_GEN9_LP(dev_priv) && 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");
> + if (port == PORT_A &&
> + !(intel_dig_port->saved_port_bits & DDI_A_4_LANES)) {
> +
> + /* Broxton: Bspec says that DDI_A_4_LANES is the only supported
> + * configuration
> + * Cannonlake: Most of SKUs don't support DDI_E, and the only
> + * one who does also have a full A/E split called
> + * DDI_F what makes DDI_E useless. However for this
> + * case let's trust VBT info.
> + */
> + if (IS_GEN9_LP(dev_priv) ||
> + ((IS_CANNONLAKE(dev_priv)) &&
> + !intel_bios_is_port_present(dev_priv, PORT_E))) {
Can you extract all these messy conditions into some kind of (ideally
less convoluted) helper function? In the end I think it would be cool if
this part of the code ends up looking something like:
if (intel_ddi_a_force_4_lanes(dig_port)) {
DRM_DEBUG_KMS(...);
dig_port->saved_port_bits |= DDI_A_4_LANES;
max_lanes = 4;
}
> + 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;
> + } else {
> + DRM_DEBUG_KMS("DDI A configured for 2 lanes\n");
> }
> }
>
> --
> 2.13.5
--
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] 13+ messages in thread
* [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed.
2017-10-23 13:11 ` [PATCH] " Ville Syrjälä
@ 2017-10-23 17:12 ` Rodrigo Vivi
2017-10-23 17:26 ` Ville Syrjälä
0 siblings, 1 reply; 13+ messages in thread
From: Rodrigo Vivi @ 2017-10-23 17:12 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Rodrigo Vivi
As we faced in BXT, on CNL DDI_A_4_LANES is not
set as expected when system is boot with multiple
monitors connected. This result in wrong lane
setup impacting the max data rate available and
consequently blocking modeset on eDP, resulting
in a blank screen.
Most of CNL SKUs don't support DDI-E.
The only SKU that supports DDI-E is the same
that supports the full A/E split called DDI-F.
Also when DDI-F is used DDI-E cannot be used because
they share Interrupts. So DDI-E is almost useless.
Anyways let's consider this is possible and rely on
VBT for that.
This patch was initialy start by Clint, but required
many changes including full commit message. So
Credits entirely to Clint for finding this.
v2: Extract all messy conditions into a helper function
as suggested by Ville.
Along with simplification I removed the debug
message on the working case since now all conditions
are grouped.
Suggested-by: Clint Taylor <clinton.a.taylor@intel.com>
Cc: Clint Taylor <clinton.a.taylor@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/i915/intel_ddi.c | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index adf51b328844..5b03c24bae97 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2694,6 +2694,24 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)
return connector;
}
+static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
+{
+ struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
+
+ /* Broxton: Bspec says that DDI_A_4_LANES is the only supported
+ * configuration
+ * Cannonlake: Most of SKUs don't support DDI_E, and the only
+ * one who does also have a full A/E split called
+ * DDI_F what makes DDI_E useless. However for this
+ * case let's trust VBT info.
+ */
+ return dport->port == PORT_A &&
+ !(dport->saved_port_bits & DDI_A_4_LANES) &&
+ (IS_GEN9_LP(dev_priv) ||
+ ((IS_CANNONLAKE(dev_priv)) &&
+ !intel_bios_is_port_present(dev_priv, PORT_E)));
+}
+
void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
{
struct intel_digital_port *intel_dig_port;
@@ -2803,18 +2821,14 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
}
/*
- * 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.
+ * 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 (IS_GEN9_LP(dev_priv) && 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;
- max_lanes = 4;
- }
+ 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->max_lanes = max_lanes;
--
2.13.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed.
2017-10-23 17:12 ` Rodrigo Vivi
@ 2017-10-23 17:26 ` Ville Syrjälä
2017-10-23 17:39 ` Rodrigo Vivi
0 siblings, 1 reply; 13+ messages in thread
From: Ville Syrjälä @ 2017-10-23 17:26 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: Jani Nikula, intel-gfx
On Mon, Oct 23, 2017 at 10:12:00AM -0700, Rodrigo Vivi wrote:
> As we faced in BXT, on CNL DDI_A_4_LANES is not
> set as expected when system is boot with multiple
> monitors connected. This result in wrong lane
> setup impacting the max data rate available and
> consequently blocking modeset on eDP, resulting
> in a blank screen.
>
> Most of CNL SKUs don't support DDI-E.
> The only SKU that supports DDI-E is the same
> that supports the full A/E split called DDI-F.
>
> Also when DDI-F is used DDI-E cannot be used because
> they share Interrupts. So DDI-E is almost useless.
> Anyways let's consider this is possible and rely on
> VBT for that.
>
> This patch was initialy start by Clint, but required
> many changes including full commit message. So
> Credits entirely to Clint for finding this.
>
> v2: Extract all messy conditions into a helper function
> as suggested by Ville.
> Along with simplification I removed the debug
> message on the working case since now all conditions
> are grouped.
>
> Suggested-by: Clint Taylor <clinton.a.taylor@intel.com>
> Cc: Clint Taylor <clinton.a.taylor@intel.com>
> Cc: Mika Kahola <mika.kahola@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 36 +++++++++++++++++++++++++-----------
> 1 file changed, 25 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index adf51b328844..5b03c24bae97 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2694,6 +2694,24 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)
> return connector;
> }
>
> +static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
> +{
> + struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
> +
> + /* Broxton: Bspec says that DDI_A_4_LANES is the only supported
> + * configuration
> + * Cannonlake: Most of SKUs don't support DDI_E, and the only
> + * one who does also have a full A/E split called
> + * DDI_F what makes DDI_E useless. However for this
> + * case let's trust VBT info.
> + */
> + return dport->port == PORT_A &&
> + !(dport->saved_port_bits & DDI_A_4_LANES) &&
> + (IS_GEN9_LP(dev_priv) ||
> + ((IS_CANNONLAKE(dev_priv)) &&
^ ^
Those don't look necessary.
It still took me a while to parse that thing. Maybe it should be split
even further? Eg. something like:
{
if (port != PORT_A)
return false;
if (saved_port_bits & 4_LANES)
return false;
/* blah */
if (BXT)
return true;
/* meh */
if (CNL && !port_e_present)
return true;
return false;
}
But your code looks correct as well, and I can live with it
if you want to keep it as is. So, with the extra parens removed
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> + !intel_bios_is_port_present(dev_priv, PORT_E)));
> +}
> +
> void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> {
> struct intel_digital_port *intel_dig_port;
> @@ -2803,18 +2821,14 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> }
>
> /*
> - * 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.
> + * 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 (IS_GEN9_LP(dev_priv) && 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;
> - max_lanes = 4;
> - }
> + 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->max_lanes = max_lanes;
> --
> 2.13.5
--
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] 13+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2)
2017-10-20 23:11 [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed Rodrigo Vivi
` (2 preceding siblings ...)
2017-10-23 13:11 ` [PATCH] " Ville Syrjälä
@ 2017-10-23 17:31 ` Patchwork
2017-10-23 17:59 ` ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3) Patchwork
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-23 17:31 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2)
URL : https://patchwork.freedesktop.org/series/32398/
State : success
== Summary ==
Series 32398v2 drm/i915/cnl: Force DDI_A_4_LANES when needed.
https://patchwork.freedesktop.org/api/1.0/series/32398/revisions/2/mbox/
Test chamelium:
Subgroup dp-crc-fast:
fail -> PASS (fi-kbl-7500u) fdo#102514
Test gem_exec_reloc:
Subgroup basic-cpu-active:
pass -> FAIL (fi-gdg-551) fdo#102582 +2
Subgroup basic-write-gtt-active:
pass -> FAIL (fi-gdg-551) fdo#102582
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
fail -> PASS (fi-gdg-551) fdo#102618
incomplete -> PASS (fi-skl-6700hq) fdo#103410 +1
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-kbl-7560u) fdo#102846
fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102618 https://bugs.freedesktop.org/show_bug.cgi?id=102618
fdo#103410 https://bugs.freedesktop.org/show_bug.cgi?id=103410
fdo#102846 https://bugs.freedesktop.org/show_bug.cgi?id=102846
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:440s
fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:452s
fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:368s
fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:522s
fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:265s
fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:505s
fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:492s
fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:0 skip:35 time:493s
fi-byt-n2820 total:289 pass:249 dwarn:1 dfail:0 fail:0 skip:39 time:476s
fi-cfl-s total:289 pass:253 dwarn:4 dfail:0 fail:0 skip:32 time:553s
fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:416s
fi-gdg-551 total:289 pass:174 dwarn:1 dfail:0 fail:5 skip:109 time:249s
fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:583s
fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:427s
fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:426s
fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:431s
fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:493s
fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:457s
fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:491s
fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:574s
fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:476s
fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:583s
fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:553s
fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:455s
fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:647s
fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:523s
fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:498s
fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:456s
fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:559s
fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:420s
d2ec28c53833297976d0754e0e82c3d7490b149c drm-tip: 2017y-10m-23d-08h-55m-00s UTC integration manifest
d2ab26975b01 drm/i915/cnl: Force DDI_A_4_LANES when needed.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6144/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed.
2017-10-23 17:26 ` Ville Syrjälä
@ 2017-10-23 17:39 ` Rodrigo Vivi
2017-10-24 9:21 ` Ville Syrjälä
0 siblings, 1 reply; 13+ messages in thread
From: Rodrigo Vivi @ 2017-10-23 17:39 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Rodrigo Vivi
As we faced in BXT, on CNL DDI_A_4_LANES is not
set as expected when system is boot with multiple
monitors connected. This result in wrong lane
setup impacting the max data rate available and
consequently blocking modeset on eDP, resulting
in a blank screen.
Most of CNL SKUs don't support DDI-E.
The only SKU that supports DDI-E is the same
that supports the full A/E split called DDI-F.
Also when DDI-F is used DDI-E cannot be used because
they share Interrupts. So DDI-E is almost useless.
Anyways let's consider this is possible and rely on
VBT for that.
This patch was initialy start by Clint, but required
many changes including full commit message. So
Credits entirely to Clint for finding this.
v2: Extract all messy conditions into a helper function
as suggested by Ville.
Along with simplification I removed the debug
message on the working case since now all conditions
are grouped.
v3: Split the conditions even more as suggested by Ville.
Get's cleaner and easier to add new cases in the
future.
Suggested-by: Clint Taylor <clinton.a.taylor@intel.com>
Cc: Clint Taylor <clinton.a.taylor@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/i915/intel_ddi.c | 46 ++++++++++++++++++++++++++++++----------
1 file changed, 35 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index adf51b328844..38a7088bd39c 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2694,6 +2694,34 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)
return connector;
}
+static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
+{
+ struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
+
+ if (dport->port != PORT_A)
+ return false;
+
+ if (dport->saved_port_bits & DDI_A_4_LANES)
+ return false;
+
+ /* Broxton/Geminilake: Bspec says that DDI_A_4_LANES is the only
+ * supported configuration
+ */
+ if (IS_GEN9_LP(dev_priv))
+ return true;
+
+ /* Cannonlake: Most of SKUs don't support DDI_E, and the only
+ * one who does also have a full A/E split called
+ * DDI_F what makes DDI_E useless. However for this
+ * case let's trust VBT info.
+ */
+ if (IS_CANNONLAKE(dev_priv) &&
+ !intel_bios_is_port_present(dev_priv, PORT_E))
+ return true;
+
+ return false;
+}
+
void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
{
struct intel_digital_port *intel_dig_port;
@@ -2803,18 +2831,14 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
}
/*
- * 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.
+ * 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 (IS_GEN9_LP(dev_priv) && 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;
- max_lanes = 4;
- }
+ 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->max_lanes = max_lanes;
--
2.13.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 13+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3)
2017-10-20 23:11 [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed Rodrigo Vivi
` (3 preceding siblings ...)
2017-10-23 17:31 ` ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2) Patchwork
@ 2017-10-23 17:59 ` Patchwork
2017-10-23 18:20 ` ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2) Patchwork
2017-10-23 19:06 ` ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3) Patchwork
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-23 17:59 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3)
URL : https://patchwork.freedesktop.org/series/32398/
State : success
== Summary ==
Series 32398v3 drm/i915/cnl: Force DDI_A_4_LANES when needed.
https://patchwork.freedesktop.org/api/1.0/series/32398/revisions/3/mbox/
Test chamelium:
Subgroup dp-crc-fast:
fail -> PASS (fi-kbl-7500u) fdo#102514
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
fail -> PASS (fi-gdg-551) fdo#102618
incomplete -> PASS (fi-skl-6700hq) fdo#103410 +1
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-kbl-7560u) fdo#102846
fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#102618 https://bugs.freedesktop.org/show_bug.cgi?id=102618
fdo#103410 https://bugs.freedesktop.org/show_bug.cgi?id=103410
fdo#102846 https://bugs.freedesktop.org/show_bug.cgi?id=102846
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:444s
fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:456s
fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:371s
fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:515s
fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:263s
fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:502s
fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:492s
fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:0 skip:35 time:496s
fi-cfl-s total:289 pass:253 dwarn:4 dfail:0 fail:0 skip:32 time:556s
fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:417s
fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:251s
fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:577s
fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:447s
fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:432s
fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:434s
fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:481s
fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:459s
fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:489s
fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:572s
fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:476s
fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:580s
fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:543s
fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:454s
fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:649s
fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:514s
fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:500s
fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:451s
fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:576s
fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:421s
d2ec28c53833297976d0754e0e82c3d7490b149c drm-tip: 2017y-10m-23d-08h-55m-00s UTC integration manifest
01111073b1d1 drm/i915/cnl: Force DDI_A_4_LANES when needed.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6145/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2)
2017-10-20 23:11 [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed Rodrigo Vivi
` (4 preceding siblings ...)
2017-10-23 17:59 ` ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3) Patchwork
@ 2017-10-23 18:20 ` Patchwork
2017-10-23 19:06 ` ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3) Patchwork
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-23 18:20 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2)
URL : https://patchwork.freedesktop.org/series/32398/
State : success
== Summary ==
Test kms_flip:
Subgroup flip-vs-wf_vblank-interruptible:
pass -> FAIL (shard-hsw) fdo#100368 +1
Test kms_plane:
Subgroup plane-panning-bottom-right-suspend-pipe-B-planes:
skip -> PASS (shard-hsw)
Test kms_plane_multiple:
Subgroup atomic-pipe-B-tiling-x:
skip -> PASS (shard-hsw)
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
shard-hsw total:2540 pass:1429 dwarn:3 dfail:0 fail:11 skip:1097 time:9158s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6144/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3)
2017-10-20 23:11 [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed Rodrigo Vivi
` (5 preceding siblings ...)
2017-10-23 18:20 ` ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2) Patchwork
@ 2017-10-23 19:06 ` Patchwork
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-23 19:06 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3)
URL : https://patchwork.freedesktop.org/series/32398/
State : success
== Summary ==
Test kms_plane:
Subgroup plane-panning-bottom-right-suspend-pipe-B-planes:
skip -> PASS (shard-hsw)
Test kms_plane_multiple:
Subgroup atomic-pipe-B-tiling-x:
skip -> PASS (shard-hsw)
Test kms_busy:
Subgroup extended-modeset-hang-oldfb-with-reset-render-C:
dmesg-warn -> PASS (shard-hsw) fdo#102249
Test drv_module_reload:
Subgroup basic-reload-inject:
dmesg-warn -> PASS (shard-hsw) fdo#102707
fdo#102249 https://bugs.freedesktop.org/show_bug.cgi?id=102249
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
shard-hsw total:2540 pass:1433 dwarn:1 dfail:0 fail:9 skip:1097 time:9205s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6145/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed.
2017-10-23 17:39 ` Rodrigo Vivi
@ 2017-10-24 9:21 ` Ville Syrjälä
2017-10-24 17:25 ` Rodrigo Vivi
0 siblings, 1 reply; 13+ messages in thread
From: Ville Syrjälä @ 2017-10-24 9:21 UTC (permalink / raw)
To: Rodrigo Vivi; +Cc: Jani Nikula, intel-gfx
On Mon, Oct 23, 2017 at 10:39:20AM -0700, Rodrigo Vivi wrote:
> As we faced in BXT, on CNL DDI_A_4_LANES is not
> set as expected when system is boot with multiple
> monitors connected. This result in wrong lane
> setup impacting the max data rate available and
> consequently blocking modeset on eDP, resulting
> in a blank screen.
>
> Most of CNL SKUs don't support DDI-E.
> The only SKU that supports DDI-E is the same
> that supports the full A/E split called DDI-F.
>
> Also when DDI-F is used DDI-E cannot be used because
> they share Interrupts. So DDI-E is almost useless.
> Anyways let's consider this is possible and rely on
> VBT for that.
>
> This patch was initialy start by Clint, but required
> many changes including full commit message. So
> Credits entirely to Clint for finding this.
>
> v2: Extract all messy conditions into a helper function
> as suggested by Ville.
> Along with simplification I removed the debug
> message on the working case since now all conditions
> are grouped.
> v3: Split the conditions even more as suggested by Ville.
> Get's cleaner and easier to add new cases in the
> future.
>
> Suggested-by: Clint Taylor <clinton.a.taylor@intel.com>
> Cc: Clint Taylor <clinton.a.taylor@intel.com>
> Cc: Mika Kahola <mika.kahola@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 46 ++++++++++++++++++++++++++++++----------
> 1 file changed, 35 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index adf51b328844..38a7088bd39c 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2694,6 +2694,34 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)
> return connector;
> }
>
> +static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
> +{
> + struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
> +
> + if (dport->port != PORT_A)
> + return false;
> +
> + if (dport->saved_port_bits & DDI_A_4_LANES)
> + return false;
> +
> + /* Broxton/Geminilake: Bspec says that DDI_A_4_LANES is the only
> + * supported configuration
> + */
> + if (IS_GEN9_LP(dev_priv))
> + return true;
> +
> + /* Cannonlake: Most of SKUs don't support DDI_E, and the only
> + * one who does also have a full A/E split called
> + * DDI_F what makes DDI_E useless. However for this
> + * case let's trust VBT info.
> + */
> + if (IS_CANNONLAKE(dev_priv) &&
> + !intel_bios_is_port_present(dev_priv, PORT_E))
> + return true;
> +
> + return false;
> +}
> +
> void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> {
> struct intel_digital_port *intel_dig_port;
> @@ -2803,18 +2831,14 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> }
>
> /*
> - * 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.
> + * 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 (IS_GEN9_LP(dev_priv) && 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;
> - max_lanes = 4;
> - }
> + 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->max_lanes = max_lanes;
> --
> 2.13.5
--
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] 13+ messages in thread
* Re: [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed.
2017-10-24 9:21 ` Ville Syrjälä
@ 2017-10-24 17:25 ` Rodrigo Vivi
0 siblings, 0 replies; 13+ messages in thread
From: Rodrigo Vivi @ 2017-10-24 17:25 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: Jani Nikula, intel-gfx
On Tue, Oct 24, 2017 at 09:21:38AM +0000, Ville Syrjälä wrote:
> On Mon, Oct 23, 2017 at 10:39:20AM -0700, Rodrigo Vivi wrote:
> > As we faced in BXT, on CNL DDI_A_4_LANES is not
> > set as expected when system is boot with multiple
> > monitors connected. This result in wrong lane
> > setup impacting the max data rate available and
> > consequently blocking modeset on eDP, resulting
> > in a blank screen.
> >
> > Most of CNL SKUs don't support DDI-E.
> > The only SKU that supports DDI-E is the same
> > that supports the full A/E split called DDI-F.
> >
> > Also when DDI-F is used DDI-E cannot be used because
> > they share Interrupts. So DDI-E is almost useless.
> > Anyways let's consider this is possible and rely on
> > VBT for that.
> >
> > This patch was initialy start by Clint, but required
> > many changes including full commit message. So
> > Credits entirely to Clint for finding this.
> >
> > v2: Extract all messy conditions into a helper function
> > as suggested by Ville.
> > Along with simplification I removed the debug
> > message on the working case since now all conditions
> > are grouped.
> > v3: Split the conditions even more as suggested by Ville.
> > Get's cleaner and easier to add new cases in the
> > future.
> >
> > Suggested-by: Clint Taylor <clinton.a.taylor@intel.com>
> > Cc: Clint Taylor <clinton.a.taylor@intel.com>
> > Cc: Mika Kahola <mika.kahola@intel.com>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Thanks for review and all great suggestions.
Merged to dinq.
>
> > ---
> > drivers/gpu/drm/i915/intel_ddi.c | 46 ++++++++++++++++++++++++++++++----------
> > 1 file changed, 35 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> > index adf51b328844..38a7088bd39c 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -2694,6 +2694,34 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *intel_dig_port)
> > return connector;
> > }
> >
> > +static bool intel_ddi_a_force_4_lanes(struct intel_digital_port *dport)
> > +{
> > + struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev);
> > +
> > + if (dport->port != PORT_A)
> > + return false;
> > +
> > + if (dport->saved_port_bits & DDI_A_4_LANES)
> > + return false;
> > +
> > + /* Broxton/Geminilake: Bspec says that DDI_A_4_LANES is the only
> > + * supported configuration
> > + */
> > + if (IS_GEN9_LP(dev_priv))
> > + return true;
> > +
> > + /* Cannonlake: Most of SKUs don't support DDI_E, and the only
> > + * one who does also have a full A/E split called
> > + * DDI_F what makes DDI_E useless. However for this
> > + * case let's trust VBT info.
> > + */
> > + if (IS_CANNONLAKE(dev_priv) &&
> > + !intel_bios_is_port_present(dev_priv, PORT_E))
> > + return true;
> > +
> > + return false;
> > +}
> > +
> > void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> > {
> > struct intel_digital_port *intel_dig_port;
> > @@ -2803,18 +2831,14 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
> > }
> >
> > /*
> > - * 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.
> > + * 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 (IS_GEN9_LP(dev_priv) && 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;
> > - max_lanes = 4;
> > - }
> > + 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->max_lanes = max_lanes;
> > --
> > 2.13.5
>
> --
> 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] 13+ messages in thread
end of thread, other threads:[~2017-10-24 17:25 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20 23:11 [PATCH] drm/i915/cnl: Force DDI_A_4_LANES when needed Rodrigo Vivi
2017-10-20 23:30 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-21 0:52 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-23 13:11 ` [PATCH] " Ville Syrjälä
2017-10-23 17:12 ` Rodrigo Vivi
2017-10-23 17:26 ` Ville Syrjälä
2017-10-23 17:39 ` Rodrigo Vivi
2017-10-24 9:21 ` Ville Syrjälä
2017-10-24 17:25 ` Rodrigo Vivi
2017-10-23 17:31 ` ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2) Patchwork
2017-10-23 17:59 ` ✓ Fi.CI.BAT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3) Patchwork
2017-10-23 18:20 ` ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev2) Patchwork
2017-10-23 19:06 ` ✓ Fi.CI.IGT: success for drm/i915/cnl: Force DDI_A_4_LANES when needed. (rev3) Patchwork
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.