Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling
@ 2025-01-29 20:02 Imre Deak
  2025-01-29 20:02 ` [PATCH 01/17] drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro Imre Deak
                   ` (19 more replies)
  0 siblings, 20 replies; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

This patchset fixes two issues (in patch 2 and 4) and simplifies a few
other things in the DDI port enabling/disabling sequences. I noticed
these while thinking about a way to enable/disable ports as part of
the HW readout/sanitization, for which this patchset is also a
preparation.

Imre Deak (17):
  drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro
  drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL
  drm/i915/ddi: Make all the PORT_WIDTH macros work the same way
  drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL
  drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL
  drm/i915/ddi: Simplify the port disabling via DDI_BUF_CTL
  drm/i915/ddi: Simplify waiting for a port to idle via DDI_BUF_CTL
  drm/i915/ddi: Move platform checks within
    mtl_ddi_enable/disable_d2d_link()
  drm/i915/ddi: Unify the platform specific functions disabling a port
  drm/i915/ddi: Add a helper to enable a port
  drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions
  drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via
    read-modify-write
  drm/i915/ddi: Factor out a helper to get DDI_BUF_CTL's config value
  drm/i915/ddi: Reuse helper to compute the HDMI DDI_BUF_CTL config
  drm/i915/ddi: Reuse helper to compute the HDMI PORT_BUF_CTL1 config
  drm/i915/ddi: Move platform/encoder checks within
    adlp_tbt_to_dp_alt_switch_wa()
  drm/i915/ddi: Unify the platform specific functions enabling a port

 drivers/gpu/drm/i915/display/icl_dsi.c        |   4 +-
 .../gpu/drm/i915/display/intel_cx0_phy_regs.h |   3 +-
 drivers/gpu/drm/i915/display/intel_ddi.c      | 378 +++++++-----------
 drivers/gpu/drm/i915/i915_reg.h               |  25 +-
 4 files changed, 169 insertions(+), 241 deletions(-)

-- 
2.44.2


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

* [PATCH 01/17] drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-01-30 11:47   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 02/17] drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL Imre Deak
                   ` (18 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

The format of the port width field in the DDI_BUF_CTL and the
TRANS_DDI_FUNC_CTL registers are different starting with MTL, where the
x3 lane mode for HDMI FRL has a different encoding in the two registers.
To account for this use the TRANS_DDI_FUNC_CTL's own port width macro.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/icl_dsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
index ee1c3fb500a73..11bfb357508b7 100644
--- a/drivers/gpu/drm/i915/display/icl_dsi.c
+++ b/drivers/gpu/drm/i915/display/icl_dsi.c
@@ -809,8 +809,8 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder,
 		/* select data lane width */
 		tmp = intel_de_read(display,
 				    TRANS_DDI_FUNC_CTL(display, dsi_trans));
-		tmp &= ~DDI_PORT_WIDTH_MASK;
-		tmp |= DDI_PORT_WIDTH(intel_dsi->lane_count);
+		tmp &= ~TRANS_DDI_PORT_WIDTH_MASK;
+		tmp |= TRANS_DDI_PORT_WIDTH(intel_dsi->lane_count);
 
 		/* select input pipe */
 		tmp &= ~TRANS_DDI_EDP_INPUT_MASK;
-- 
2.44.2


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

* [PATCH 02/17] drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
  2025-01-29 20:02 ` [PATCH 01/17] drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-01-30 11:51   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 03/17] drm/i915/ddi: Make all the PORT_WIDTH macros work the same way Imre Deak
                   ` (17 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Imre Deak

From: Imre Deak <imre.deak@gmail.com>

Fix the port width programming in the DDI_BUF_CTL register on MTLP+,
where this had an off-by-one error.

Signed-off-by: Imre Deak <imre.deak@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 2 +-
 drivers/gpu/drm/i915/i915_reg.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index dc319f37b1be9..36e7dde422d37 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3501,7 +3501,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 		intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(dev_priv, port),
 			     XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_REVERSAL, port_buf);
 
-		buf_ctl |= DDI_PORT_WIDTH(lane_count);
+		buf_ctl |= DDI_PORT_WIDTH(crtc_state->lane_count);
 
 		if (DISPLAY_VER(dev_priv) >= 20)
 			buf_ctl |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 03da51b03fb90..04e47d0a8ab92 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3635,7 +3635,7 @@ enum skl_power_gate {
 #define  DDI_BUF_IS_IDLE			(1 << 7)
 #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
 #define  DDI_A_4_LANES				(1 << 4)
-#define  DDI_PORT_WIDTH(width)			(((width) - 1) << 1)
+#define  DDI_PORT_WIDTH(width)			(((width) == 3 ? 4 : ((width) - 1)) << 1)
 #define  DDI_PORT_WIDTH_MASK			(7 << 1)
 #define  DDI_PORT_WIDTH_SHIFT			1
 #define  DDI_INIT_DISPLAY_DETECTED		(1 << 0)
-- 
2.44.2


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

* [PATCH 03/17] drm/i915/ddi: Make all the PORT_WIDTH macros work the same way
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
  2025-01-29 20:02 ` [PATCH 01/17] drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro Imre Deak
  2025-01-29 20:02 ` [PATCH 02/17] drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-01-30 11:52   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 04/17] drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL Imre Deak
                   ` (16 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

Make the PORT_WIDTH macro of the XELPDP_PORT_CTL1 register work the same
way as those used for the DDI_BUF_CTL and the TRANS_DDI_FUNC_CTL
registers: accept a width parameter and convert it to the given
register's encoding.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 .../gpu/drm/i915/display/intel_cx0_phy_regs.h |  3 ++-
 drivers/gpu/drm/i915/display/intel_ddi.c      | 22 ++-----------------
 2 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h b/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
index 4a3cf08007e31..a24531656aa89 100644
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
@@ -110,7 +110,8 @@
 #define   XELPDP_TCSS_POWER_REQUEST			REG_BIT(5)
 #define   XELPDP_TCSS_POWER_STATE			REG_BIT(4)
 #define   XELPDP_PORT_WIDTH_MASK			REG_GENMASK(3, 1)
-#define   XELPDP_PORT_WIDTH(val)			REG_FIELD_PREP(XELPDP_PORT_WIDTH_MASK, val)
+#define   XELPDP_PORT_WIDTH(width)			REG_FIELD_PREP(XELPDP_PORT_WIDTH_MASK, \
+								       (width) == 3 ? 4 : (width) - 1)
 
 #define _XELPDP_PORT_BUF_CTL2(idx)			_MMIO(_PICK_EVEN_2RANGES(idx, PORT_TC1, \
 										 _XELPDP_PORT_BUF_CTL1_LN0_A, \
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 36e7dde422d37..76e8296cb134b 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2525,23 +2525,6 @@ static void intel_ddi_mso_configure(const struct intel_crtc_state *crtc_state)
 		     OVERLAP_PIXELS_MASK, dss1);
 }
 
-static u8 mtl_get_port_width(u8 lane_count)
-{
-	switch (lane_count) {
-	case 1:
-		return 0;
-	case 2:
-		return 1;
-	case 3:
-		return 4;
-	case 4:
-		return 3;
-	default:
-		MISSING_CASE(lane_count);
-		return 4;
-	}
-}
-
 static void
 mtl_ddi_enable_d2d(struct intel_encoder *encoder)
 {
@@ -2575,7 +2558,7 @@ static void mtl_port_buf_ctl_program(struct intel_encoder *encoder,
 	enum port port = encoder->port;
 	u32 val = 0;
 
-	val |= XELPDP_PORT_WIDTH(mtl_get_port_width(crtc_state->lane_count));
+	val |= XELPDP_PORT_WIDTH(crtc_state->lane_count);
 
 	if (intel_dp_is_uhbr(crtc_state))
 		val |= XELPDP_PORT_BUF_PORT_DATA_40BIT;
@@ -3490,10 +3473,9 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 		buf_ctl |= DDI_A_4_LANES;
 
 	if (DISPLAY_VER(dev_priv) >= 14) {
-		u8  lane_count = mtl_get_port_width(crtc_state->lane_count);
 		u32 port_buf = 0;
 
-		port_buf |= XELPDP_PORT_WIDTH(lane_count);
+		port_buf |= XELPDP_PORT_WIDTH(crtc_state->lane_count);
 
 		if (dig_port->lane_reversal)
 			port_buf |= XELPDP_PORT_REVERSAL;
-- 
2.44.2


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

* [PATCH 04/17] drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (2 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 03/17] drm/i915/ddi: Make all the PORT_WIDTH macros work the same way Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-05 12:22   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 05/17] drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL Imre Deak
                   ` (15 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Imre Deak

From: Imre Deak <imre.deak@gmail.com>

Add the missing PHY lane stagger delay programming for ICL-ADL
platforms on TypeC DP outputs.

Bspec: 7534, 49533
Signed-off-by: Imre Deak <imre.deak@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 18 ++++++++++++++++++
 drivers/gpu/drm/i915/i915_reg.h          |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 76e8296cb134b..6192c0d3c87a5 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -328,9 +328,21 @@ static u32 ddi_buf_phy_link_rate(int port_clock)
 	}
 }
 
+static int dp_phy_lane_stagger_delay(int port_clock)
+{
+	/*
+	 * Return the number of link symbols per 100 ns:
+	 * port_clock (10 kHz) -> bits    / 100 us
+	 * / symbol_size       -> symbols / 100 us
+	 * / 1000              -> symbols / 100 ns
+	 */
+	return DIV_ROUND_UP(port_clock, intel_dp_link_symbol_size(port_clock) * 1000);
+}
+
 static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
 				      const struct intel_crtc_state *crtc_state)
 {
+	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
 	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
 	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
@@ -356,6 +368,12 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
 		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
 			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
 	}
+
+	if (IS_DISPLAY_VER(display, 11, 13) && intel_encoder_is_tc(encoder)) {
+		int delay = dp_phy_lane_stagger_delay(crtc_state->port_clock);
+
+		intel_dp->DP |= DDI_BUF_LANE_STAGGER_DELAY(delay);
+	}
 }
 
 static int icl_calc_tbt_pll_link(struct drm_i915_private *dev_priv,
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 04e47d0a8ab92..7fe4e71fc08ec 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3632,6 +3632,9 @@ enum skl_power_gate {
 #define  DDI_BUF_PORT_DATA_20BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 1)
 #define  DDI_BUF_PORT_DATA_40BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 2)
 #define  DDI_BUF_PORT_REVERSAL			(1 << 16)
+#define  DDI_BUF_LANE_STAGGER_DELAY_MASK	REG_GENMASK(15, 8)
+#define  DDI_BUF_LANE_STAGGER_DELAY(symbols)	REG_FIELD_PREP(DDI_BUF_LANE_STAGGER_DELAY_MASK, \
+							       symbols)
 #define  DDI_BUF_IS_IDLE			(1 << 7)
 #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
 #define  DDI_A_4_LANES				(1 << 4)
-- 
2.44.2


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

* [PATCH 05/17] drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (3 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 04/17] drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-01-30 11:55   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 06/17] drm/i915/ddi: Simplify the port disabling " Imre Deak
                   ` (14 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

In the past intel_digital_port::dp.prepare_link_retrain() could be
called directly (vs. from a modeset) to retrain an enabled link. In that
case the port had to be first disabled and then re-enabled. That changed
with commit 2885d283cce5 ("drm/i915/dp: Retrain SST links via a modeset
commit"), after which the only way prepare_link_retrain() can be called
is from a modeset during link training when the port is still disabled.
Simplify things accordingly, assuming the disabled port state.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 6192c0d3c87a5..3138dc4034797 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3743,8 +3743,8 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	 * necessary disable and enable port
 	 */
 	dp_tp_ctl = intel_de_read(display, dp_tp_ctl_reg(encoder, crtc_state));
-	if (dp_tp_ctl & DP_TP_CTL_ENABLE)
-		mtl_disable_ddi_buf(encoder, crtc_state);
+
+	drm_WARN_ON(display->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
 
 	/* 6.d Configure and enable DP_TP_CTL with link training pattern 1 selected */
 	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
@@ -3787,26 +3787,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	struct intel_encoder *encoder = &dig_port->base;
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	enum port port = encoder->port;
-	u32 dp_tp_ctl, ddi_buf_ctl;
-	bool wait = false;
+	u32 dp_tp_ctl;
 
 	dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
 
-	if (dp_tp_ctl & DP_TP_CTL_ENABLE) {
-		ddi_buf_ctl = intel_de_read(dev_priv, DDI_BUF_CTL(port));
-		if (ddi_buf_ctl & DDI_BUF_CTL_ENABLE) {
-			intel_de_write(dev_priv, DDI_BUF_CTL(port),
-				       ddi_buf_ctl & ~DDI_BUF_CTL_ENABLE);
-			wait = true;
-		}
-
-		dp_tp_ctl &= ~DP_TP_CTL_ENABLE;
-		intel_de_write(dev_priv, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
-		intel_de_posting_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
-
-		if (wait)
-			intel_wait_ddi_buf_idle(dev_priv, port);
-	}
+	drm_WARN_ON(&dev_priv->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
 
 	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
 	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||
-- 
2.44.2


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

* [PATCH 06/17] drm/i915/ddi: Simplify the port disabling via DDI_BUF_CTL
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (4 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 05/17] drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-05 12:24   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle " Imre Deak
                   ` (13 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

A port can be disabled only via a modeset (or during HW state
sanitization) when the port is enabled. Thus it's not required to check
the port's enabled state before disabling it. In any case if the port
happened to be disabled, the following disabling would be just a nop and
waiting for the buffer's idle state should succeed. Simplify the
disabling sequence accordingly.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 3138dc4034797..24c56d2aa5f31 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3062,17 +3062,12 @@ static void mtl_disable_ddi_buf(struct intel_encoder *encoder,
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	enum port port = encoder->port;
-	u32 val;
 
 	/* 3.b Clear DDI_CTL_DE Enable to 0. */
-	val = intel_de_read(dev_priv, DDI_BUF_CTL(port));
-	if (val & DDI_BUF_CTL_ENABLE) {
-		val &= ~DDI_BUF_CTL_ENABLE;
-		intel_de_write(dev_priv, DDI_BUF_CTL(port), val);
+	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
 
-		/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
-		mtl_wait_ddi_buf_idle(dev_priv, port);
-	}
+	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
+	mtl_wait_ddi_buf_idle(dev_priv, port);
 
 	/* 3.d Disable D2D Link */
 	mtl_ddi_disable_d2d_link(encoder);
@@ -3089,15 +3084,8 @@ static void disable_ddi_buf(struct intel_encoder *encoder,
 {
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	enum port port = encoder->port;
-	bool wait = false;
-	u32 val;
 
-	val = intel_de_read(dev_priv, DDI_BUF_CTL(port));
-	if (val & DDI_BUF_CTL_ENABLE) {
-		val &= ~DDI_BUF_CTL_ENABLE;
-		intel_de_write(dev_priv, DDI_BUF_CTL(port), val);
-		wait = true;
-	}
+	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
 
 	if (intel_crtc_has_dp_encoder(crtc_state))
 		intel_de_rmw(dev_priv, dp_tp_ctl_reg(encoder, crtc_state),
@@ -3105,8 +3093,7 @@ static void disable_ddi_buf(struct intel_encoder *encoder,
 
 	intel_ddi_disable_fec(encoder, crtc_state);
 
-	if (wait)
-		intel_wait_ddi_buf_idle(dev_priv, port);
+	intel_wait_ddi_buf_idle(dev_priv, port);
 }
 
 static void intel_disable_ddi_buf(struct intel_encoder *encoder,
-- 
2.44.2


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

* [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle via DDI_BUF_CTL
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (5 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 06/17] drm/i915/ddi: Simplify the port disabling " Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-05 12:35   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 08/17] drm/i915/ddi: Move platform checks within mtl_ddi_enable/disable_d2d_link() Imre Deak
                   ` (12 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

When waiting for a port to idle, there is no point in distinguishing the
platform specific timeouts, instead of just using the maximum timeout.
Simplify things accordingly, describing the Bspec platform specific
timeouts in code comments.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 78 +++++++++++-------------
 1 file changed, 36 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 24c56d2aa5f31..d040558b5d029 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -177,69 +177,63 @@ static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder,
 		       trans->entries[level].hsw.trans2);
 }
 
-static void mtl_wait_ddi_buf_idle(struct drm_i915_private *i915, enum port port)
+static i915_reg_t intel_ddi_buf_status_reg(struct intel_display *display, enum port port)
 {
-	int ret;
+	struct drm_i915_private *i915 = to_i915(display->drm);
 
-	/* FIXME: find out why Bspec's 100us timeout is too short */
-	ret = wait_for_us((intel_de_read(i915, XELPDP_PORT_BUF_CTL1(i915, port)) &
-			   XELPDP_PORT_BUF_PHY_IDLE), 10000);
-	if (ret)
-		drm_err(&i915->drm, "Timeout waiting for DDI BUF %c to get idle\n",
-			port_name(port));
+	if (DISPLAY_VER(display) >= 14)
+		return XELPDP_PORT_BUF_CTL1(i915, port);
+	else
+		return DDI_BUF_CTL(port);
 }
 
 void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
 			     enum port port)
 {
-	if (IS_BROXTON(dev_priv)) {
+	struct intel_display *display = &dev_priv->display;
+
+	/*
+	 * Bspec's platform specific timeouts:
+	 * MTL+   : 100 us
+	 * BXT    : fixed 16 us
+	 * HSW-ADL: 8 us
+	 *
+	 * FIXME: MTL requires 10 ms based on tests, find out why 100 us is too short
+	 */
+	if (display->platform.broxton) {
 		udelay(16);
 		return;
 	}
 
-	if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
-			 DDI_BUF_IS_IDLE), 8))
-		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get idle\n",
+	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
+	if (intel_de_wait_for_set(display, intel_ddi_buf_status_reg(display, port),
+				  DDI_BUF_IS_IDLE, 10))
+		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get idle\n",
 			port_name(port));
 }
 
 static void intel_wait_ddi_buf_active(struct intel_encoder *encoder)
 {
-	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+	struct intel_display *display = to_intel_display(encoder);
 	enum port port = encoder->port;
-	int timeout_us;
-	int ret;
 
-	/* Wait > 518 usecs for DDI_BUF_CTL to be non idle */
-	if (DISPLAY_VER(dev_priv) < 10) {
+	/*
+	 * Bspec's platform specific timeouts:
+	 * MTL+             : 10000 us
+	 * DG2              : 1200 us
+	 * TGL-ADL combo PHY: 1000 us
+	 * TGL-ADL TypeC PHY: 3000 us
+	 * HSW-ICL          : fixed 518 us
+	 */
+	if (DISPLAY_VER(display) < 10) {
 		usleep_range(518, 1000);
 		return;
 	}
 
-	if (DISPLAY_VER(dev_priv) >= 14) {
-		timeout_us = 10000;
-	} else if (IS_DG2(dev_priv)) {
-		timeout_us = 1200;
-	} else if (DISPLAY_VER(dev_priv) >= 12) {
-		if (intel_encoder_is_tc(encoder))
-			timeout_us = 3000;
-		else
-			timeout_us = 1000;
-	} else {
-		timeout_us = 500;
-	}
-
-	if (DISPLAY_VER(dev_priv) >= 14)
-		ret = _wait_for(!(intel_de_read(dev_priv,
-						XELPDP_PORT_BUF_CTL1(dev_priv, port)) &
-				  XELPDP_PORT_BUF_PHY_IDLE),
-				timeout_us, 10, 10);
-	else
-		ret = _wait_for(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & DDI_BUF_IS_IDLE),
-				timeout_us, 10, 10);
-
-	if (ret)
-		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get active\n",
+	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
+	if (intel_de_wait_for_clear(display, intel_ddi_buf_status_reg(display, port),
+				    DDI_BUF_IS_IDLE, 10))
+		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get active\n",
 			port_name(port));
 }
 
@@ -3067,7 +3061,7 @@ static void mtl_disable_ddi_buf(struct intel_encoder *encoder,
 	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
 
 	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
-	mtl_wait_ddi_buf_idle(dev_priv, port);
+	intel_wait_ddi_buf_idle(dev_priv, port);
 
 	/* 3.d Disable D2D Link */
 	mtl_ddi_disable_d2d_link(encoder);
-- 
2.44.2


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

* [PATCH 08/17] drm/i915/ddi: Move platform checks within mtl_ddi_enable/disable_d2d_link()
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (6 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle " Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-05 12:42   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 09/17] drm/i915/ddi: Unify the platform specific functions disabling a port Imre Deak
                   ` (11 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

The prefix of the mtl_ddi_enable_d2d() / mtl_ddi_disable_d2d_link()
names show already what are the relevant platforms, so the corresponding
platform check is a detail that can be hidden in the functions, do so.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index d040558b5d029..07188606a0177 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2545,6 +2545,9 @@ mtl_ddi_enable_d2d(struct intel_encoder *encoder)
 	i915_reg_t reg;
 	u32 set_bits, wait_bits;
 
+	if (DISPLAY_VER(dev_priv) < 14)
+		return;
+
 	if (DISPLAY_VER(dev_priv) >= 20) {
 		reg = DDI_BUF_CTL(port);
 		set_bits = XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
@@ -3035,6 +3038,9 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
 	i915_reg_t reg;
 	u32 clr_bits, wait_bits;
 
+	if (DISPLAY_VER(dev_priv) < 14)
+		return;
+
 	if (DISPLAY_VER(dev_priv) >= 20) {
 		reg = DDI_BUF_CTL(port);
 		clr_bits = XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
@@ -3411,8 +3417,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 		hsw_prepare_hdmi_ddi_buffers(encoder, crtc_state);
 
 	/* e. Enable D2D Link for C10/C20 Phy */
-	if (DISPLAY_VER(dev_priv) >= 14)
-		mtl_ddi_enable_d2d(encoder);
+	mtl_ddi_enable_d2d(encoder);
 
 	encoder->set_signal_levels(encoder, crtc_state);
 
-- 
2.44.2


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

* [PATCH 09/17] drm/i915/ddi: Unify the platform specific functions disabling a port
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (7 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 08/17] drm/i915/ddi: Move platform checks within mtl_ddi_enable/disable_d2d_link() Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-05 12:45   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 10/17] drm/i915/ddi: Add a helper to enable " Imre Deak
                   ` (10 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

The functions disabling a port for MTL+ and earlier platforms only
differ by an extra step on MTL+ (to disable the D2D link) and the point
at which the port's idle state is waited for. Combine the two functions
accounting for the above differences, removing the duplication.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 43 ++++--------------------
 1 file changed, 7 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 07188606a0177..73702ccbb3773 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3057,58 +3057,29 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
 			port_name(port));
 }
 
-static void mtl_disable_ddi_buf(struct intel_encoder *encoder,
-				const struct intel_crtc_state *crtc_state)
+static void intel_disable_ddi_buf(struct intel_encoder *encoder,
+				  const struct intel_crtc_state *crtc_state)
 {
+	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	enum port port = encoder->port;
 
-	/* 3.b Clear DDI_CTL_DE Enable to 0. */
 	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
 
-	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
-	intel_wait_ddi_buf_idle(dev_priv, port);
+	if (DISPLAY_VER(display) >= 14)
+		intel_wait_ddi_buf_idle(dev_priv, port);
 
-	/* 3.d Disable D2D Link */
 	mtl_ddi_disable_d2d_link(encoder);
 
-	/* 3.e Disable DP_TP_CTL */
 	if (intel_crtc_has_dp_encoder(crtc_state)) {
 		intel_de_rmw(dev_priv, dp_tp_ctl_reg(encoder, crtc_state),
 			     DP_TP_CTL_ENABLE, 0);
 	}
-}
-
-static void disable_ddi_buf(struct intel_encoder *encoder,
-			    const struct intel_crtc_state *crtc_state)
-{
-	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	enum port port = encoder->port;
-
-	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
-
-	if (intel_crtc_has_dp_encoder(crtc_state))
-		intel_de_rmw(dev_priv, dp_tp_ctl_reg(encoder, crtc_state),
-			     DP_TP_CTL_ENABLE, 0);
 
 	intel_ddi_disable_fec(encoder, crtc_state);
 
-	intel_wait_ddi_buf_idle(dev_priv, port);
-}
-
-static void intel_disable_ddi_buf(struct intel_encoder *encoder,
-				  const struct intel_crtc_state *crtc_state)
-{
-	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-
-	if (DISPLAY_VER(dev_priv) >= 14) {
-		mtl_disable_ddi_buf(encoder, crtc_state);
-
-		/* 3.f Disable DP_TP_CTL FEC Enable if it is needed */
-		intel_ddi_disable_fec(encoder, crtc_state);
-	} else {
-		disable_ddi_buf(encoder, crtc_state);
-	}
+	if (DISPLAY_VER(display) < 14)
+		intel_wait_ddi_buf_idle(dev_priv, port);
 
 	intel_ddi_wait_for_fec_status(encoder, crtc_state, false);
 }
-- 
2.44.2


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

* [PATCH 10/17] drm/i915/ddi: Add a helper to enable a port
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (8 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 09/17] drm/i915/ddi: Unify the platform specific functions disabling a port Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-05 12:49   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 11/17] drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions Imre Deak
                   ` (9 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

Add a helper to enable a port instead of open-coding it.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 34 +++++++++++-------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 73702ccbb3773..ddb182550ad0f 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3057,6 +3057,17 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
 			port_name(port));
 }
 
+static void intel_enable_ddi_buf(struct intel_encoder *encoder, u32 buf_ctl)
+{
+	struct intel_display *display = to_intel_display(encoder);
+	enum port port = encoder->port;
+
+	intel_de_write(display, DDI_BUF_CTL(port), buf_ctl | DDI_BUF_CTL_ENABLE);
+	intel_de_posting_read(display, DDI_BUF_CTL(port));
+
+	intel_wait_ddi_buf_active(encoder);
+}
+
 static void intel_disable_ddi_buf(struct intel_encoder *encoder,
 				  const struct intel_crtc_state *crtc_state)
 {
@@ -3375,7 +3386,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
 	struct drm_connector *connector = conn_state->connector;
 	enum port port = encoder->port;
-	u32 buf_ctl;
+	u32 buf_ctl = 0;
 
 	if (!intel_hdmi_handle_sink_scrambling(encoder, connector,
 					       crtc_state->hdmi_high_tmds_clock_ratio,
@@ -3440,8 +3451,6 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 	 * is filled with lane count, already set in the crtc_state.
 	 * The same is required to be filled in PORT_BUF_CTL for C10/20 Phy.
 	 */
-	buf_ctl = DDI_BUF_CTL_ENABLE;
-
 	if (dig_port->lane_reversal)
 		buf_ctl |= DDI_BUF_PORT_REVERSAL;
 	if (dig_port->ddi_a_4_lanes)
@@ -3467,9 +3476,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 		buf_ctl |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
 	}
 
-	intel_de_write(dev_priv, DDI_BUF_CTL(port), buf_ctl);
-
-	intel_wait_ddi_buf_active(encoder);
+	intel_enable_ddi_buf(encoder, buf_ctl);
 }
 
 static void intel_ddi_enable(struct intel_atomic_state *state,
@@ -3692,7 +3699,6 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	struct intel_display *display = to_intel_display(crtc_state);
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct intel_encoder *encoder = &dig_port->base;
-	enum port port = encoder->port;
 	u32 dp_tp_ctl;
 
 	/*
@@ -3726,15 +3732,11 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	mtl_port_buf_ctl_program(encoder, crtc_state);
 
 	/* 6.i Configure and enable DDI_CTL_DE to start sending valid data to port slice */
-	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
 	if (DISPLAY_VER(display) >= 20)
 		intel_dp->DP |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
 
-	intel_de_write(display, DDI_BUF_CTL(port), intel_dp->DP);
-	intel_de_posting_read(display, DDI_BUF_CTL(port));
-
-	/* 6.j Poll for PORT_BUF_CTL Idle Status == 0, timeout after 100 us */
-	intel_wait_ddi_buf_active(encoder);
+	intel_enable_ddi_buf(encoder, intel_dp->DP);
+	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
 }
 
 static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
@@ -3743,7 +3745,6 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct intel_encoder *encoder = &dig_port->base;
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	enum port port = encoder->port;
 	u32 dp_tp_ctl;
 
 	dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
@@ -3766,11 +3767,8 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	    (intel_tc_port_in_dp_alt_mode(dig_port) || intel_tc_port_in_legacy_mode(dig_port)))
 		adlp_tbt_to_dp_alt_switch_wa(encoder);
 
+	intel_enable_ddi_buf(encoder, intel_dp->DP);
 	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
-	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
-	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
-
-	intel_wait_ddi_buf_active(encoder);
 }
 
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
-- 
2.44.2


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

* [PATCH 11/17] drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (9 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 10/17] drm/i915/ddi: Add a helper to enable " Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-05 12:52   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 12/17] drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write Imre Deak
                   ` (8 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Imre Deak

From: Imre Deak <imre.deak@gmail.com>

Align the DDI_BUF_CTL register flag definitions with how this is done
elsewhere.

Signed-off-by: Imre Deak <imre.deak@gmail.com>
---
 drivers/gpu/drm/i915/i915_reg.h | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 7fe4e71fc08ec..5cee6a96270af 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3621,27 +3621,29 @@ enum skl_power_gate {
 #define _DDI_BUF_CTL_B				0x64100
 /* Known as DDI_CTL_DE in MTL+ */
 #define DDI_BUF_CTL(port) _MMIO_PORT(port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B)
-#define  DDI_BUF_CTL_ENABLE			(1 << 31)
+#define  DDI_BUF_CTL_ENABLE			REG_BIT(31)
 #define  XE2LPD_DDI_BUF_D2D_LINK_ENABLE		REG_BIT(29)
 #define  XE2LPD_DDI_BUF_D2D_LINK_STATE		REG_BIT(28)
-#define  DDI_BUF_TRANS_SELECT(n)	((n) << 24)
-#define  DDI_BUF_EMP_MASK			(0xf << 24)
-#define  DDI_BUF_PHY_LINK_RATE(r)		((r) << 20)
+#define  DDI_BUF_EMP_MASK			REG_GENMASK(27, 24)
+#define  DDI_BUF_TRANS_SELECT(n)		REG_FIELD_PREP(DDI_BUF_EMP_MASK, n)
+#define  DDI_BUF_PHY_LINK_RATE_MASK		REG_GENMASK(23, 20)
+#define  DDI_BUF_PHY_LINK_RATE(r)		REG_FIELD_PREP(DDI_BUF_PHY_LINK_RATE_MASK, r)
 #define  DDI_BUF_PORT_DATA_MASK			REG_GENMASK(19, 18)
 #define  DDI_BUF_PORT_DATA_10BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 0)
 #define  DDI_BUF_PORT_DATA_20BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 1)
 #define  DDI_BUF_PORT_DATA_40BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 2)
-#define  DDI_BUF_PORT_REVERSAL			(1 << 16)
+#define  DDI_BUF_PORT_REVERSAL			REG_BIT(16)
 #define  DDI_BUF_LANE_STAGGER_DELAY_MASK	REG_GENMASK(15, 8)
 #define  DDI_BUF_LANE_STAGGER_DELAY(symbols)	REG_FIELD_PREP(DDI_BUF_LANE_STAGGER_DELAY_MASK, \
 							       symbols)
-#define  DDI_BUF_IS_IDLE			(1 << 7)
+#define  DDI_BUF_IS_IDLE			REG_BIT(7)
 #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
-#define  DDI_A_4_LANES				(1 << 4)
-#define  DDI_PORT_WIDTH(width)			(((width) == 3 ? 4 : ((width) - 1)) << 1)
-#define  DDI_PORT_WIDTH_MASK			(7 << 1)
+#define  DDI_A_4_LANES				REG_BIT(4)
+#define  DDI_PORT_WIDTH_MASK			REG_GENMASK(3, 1)
+#define  DDI_PORT_WIDTH(width)			REG_FIELD_PREP(DDI_PORT_WIDTH_MASK, \
+							       (width) == 3 ? 4 : (width) - 1)
 #define  DDI_PORT_WIDTH_SHIFT			1
-#define  DDI_INIT_DISPLAY_DETECTED		(1 << 0)
+#define  DDI_INIT_DISPLAY_DETECTED		REG_BIT(0)
 
 /* DDI Buffer Translations */
 #define _DDI_BUF_TRANS_A		0x64E00
-- 
2.44.2


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

* [PATCH 12/17] drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (10 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 11/17] drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-10 18:13   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 13/17] drm/i915/ddi: Factor out a helper to get DDI_BUF_CTL's config value Imre Deak
                   ` (7 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Imre Deak

From: Imre Deak <imre.deak@gmail.com>

The various flags in DDI_BUF_CTL must be programmed at different places
during a modeset. The expected value of the register at any moment is
cached in the intel_dp::DP variable and the whole register is written
using this variable. A simpler way would be not maintaining the cached
value of the register at all and update only specific fields in the
register via read-modify-write. Some places - like D2D link enabling or
the port disabling - use RMW already.

Based on the above update the register via RMW during the port
configuration / enabling as well. After all the places updating
DDI_BUF_CTL are changed - probably the voltage-swing/pre-emphasis level
setting is the only one remaining - tracking the register value in
intel_dp:DP could be removed.

Signed-off-by: Imre Deak <imre.deak@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index ddb182550ad0f..64c42505f2ad6 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -359,6 +359,10 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
 
 	if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
 		intel_dp->DP |= ddi_buf_phy_link_rate(crtc_state->port_clock);
+		/*
+		 * TODO: remove the following once DDI_BUF_CTL is updated via
+		 * an RMW everywhere.
+		 */
 		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
 			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
 	}
@@ -370,6 +374,22 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
 	}
 }
 
+static u32 intel_ddi_buf_ctl_config_mask(struct intel_encoder *encoder)
+{
+	struct intel_display *display = to_intel_display(encoder);
+	u32 mask = DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES |
+		   DDI_PORT_WIDTH_MASK;
+
+	if (DISPLAY_VER(display) >= 14)
+		mask |= DDI_BUF_PORT_DATA_MASK;
+	if (display->platform.alderlake_p)
+		mask |= DDI_BUF_PHY_LINK_RATE_MASK;
+	if (IS_DISPLAY_VER(display, 11, 13))
+		mask |= DDI_BUF_LANE_STAGGER_DELAY_MASK;
+
+	return mask;
+}
+
 static int icl_calc_tbt_pll_link(struct drm_i915_private *dev_priv,
 				 enum port port)
 {
@@ -3062,7 +3082,8 @@ static void intel_enable_ddi_buf(struct intel_encoder *encoder, u32 buf_ctl)
 	struct intel_display *display = to_intel_display(encoder);
 	enum port port = encoder->port;
 
-	intel_de_write(display, DDI_BUF_CTL(port), buf_ctl | DDI_BUF_CTL_ENABLE);
+	intel_de_rmw(display, DDI_BUF_CTL(port),
+		     intel_ddi_buf_ctl_config_mask(encoder), buf_ctl | DDI_BUF_CTL_ENABLE);
 	intel_de_posting_read(display, DDI_BUF_CTL(port));
 
 	intel_wait_ddi_buf_active(encoder);
-- 
2.44.2


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

* [PATCH 13/17] drm/i915/ddi: Factor out a helper to get DDI_BUF_CTL's config value
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (11 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 12/17] drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-10 18:06   ` Jani Nikula
  2025-01-29 20:02 ` [PATCH 14/17] drm/i915/ddi: Reuse helper to compute the HDMI DDI_BUF_CTL config Imre Deak
                   ` (6 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

Factor out a function to get the configuration fields in the DDI_BUF_CTL
register. This can be used for configuring an HDMI output as well.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 32 ++++++++++++++++--------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 64c42505f2ad6..dd8ae5cf96c70 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -333,45 +333,55 @@ static int dp_phy_lane_stagger_delay(int port_clock)
 	return DIV_ROUND_UP(port_clock, intel_dp_link_symbol_size(port_clock) * 1000);
 }
 
-static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
-				      const struct intel_crtc_state *crtc_state)
+static u32 intel_ddi_buf_ctl_config_val(struct intel_encoder *encoder,
+					const struct intel_crtc_state *crtc_state)
 {
 	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
-	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
 	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
+	u32 val = 0;
 
 	/* DDI_BUF_CTL_ENABLE will be set by intel_ddi_prepare_link_retrain() later */
-	intel_dp->DP = DDI_PORT_WIDTH(crtc_state->lane_count) |
+	val |= DDI_PORT_WIDTH(crtc_state->lane_count) |
 		DDI_BUF_TRANS_SELECT(0);
 
 	if (dig_port->lane_reversal)
-		intel_dp->DP |= DDI_BUF_PORT_REVERSAL;
+		val |= DDI_BUF_PORT_REVERSAL;
 	if (dig_port->ddi_a_4_lanes)
-		intel_dp->DP |= DDI_A_4_LANES;
+		val |= DDI_A_4_LANES;
 
 	if (DISPLAY_VER(i915) >= 14) {
 		if (intel_dp_is_uhbr(crtc_state))
-			intel_dp->DP |= DDI_BUF_PORT_DATA_40BIT;
+			val |= DDI_BUF_PORT_DATA_40BIT;
 		else
-			intel_dp->DP |= DDI_BUF_PORT_DATA_10BIT;
+			val |= DDI_BUF_PORT_DATA_10BIT;
 	}
 
 	if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
-		intel_dp->DP |= ddi_buf_phy_link_rate(crtc_state->port_clock);
+		val |= ddi_buf_phy_link_rate(crtc_state->port_clock);
 		/*
 		 * TODO: remove the following once DDI_BUF_CTL is updated via
 		 * an RMW everywhere.
 		 */
 		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
-			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
+			val |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
 	}
 
 	if (IS_DISPLAY_VER(display, 11, 13) && intel_encoder_is_tc(encoder)) {
 		int delay = dp_phy_lane_stagger_delay(crtc_state->port_clock);
 
-		intel_dp->DP |= DDI_BUF_LANE_STAGGER_DELAY(delay);
+		val |= DDI_BUF_LANE_STAGGER_DELAY(delay);
 	}
+
+	return val;
+}
+
+static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
+				      const struct intel_crtc_state *crtc_state)
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+
+	intel_dp->DP = intel_ddi_buf_ctl_config_val(encoder, crtc_state);
 }
 
 static u32 intel_ddi_buf_ctl_config_mask(struct intel_encoder *encoder)
-- 
2.44.2


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

* [PATCH 14/17] drm/i915/ddi: Reuse helper to compute the HDMI DDI_BUF_CTL config
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (12 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 13/17] drm/i915/ddi: Factor out a helper to get DDI_BUF_CTL's config value Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-11 14:06   ` Kahola, Mika
  2025-01-29 20:02 ` [PATCH 15/17] drm/i915/ddi: Reuse helper to compute the HDMI PORT_BUF_CTL1 config Imre Deak
                   ` (5 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

Reuse the existing helper to compute the configuration value of the
DDI_BUF_CTL register for HDMI outputs instead of open-coding this.

Note that dropping the XE2LPD_DDI_BUF_D2D_LINK_ENABLE flag is ok,
since an earlier mtl_ddi_enable_d2d() has set it already and
intel_enable_ddi_buf()'s RMW will not update this flag.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 30 ++++++++----------------
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index dd8ae5cf96c70..e03ec9a235d33 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -339,11 +339,14 @@ static u32 intel_ddi_buf_ctl_config_val(struct intel_encoder *encoder,
 	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
 	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
+	bool is_dp = intel_crtc_has_dp_encoder(crtc_state);
 	u32 val = 0;
 
 	/* DDI_BUF_CTL_ENABLE will be set by intel_ddi_prepare_link_retrain() later */
-	val |= DDI_PORT_WIDTH(crtc_state->lane_count) |
-		DDI_BUF_TRANS_SELECT(0);
+	if (is_dp || DISPLAY_VER(display) >= 14)
+		val |= DDI_PORT_WIDTH(crtc_state->lane_count);
+
+	val |= DDI_BUF_TRANS_SELECT(0);
 
 	if (dig_port->lane_reversal)
 		val |= DDI_BUF_PORT_REVERSAL;
@@ -351,14 +354,15 @@ static u32 intel_ddi_buf_ctl_config_val(struct intel_encoder *encoder,
 		val |= DDI_A_4_LANES;
 
 	if (DISPLAY_VER(i915) >= 14) {
-		if (intel_dp_is_uhbr(crtc_state))
+		if (is_dp && intel_dp_is_uhbr(crtc_state))
 			val |= DDI_BUF_PORT_DATA_40BIT;
 		else
 			val |= DDI_BUF_PORT_DATA_10BIT;
 	}
 
 	if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
-		val |= ddi_buf_phy_link_rate(crtc_state->port_clock);
+		if (is_dp)
+			val |= ddi_buf_phy_link_rate(crtc_state->port_clock);
 		/*
 		 * TODO: remove the following once DDI_BUF_CTL is updated via
 		 * an RMW everywhere.
@@ -367,7 +371,7 @@ static u32 intel_ddi_buf_ctl_config_val(struct intel_encoder *encoder,
 			val |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
 	}
 
-	if (IS_DISPLAY_VER(display, 11, 13) && intel_encoder_is_tc(encoder)) {
+	if (is_dp && IS_DISPLAY_VER(display, 11, 13) && intel_encoder_is_tc(encoder)) {
 		int delay = dp_phy_lane_stagger_delay(crtc_state->port_clock);
 
 		val |= DDI_BUF_LANE_STAGGER_DELAY(delay);
@@ -3417,7 +3421,6 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
 	struct drm_connector *connector = conn_state->connector;
 	enum port port = encoder->port;
-	u32 buf_ctl = 0;
 
 	if (!intel_hdmi_handle_sink_scrambling(encoder, connector,
 					       crtc_state->hdmi_high_tmds_clock_ratio,
@@ -3482,11 +3485,6 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 	 * is filled with lane count, already set in the crtc_state.
 	 * The same is required to be filled in PORT_BUF_CTL for C10/20 Phy.
 	 */
-	if (dig_port->lane_reversal)
-		buf_ctl |= DDI_BUF_PORT_REVERSAL;
-	if (dig_port->ddi_a_4_lanes)
-		buf_ctl |= DDI_A_4_LANES;
-
 	if (DISPLAY_VER(dev_priv) >= 14) {
 		u32 port_buf = 0;
 
@@ -3497,17 +3495,9 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 
 		intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(dev_priv, port),
 			     XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_REVERSAL, port_buf);
-
-		buf_ctl |= DDI_PORT_WIDTH(crtc_state->lane_count);
-
-		if (DISPLAY_VER(dev_priv) >= 20)
-			buf_ctl |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
-	} else if (IS_ALDERLAKE_P(dev_priv) && intel_encoder_is_tc(encoder)) {
-		drm_WARN_ON(&dev_priv->drm, !intel_tc_port_in_legacy_mode(dig_port));
-		buf_ctl |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
 	}
 
-	intel_enable_ddi_buf(encoder, buf_ctl);
+	intel_enable_ddi_buf(encoder, intel_ddi_buf_ctl_config_val(encoder, crtc_state));
 }
 
 static void intel_ddi_enable(struct intel_atomic_state *state,
-- 
2.44.2


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

* [PATCH 15/17] drm/i915/ddi: Reuse helper to compute the HDMI PORT_BUF_CTL1 config
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (13 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 14/17] drm/i915/ddi: Reuse helper to compute the HDMI DDI_BUF_CTL config Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-12  9:51   ` Kahola, Mika
  2025-01-29 20:02 ` [PATCH 16/17] drm/i915/ddi: Move platform/encoder checks within adlp_tbt_to_dp_alt_switch_wa() Imre Deak
                   ` (4 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

Reuse the existing helper to compute the configuration value of the
XELPDP_PORT_BUF_CTL1 register for HDMI outputs instead of open-coding
this.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index e03ec9a235d33..431db1e6b6f07 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2607,9 +2607,12 @@ static void mtl_port_buf_ctl_program(struct intel_encoder *encoder,
 	enum port port = encoder->port;
 	u32 val = 0;
 
+	if (DISPLAY_VER(display) < 14)
+		return;
+
 	val |= XELPDP_PORT_WIDTH(crtc_state->lane_count);
 
-	if (intel_dp_is_uhbr(crtc_state))
+	if (intel_crtc_has_dp_encoder(crtc_state) && intel_dp_is_uhbr(crtc_state))
 		val |= XELPDP_PORT_BUF_PORT_DATA_40BIT;
 	else
 		val |= XELPDP_PORT_BUF_PORT_DATA_10BIT;
@@ -2618,7 +2621,8 @@ static void mtl_port_buf_ctl_program(struct intel_encoder *encoder,
 		val |= XELPDP_PORT_REVERSAL;
 
 	intel_de_rmw(display, XELPDP_PORT_BUF_CTL1(display, port),
-		     XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_BUF_PORT_DATA_WIDTH_MASK,
+		     XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_REVERSAL |
+		     XELPDP_PORT_BUF_PORT_DATA_WIDTH_MASK,
 		     val);
 }
 
@@ -3418,7 +3422,6 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 {
 	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
 	struct drm_connector *connector = conn_state->connector;
 	enum port port = encoder->port;
 
@@ -3485,17 +3488,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 	 * is filled with lane count, already set in the crtc_state.
 	 * The same is required to be filled in PORT_BUF_CTL for C10/20 Phy.
 	 */
-	if (DISPLAY_VER(dev_priv) >= 14) {
-		u32 port_buf = 0;
-
-		port_buf |= XELPDP_PORT_WIDTH(crtc_state->lane_count);
-
-		if (dig_port->lane_reversal)
-			port_buf |= XELPDP_PORT_REVERSAL;
-
-		intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(dev_priv, port),
-			     XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_REVERSAL, port_buf);
-	}
+	mtl_port_buf_ctl_program(encoder, crtc_state);
 
 	intel_enable_ddi_buf(encoder, intel_ddi_buf_ctl_config_val(encoder, crtc_state));
 }
-- 
2.44.2


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

* [PATCH 16/17] drm/i915/ddi: Move platform/encoder checks within adlp_tbt_to_dp_alt_switch_wa()
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (14 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 15/17] drm/i915/ddi: Reuse helper to compute the HDMI PORT_BUF_CTL1 config Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-12 11:06   ` Kahola, Mika
  2025-01-29 20:02 ` [PATCH 17/17] drm/i915/ddi: Unify the platform specific functions enabling a port Imre Deak
                   ` (3 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Imre Deak

From: Imre Deak <imre.deak@gmail.com>

The prefix of adlp_tbt_to_dp_alt_switch_wa() function name shows already
what is the relevant platform and encoder type/mode, so the
corresponding checks are a detail that can be hidden in the
function, do so.

Signed-off-by: Imre Deak <imre.deak@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 431db1e6b6f07..a2d82a4c4aa77 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3699,10 +3699,16 @@ intel_ddi_pre_pll_enable(struct intel_atomic_state *state,
 
 static void adlp_tbt_to_dp_alt_switch_wa(struct intel_encoder *encoder)
 {
+	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
+	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
 	enum tc_port tc_port = intel_encoder_to_tc(encoder);
 	int ln;
 
+	if (!display->platform.alderlake_p ||
+	    (!intel_tc_port_in_dp_alt_mode(dig_port) && !intel_tc_port_in_legacy_mode(dig_port)))
+		return;
+
 	for (ln = 0; ln < 2; ln++)
 		intel_dkl_phy_rmw(i915, DKL_PCS_DW5(tc_port, ln), DKL_PCS_DW5_CORE_SOFTRESET, 0);
 }
@@ -3777,9 +3783,7 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	intel_de_write(dev_priv, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
 	intel_de_posting_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
 
-	if (IS_ALDERLAKE_P(dev_priv) &&
-	    (intel_tc_port_in_dp_alt_mode(dig_port) || intel_tc_port_in_legacy_mode(dig_port)))
-		adlp_tbt_to_dp_alt_switch_wa(encoder);
+	adlp_tbt_to_dp_alt_switch_wa(encoder);
 
 	intel_enable_ddi_buf(encoder, intel_dp->DP);
 	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
-- 
2.44.2


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

* [PATCH 17/17] drm/i915/ddi: Unify the platform specific functions enabling a port
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (15 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 16/17] drm/i915/ddi: Move platform/encoder checks within adlp_tbt_to_dp_alt_switch_wa() Imre Deak
@ 2025-01-29 20:02 ` Imre Deak
  2025-02-12 11:26   ` Kahola, Mika
  2025-01-29 21:14 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/ddi: Fix/simplify port enabling/disabling Patchwork
                   ` (2 subsequent siblings)
  19 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-01-29 20:02 UTC (permalink / raw)
  To: intel-gfx, intel-xe

The functions enabling a port (as part of link training) for MTL+ and
earlier platforms only differ by extra steps on MTL+:
- enable the D2D link
- set the link parameters
- configure the PORT_BUF_CTL1 register

and an extra step on earlier platforms:
- apply an ADLP TypeC workaround

All the extra steps are already/can be skipped on unrelated platforms.
Combine the two functions accounting for the above differences, removing
the duplication.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 52 ++++--------------------
 1 file changed, 8 insertions(+), 44 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index a2d82a4c4aa77..e8bea49a27dbc 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2721,7 +2721,7 @@ static void mtl_ddi_pre_enable_dp(struct intel_atomic_state *state,
 	 * stream or multi-stream master transcoder" can just be performed
 	 * unconditionally here.
 	 *
-	 * mtl_ddi_prepare_link_retrain() that is called by
+	 * intel_ddi_prepare_link_retrain() that is called by
 	 * intel_dp_start_link_train() will execute steps: 6.d, 6.f, 6.g, 6.h,
 	 * 6.i and 6.j
 	 *
@@ -3713,8 +3713,8 @@ static void adlp_tbt_to_dp_alt_switch_wa(struct intel_encoder *encoder)
 		intel_dkl_phy_rmw(i915, DKL_PCS_DW5(tc_port, ln), DKL_PCS_DW5_CORE_SOFTRESET, 0);
 }
 
-static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
-					 const struct intel_crtc_state *crtc_state)
+static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
+					   const struct intel_crtc_state *crtc_state)
 {
 	struct intel_display *display = to_intel_display(crtc_state);
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
@@ -3729,7 +3729,6 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 
 	drm_WARN_ON(display->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
 
-	/* 6.d Configure and enable DP_TP_CTL with link training pattern 1 selected */
 	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
 	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||
 	    intel_dp_is_uhbr(crtc_state)) {
@@ -3742,16 +3741,15 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	intel_de_write(display, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
 	intel_de_posting_read(display, dp_tp_ctl_reg(encoder, crtc_state));
 
-	/* 6.f Enable D2D Link */
+	adlp_tbt_to_dp_alt_switch_wa(encoder);
+
 	mtl_ddi_enable_d2d(encoder);
 
-	/* 6.g Configure voltage swing and related IO settings */
-	encoder->set_signal_levels(encoder, crtc_state);
+	if (DISPLAY_VER(display) >= 14)
+		encoder->set_signal_levels(encoder, crtc_state);
 
-	/* 6.h Configure PORT_BUF_CTL1 */
 	mtl_port_buf_ctl_program(encoder, crtc_state);
 
-	/* 6.i Configure and enable DDI_CTL_DE to start sending valid data to port slice */
 	if (DISPLAY_VER(display) >= 20)
 		intel_dp->DP |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
 
@@ -3759,36 +3757,6 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
 	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
 }
 
-static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
-					   const struct intel_crtc_state *crtc_state)
-{
-	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
-	struct intel_encoder *encoder = &dig_port->base;
-	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	u32 dp_tp_ctl;
-
-	dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
-
-	drm_WARN_ON(&dev_priv->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
-
-	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
-	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||
-	    intel_dp_is_uhbr(crtc_state)) {
-		dp_tp_ctl |= DP_TP_CTL_MODE_MST;
-	} else {
-		dp_tp_ctl |= DP_TP_CTL_MODE_SST;
-		if (crtc_state->enhanced_framing)
-			dp_tp_ctl |= DP_TP_CTL_ENHANCED_FRAME_ENABLE;
-	}
-	intel_de_write(dev_priv, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
-	intel_de_posting_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
-
-	adlp_tbt_to_dp_alt_switch_wa(encoder);
-
-	intel_enable_ddi_buf(encoder, intel_dp->DP);
-	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
-}
-
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
 				     const struct intel_crtc_state *crtc_state,
 				     u8 dp_train_pat)
@@ -4612,7 +4580,6 @@ static const struct drm_encoder_funcs intel_ddi_funcs = {
 
 static int intel_ddi_init_dp_connector(struct intel_digital_port *dig_port)
 {
-	struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
 	struct intel_connector *connector;
 	enum port port = dig_port->base.port;
 
@@ -4621,10 +4588,7 @@ static int intel_ddi_init_dp_connector(struct intel_digital_port *dig_port)
 		return -ENOMEM;
 
 	dig_port->dp.output_reg = DDI_BUF_CTL(port);
-	if (DISPLAY_VER(i915) >= 14)
-		dig_port->dp.prepare_link_retrain = mtl_ddi_prepare_link_retrain;
-	else
-		dig_port->dp.prepare_link_retrain = intel_ddi_prepare_link_retrain;
+	dig_port->dp.prepare_link_retrain = intel_ddi_prepare_link_retrain;
 	dig_port->dp.set_link_train = intel_ddi_set_link_train;
 	dig_port->dp.set_idle_link_train = intel_ddi_set_idle_link_train;
 
-- 
2.44.2


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

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915/ddi: Fix/simplify port enabling/disabling
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (16 preceding siblings ...)
  2025-01-29 20:02 ` [PATCH 17/17] drm/i915/ddi: Unify the platform specific functions enabling a port Imre Deak
@ 2025-01-29 21:14 ` Patchwork
  2025-01-29 21:14 ` ✗ Fi.CI.SPARSE: " Patchwork
  2025-01-29 21:30 ` ✗ i915.CI.BAT: failure " Patchwork
  19 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2025-01-29 21:14 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/ddi: Fix/simplify port enabling/disabling
URL   : https://patchwork.freedesktop.org/series/144122/
State : warning

== Summary ==

Error: dim checkpatch failed
393239b4a930 drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro
72f7abf7639f drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL
-:33: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'width' - possible side-effects?
#33: FILE: drivers/gpu/drm/i915/i915_reg.h:3638:
+#define  DDI_PORT_WIDTH(width)			(((width) == 3 ? 4 : ((width) - 1)) << 1)

total: 0 errors, 0 warnings, 1 checks, 16 lines checked
27f2c81f2436 drm/i915/ddi: Make all the PORT_WIDTH macros work the same way
-:23: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'width' - possible side-effects?
#23: FILE: drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h:113:
+#define   XELPDP_PORT_WIDTH(width)			REG_FIELD_PREP(XELPDP_PORT_WIDTH_MASK, \
+								       (width) == 3 ? 4 : (width) - 1)

-:24: WARNING:LONG_LINE: line length of 102 exceeds 100 columns
#24: FILE: drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h:114:
+								       (width) == 3 ? 4 : (width) - 1)

total: 0 errors, 1 warnings, 1 checks, 51 lines checked
b6d9e741cbe8 drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL
a8b8fc2964ef drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL
8dd698c540da drm/i915/ddi: Simplify the port disabling via DDI_BUF_CTL
a9f33a241a47 drm/i915/ddi: Simplify waiting for a port to idle via DDI_BUF_CTL
4ca0ab7e962c drm/i915/ddi: Move platform checks within mtl_ddi_enable/disable_d2d_link()
737bb169b41a drm/i915/ddi: Unify the platform specific functions disabling a port
4f1371dddcf0 drm/i915/ddi: Add a helper to enable a port
f30d2821af3d drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions
-:47: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'width' - possible side-effects?
#47: FILE: drivers/gpu/drm/i915/i915_reg.h:3643:
+#define  DDI_PORT_WIDTH(width)			REG_FIELD_PREP(DDI_PORT_WIDTH_MASK, \
+							       (width) == 3 ? 4 : (width) - 1)

total: 0 errors, 0 warnings, 1 checks, 39 lines checked
f509c0c72cc7 drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write
4ea9be828a73 drm/i915/ddi: Factor out a helper to get DDI_BUF_CTL's config value
8854946e6719 drm/i915/ddi: Reuse helper to compute the HDMI DDI_BUF_CTL config
d3a7a50b37a2 drm/i915/ddi: Reuse helper to compute the HDMI PORT_BUF_CTL1 config
230d99a3657a drm/i915/ddi: Move platform/encoder checks within adlp_tbt_to_dp_alt_switch_wa()
4ff7b0efe88b drm/i915/ddi: Unify the platform specific functions enabling a port



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

* ✗ Fi.CI.SPARSE: warning for drm/i915/ddi: Fix/simplify port enabling/disabling
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (17 preceding siblings ...)
  2025-01-29 21:14 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/ddi: Fix/simplify port enabling/disabling Patchwork
@ 2025-01-29 21:14 ` Patchwork
  2025-01-29 21:30 ` ✗ i915.CI.BAT: failure " Patchwork
  19 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2025-01-29 21:14 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/ddi: Fix/simplify port enabling/disabling
URL   : https://patchwork.freedesktop.org/series/144122/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:175:9:



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

* ✗ i915.CI.BAT: failure for drm/i915/ddi: Fix/simplify port enabling/disabling
  2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
                   ` (18 preceding siblings ...)
  2025-01-29 21:14 ` ✗ Fi.CI.SPARSE: " Patchwork
@ 2025-01-29 21:30 ` Patchwork
  19 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2025-01-29 21:30 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 4929 bytes --]

== Series Details ==

Series: drm/i915/ddi: Fix/simplify port enabling/disabling
URL   : https://patchwork.freedesktop.org/series/144122/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_16041 -> Patchwork_144122v1
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_144122v1 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_144122v1, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/index.html

Participating hosts (44 -> 43)
------------------------------

  Missing    (1): fi-snb-2520m 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_144122v1:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-b-dp-2:
    - fi-cfl-8109u:       [PASS][1] -> [DMESG-WARN][2] +1 other test dmesg-warn
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-b-dp-2.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-b-dp-2.html

  
Known issues
------------

  Here are the changes found in Patchwork_144122v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@load:
    - fi-pnv-d510:        [PASS][3] -> [ABORT][4] ([i915#13203])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/fi-pnv-d510/igt@i915_module_load@load.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/fi-pnv-d510/igt@i915_module_load@load.html

  * igt@i915_pm_rpm@module-reload:
    - bat-dg1-7:          [PASS][5] -> [FAIL][6] ([i915#13401])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/bat-dg1-7/igt@i915_pm_rpm@module-reload.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/bat-dg1-7/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live:
    - bat-twl-1:          [PASS][7] -> [ABORT][8] ([i915#12435] / [i915#12919] / [i915#13503])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/bat-twl-1/igt@i915_selftest@live.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/bat-twl-1/igt@i915_selftest@live.html

  * igt@i915_selftest@live@requests:
    - bat-twl-1:          [PASS][9] -> [ABORT][10] ([i915#12919])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/bat-twl-1/igt@i915_selftest@live@requests.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/bat-twl-1/igt@i915_selftest@live@requests.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence:
    - bat-dg2-11:         [PASS][11] -> [SKIP][12] ([i915#9197]) +3 other tests skip
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence.html

  
#### Possible fixes ####

  * igt@i915_module_load@load:
    - {bat-mtlp-9}:       [DMESG-WARN][13] ([i915#13494]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/bat-mtlp-9/igt@i915_module_load@load.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/bat-mtlp-9/igt@i915_module_load@load.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#12435]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12435
  [i915#12919]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12919
  [i915#13203]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13203
  [i915#13401]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13401
  [i915#13494]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13494
  [i915#13503]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13503
  [i915#9197]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9197


Build changes
-------------

  * Linux: CI_DRM_16041 -> Patchwork_144122v1

  CI-20190529: 20190529
  CI_DRM_16041: c2a5da40b8b1c5af77dcdabed8516069949fea3b @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_8214: 7a8a3744466fbb89127201077f030033c72df948 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_144122v1: c2a5da40b8b1c5af77dcdabed8516069949fea3b @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_144122v1/index.html

[-- Attachment #2: Type: text/html, Size: 5772 bytes --]

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

* Re: [PATCH 01/17] drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro
  2025-01-29 20:02 ` [PATCH 01/17] drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro Imre Deak
@ 2025-01-30 11:47   ` Jani Nikula
  0 siblings, 0 replies; 49+ messages in thread
From: Jani Nikula @ 2025-01-30 11:47 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> The format of the port width field in the DDI_BUF_CTL and the
> TRANS_DDI_FUNC_CTL registers are different starting with MTL, where the
> x3 lane mode for HDMI FRL has a different encoding in the two registers.
> To account for this use the TRANS_DDI_FUNC_CTL's own port width macro.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/icl_dsi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
> index ee1c3fb500a73..11bfb357508b7 100644
> --- a/drivers/gpu/drm/i915/display/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/display/icl_dsi.c
> @@ -809,8 +809,8 @@ gen11_dsi_configure_transcoder(struct intel_encoder *encoder,
>  		/* select data lane width */
>  		tmp = intel_de_read(display,
>  				    TRANS_DDI_FUNC_CTL(display, dsi_trans));
> -		tmp &= ~DDI_PORT_WIDTH_MASK;
> -		tmp |= DDI_PORT_WIDTH(intel_dsi->lane_count);
> +		tmp &= ~TRANS_DDI_PORT_WIDTH_MASK;
> +		tmp |= TRANS_DDI_PORT_WIDTH(intel_dsi->lane_count);
>  
>  		/* select input pipe */
>  		tmp &= ~TRANS_DDI_EDP_INPUT_MASK;

-- 
Jani Nikula, Intel

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

* Re: [PATCH 02/17] drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL
  2025-01-29 20:02 ` [PATCH 02/17] drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL Imre Deak
@ 2025-01-30 11:51   ` Jani Nikula
  2025-01-30 13:33     ` Imre Deak
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-01-30 11:51 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe; +Cc: Imre Deak

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> From: Imre Deak <imre.deak@gmail.com>
>
> Fix the port width programming in the DDI_BUF_CTL register on MTLP+,
> where this had an off-by-one error.

Fixes: b66a8abaa48a ("drm/i915/display/mtl: Fill port width in DDI_BUF_/TRANS_DDI_FUNC_/PORT_BUF_CTL for HDMI")
Cc: <stable@vger.kernel.org> # v6.5+
Reviewed-by: Jani Nikula <jani.nikula@intel.com>

However, if this gets backported, it'll break DSI. Patch 1 needs to
accompany it.

Either add the same Fixes line to patch 1, or squash patches 1-2
together.

>
> Signed-off-by: Imre Deak <imre.deak@gmail.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 2 +-
>  drivers/gpu/drm/i915/i915_reg.h          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index dc319f37b1be9..36e7dde422d37 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3501,7 +3501,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
>  		intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(dev_priv, port),
>  			     XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_REVERSAL, port_buf);
>  
> -		buf_ctl |= DDI_PORT_WIDTH(lane_count);
> +		buf_ctl |= DDI_PORT_WIDTH(crtc_state->lane_count);
>  
>  		if (DISPLAY_VER(dev_priv) >= 20)
>  			buf_ctl |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 03da51b03fb90..04e47d0a8ab92 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -3635,7 +3635,7 @@ enum skl_power_gate {
>  #define  DDI_BUF_IS_IDLE			(1 << 7)
>  #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
>  #define  DDI_A_4_LANES				(1 << 4)
> -#define  DDI_PORT_WIDTH(width)			(((width) - 1) << 1)
> +#define  DDI_PORT_WIDTH(width)			(((width) == 3 ? 4 : ((width) - 1)) << 1)
>  #define  DDI_PORT_WIDTH_MASK			(7 << 1)
>  #define  DDI_PORT_WIDTH_SHIFT			1
>  #define  DDI_INIT_DISPLAY_DETECTED		(1 << 0)

-- 
Jani Nikula, Intel

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

* Re: [PATCH 03/17] drm/i915/ddi: Make all the PORT_WIDTH macros work the same way
  2025-01-29 20:02 ` [PATCH 03/17] drm/i915/ddi: Make all the PORT_WIDTH macros work the same way Imre Deak
@ 2025-01-30 11:52   ` Jani Nikula
  0 siblings, 0 replies; 49+ messages in thread
From: Jani Nikula @ 2025-01-30 11:52 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> Make the PORT_WIDTH macro of the XELPDP_PORT_CTL1 register work the same
> way as those used for the DDI_BUF_CTL and the TRANS_DDI_FUNC_CTL
> registers: accept a width parameter and convert it to the given
> register's encoding.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  .../gpu/drm/i915/display/intel_cx0_phy_regs.h |  3 ++-
>  drivers/gpu/drm/i915/display/intel_ddi.c      | 22 ++-----------------
>  2 files changed, 4 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h b/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
> index 4a3cf08007e31..a24531656aa89 100644
> --- a/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
> +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
> @@ -110,7 +110,8 @@
>  #define   XELPDP_TCSS_POWER_REQUEST			REG_BIT(5)
>  #define   XELPDP_TCSS_POWER_STATE			REG_BIT(4)
>  #define   XELPDP_PORT_WIDTH_MASK			REG_GENMASK(3, 1)
> -#define   XELPDP_PORT_WIDTH(val)			REG_FIELD_PREP(XELPDP_PORT_WIDTH_MASK, val)
> +#define   XELPDP_PORT_WIDTH(width)			REG_FIELD_PREP(XELPDP_PORT_WIDTH_MASK, \
> +								       (width) == 3 ? 4 : (width) - 1)
>  
>  #define _XELPDP_PORT_BUF_CTL2(idx)			_MMIO(_PICK_EVEN_2RANGES(idx, PORT_TC1, \
>  										 _XELPDP_PORT_BUF_CTL1_LN0_A, \
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 36e7dde422d37..76e8296cb134b 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -2525,23 +2525,6 @@ static void intel_ddi_mso_configure(const struct intel_crtc_state *crtc_state)
>  		     OVERLAP_PIXELS_MASK, dss1);
>  }
>  
> -static u8 mtl_get_port_width(u8 lane_count)
> -{
> -	switch (lane_count) {
> -	case 1:
> -		return 0;
> -	case 2:
> -		return 1;
> -	case 3:
> -		return 4;
> -	case 4:
> -		return 3;
> -	default:
> -		MISSING_CASE(lane_count);
> -		return 4;
> -	}
> -}
> -
>  static void
>  mtl_ddi_enable_d2d(struct intel_encoder *encoder)
>  {
> @@ -2575,7 +2558,7 @@ static void mtl_port_buf_ctl_program(struct intel_encoder *encoder,
>  	enum port port = encoder->port;
>  	u32 val = 0;
>  
> -	val |= XELPDP_PORT_WIDTH(mtl_get_port_width(crtc_state->lane_count));
> +	val |= XELPDP_PORT_WIDTH(crtc_state->lane_count);
>  
>  	if (intel_dp_is_uhbr(crtc_state))
>  		val |= XELPDP_PORT_BUF_PORT_DATA_40BIT;
> @@ -3490,10 +3473,9 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
>  		buf_ctl |= DDI_A_4_LANES;
>  
>  	if (DISPLAY_VER(dev_priv) >= 14) {
> -		u8  lane_count = mtl_get_port_width(crtc_state->lane_count);
>  		u32 port_buf = 0;
>  
> -		port_buf |= XELPDP_PORT_WIDTH(lane_count);
> +		port_buf |= XELPDP_PORT_WIDTH(crtc_state->lane_count);
>  
>  		if (dig_port->lane_reversal)
>  			port_buf |= XELPDP_PORT_REVERSAL;

-- 
Jani Nikula, Intel

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

* Re: [PATCH 05/17] drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL
  2025-01-29 20:02 ` [PATCH 05/17] drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL Imre Deak
@ 2025-01-30 11:55   ` Jani Nikula
  2025-01-30 13:34     ` Imre Deak
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-01-30 11:55 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> In the past intel_digital_port::dp.prepare_link_retrain() could be
> called directly (vs. from a modeset) to retrain an enabled link. In that
> case the port had to be first disabled and then re-enabled. That changed
> with commit 2885d283cce5 ("drm/i915/dp: Retrain SST links via a modeset
> commit"), after which the only way prepare_link_retrain() can be called
> is from a modeset during link training when the port is still disabled.
> Simplify things accordingly, assuming the disabled port state.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 23 ++++-------------------
>  1 file changed, 4 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 6192c0d3c87a5..3138dc4034797 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3743,8 +3743,8 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
>  	 * necessary disable and enable port
>  	 */
>  	dp_tp_ctl = intel_de_read(display, dp_tp_ctl_reg(encoder, crtc_state));
> -	if (dp_tp_ctl & DP_TP_CTL_ENABLE)
> -		mtl_disable_ddi_buf(encoder, crtc_state);
> +
> +	drm_WARN_ON(display->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
>  
>  	/* 6.d Configure and enable DP_TP_CTL with link training pattern 1 selected */
>  	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
> @@ -3787,26 +3787,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
>  	struct intel_encoder *encoder = &dig_port->base;
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum port port = encoder->port;
> -	u32 dp_tp_ctl, ddi_buf_ctl;
> -	bool wait = false;
> +	u32 dp_tp_ctl;
>  
>  	dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
>  
> -	if (dp_tp_ctl & DP_TP_CTL_ENABLE) {
> -		ddi_buf_ctl = intel_de_read(dev_priv, DDI_BUF_CTL(port));
> -		if (ddi_buf_ctl & DDI_BUF_CTL_ENABLE) {
> -			intel_de_write(dev_priv, DDI_BUF_CTL(port),
> -				       ddi_buf_ctl & ~DDI_BUF_CTL_ENABLE);
> -			wait = true;
> -		}
> -
> -		dp_tp_ctl &= ~DP_TP_CTL_ENABLE;
> -		intel_de_write(dev_priv, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
> -		intel_de_posting_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
> -
> -		if (wait)
> -			intel_wait_ddi_buf_idle(dev_priv, port);
> -	}
> +	drm_WARN_ON(&dev_priv->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);

Please don't add new dev_priv uses. Add the local display variable and
use display->drm.

With that fixed,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>  
>  	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||

-- 
Jani Nikula, Intel

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

* Re: [PATCH 02/17] drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL
  2025-01-30 11:51   ` Jani Nikula
@ 2025-01-30 13:33     ` Imre Deak
  0 siblings, 0 replies; 49+ messages in thread
From: Imre Deak @ 2025-01-30 13:33 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, intel-xe, Imre Deak

On Thu, Jan 30, 2025 at 01:51:53PM +0200, Jani Nikula wrote:
> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > From: Imre Deak <imre.deak@gmail.com>
> >
> > Fix the port width programming in the DDI_BUF_CTL register on MTLP+,
> > where this had an off-by-one error.
> 
> Fixes: b66a8abaa48a ("drm/i915/display/mtl: Fill port width in DDI_BUF_/TRANS_DDI_FUNC_/PORT_BUF_CTL for HDMI")
> Cc: <stable@vger.kernel.org> # v6.5+

I wasn't sure if this has any effect on the HW, since HDMI seemed to
work at least on MTLP regardless. Earlier platforms ignored the port
width in DDI_BUF_CTL for HDMI, maybe it's actually the same on new HW
as well. But it's better to do what the spec says.

> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> However, if this gets backported, it'll break DSI. Patch 1 needs to
> accompany it.
> 
> Either add the same Fixes line to patch 1, or squash patches 1-2
> together.

Ok, will add the Fixes: line to patch 1 as well.

> > Signed-off-by: Imre Deak <imre.deak@gmail.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c | 2 +-
> >  drivers/gpu/drm/i915/i915_reg.h          | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index dc319f37b1be9..36e7dde422d37 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -3501,7 +3501,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
> >  		intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(dev_priv, port),
> >  			     XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_REVERSAL, port_buf);
> >  
> > -		buf_ctl |= DDI_PORT_WIDTH(lane_count);
> > +		buf_ctl |= DDI_PORT_WIDTH(crtc_state->lane_count);
> >  
> >  		if (DISPLAY_VER(dev_priv) >= 20)
> >  			buf_ctl |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index 03da51b03fb90..04e47d0a8ab92 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -3635,7 +3635,7 @@ enum skl_power_gate {
> >  #define  DDI_BUF_IS_IDLE			(1 << 7)
> >  #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
> >  #define  DDI_A_4_LANES				(1 << 4)
> > -#define  DDI_PORT_WIDTH(width)			(((width) - 1) << 1)
> > +#define  DDI_PORT_WIDTH(width)			(((width) == 3 ? 4 : ((width) - 1)) << 1)
> >  #define  DDI_PORT_WIDTH_MASK			(7 << 1)
> >  #define  DDI_PORT_WIDTH_SHIFT			1
> >  #define  DDI_INIT_DISPLAY_DETECTED		(1 << 0)
> 
> -- 
> Jani Nikula, Intel

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

* Re: [PATCH 05/17] drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL
  2025-01-30 11:55   ` Jani Nikula
@ 2025-01-30 13:34     ` Imre Deak
  0 siblings, 0 replies; 49+ messages in thread
From: Imre Deak @ 2025-01-30 13:34 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, intel-xe

On Thu, Jan 30, 2025 at 01:55:38PM +0200, Jani Nikula wrote:
> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > In the past intel_digital_port::dp.prepare_link_retrain() could be
> > called directly (vs. from a modeset) to retrain an enabled link. In that
> > case the port had to be first disabled and then re-enabled. That changed
> > with commit 2885d283cce5 ("drm/i915/dp: Retrain SST links via a modeset
> > commit"), after which the only way prepare_link_retrain() can be called
> > is from a modeset during link training when the port is still disabled.
> > Simplify things accordingly, assuming the disabled port state.
> >
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c | 23 ++++-------------------
> >  1 file changed, 4 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index 6192c0d3c87a5..3138dc4034797 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -3743,8 +3743,8 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> >  	 * necessary disable and enable port
> >  	 */
> >  	dp_tp_ctl = intel_de_read(display, dp_tp_ctl_reg(encoder, crtc_state));
> > -	if (dp_tp_ctl & DP_TP_CTL_ENABLE)
> > -		mtl_disable_ddi_buf(encoder, crtc_state);
> > +
> > +	drm_WARN_ON(display->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
> >  
> >  	/* 6.d Configure and enable DP_TP_CTL with link training pattern 1 selected */
> >  	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
> > @@ -3787,26 +3787,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> >  	struct intel_encoder *encoder = &dig_port->base;
> >  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> >  	enum port port = encoder->port;
> > -	u32 dp_tp_ctl, ddi_buf_ctl;
> > -	bool wait = false;
> > +	u32 dp_tp_ctl;
> >  
> >  	dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
> >  
> > -	if (dp_tp_ctl & DP_TP_CTL_ENABLE) {
> > -		ddi_buf_ctl = intel_de_read(dev_priv, DDI_BUF_CTL(port));
> > -		if (ddi_buf_ctl & DDI_BUF_CTL_ENABLE) {
> > -			intel_de_write(dev_priv, DDI_BUF_CTL(port),
> > -				       ddi_buf_ctl & ~DDI_BUF_CTL_ENABLE);
> > -			wait = true;
> > -		}
> > -
> > -		dp_tp_ctl &= ~DP_TP_CTL_ENABLE;
> > -		intel_de_write(dev_priv, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
> > -		intel_de_posting_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
> > -
> > -		if (wait)
> > -			intel_wait_ddi_buf_idle(dev_priv, port);
> > -	}
> > +	drm_WARN_ON(&dev_priv->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
> 
> Please don't add new dev_priv uses. Add the local display variable and
> use display->drm.

Ok, will update that.

> With that fixed,
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> 
> >  
> >  	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
> >  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||
> 
> -- 
> Jani Nikula, Intel

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

* Re: [PATCH 04/17] drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL
  2025-01-29 20:02 ` [PATCH 04/17] drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL Imre Deak
@ 2025-02-05 12:22   ` Jani Nikula
  2025-02-05 13:20     ` Imre Deak
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-02-05 12:22 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe; +Cc: Imre Deak

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> From: Imre Deak <imre.deak@gmail.com>
>
> Add the missing PHY lane stagger delay programming for ICL-ADL
> platforms on TypeC DP outputs.
>
> Bspec: 7534, 49533
> Signed-off-by: Imre Deak <imre.deak@gmail.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 18 ++++++++++++++++++
>  drivers/gpu/drm/i915/i915_reg.h          |  3 +++
>  2 files changed, 21 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 76e8296cb134b..6192c0d3c87a5 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -328,9 +328,21 @@ static u32 ddi_buf_phy_link_rate(int port_clock)
>  	}
>  }
>  
> +static int dp_phy_lane_stagger_delay(int port_clock)
> +{
> +	/*
> +	 * Return the number of link symbols per 100 ns:
> +	 * port_clock (10 kHz) -> bits    / 100 us
> +	 * / symbol_size       -> symbols / 100 us
> +	 * / 1000              -> symbols / 100 ns
> +	 */
> +	return DIV_ROUND_UP(port_clock, intel_dp_link_symbol_size(port_clock) * 1000);

Okay, this checks out, but it was incredibly difficult (for me) to
follow, even with the comment. The meaning of 100 ns is also not
documented i.e. we want a lane stagger delay of 100 ns or greater, and
we must express this in terms of symbols in the register.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> +}
> +
>  static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
>  				      const struct intel_crtc_state *crtc_state)
>  {
> +	struct intel_display *display = to_intel_display(encoder);
>  	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
>  	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> @@ -356,6 +368,12 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
>  		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
>  			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
>  	}
> +
> +	if (IS_DISPLAY_VER(display, 11, 13) && intel_encoder_is_tc(encoder)) {
> +		int delay = dp_phy_lane_stagger_delay(crtc_state->port_clock);
> +
> +		intel_dp->DP |= DDI_BUF_LANE_STAGGER_DELAY(delay);
> +	}
>  }
>  
>  static int icl_calc_tbt_pll_link(struct drm_i915_private *dev_priv,
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 04e47d0a8ab92..7fe4e71fc08ec 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -3632,6 +3632,9 @@ enum skl_power_gate {
>  #define  DDI_BUF_PORT_DATA_20BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 1)
>  #define  DDI_BUF_PORT_DATA_40BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 2)
>  #define  DDI_BUF_PORT_REVERSAL			(1 << 16)
> +#define  DDI_BUF_LANE_STAGGER_DELAY_MASK	REG_GENMASK(15, 8)
> +#define  DDI_BUF_LANE_STAGGER_DELAY(symbols)	REG_FIELD_PREP(DDI_BUF_LANE_STAGGER_DELAY_MASK, \
> +							       symbols)
>  #define  DDI_BUF_IS_IDLE			(1 << 7)
>  #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
>  #define  DDI_A_4_LANES				(1 << 4)

-- 
Jani Nikula, Intel

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

* Re: [PATCH 06/17] drm/i915/ddi: Simplify the port disabling via DDI_BUF_CTL
  2025-01-29 20:02 ` [PATCH 06/17] drm/i915/ddi: Simplify the port disabling " Imre Deak
@ 2025-02-05 12:24   ` Jani Nikula
  0 siblings, 0 replies; 49+ messages in thread
From: Jani Nikula @ 2025-02-05 12:24 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> A port can be disabled only via a modeset (or during HW state
> sanitization) when the port is enabled. Thus it's not required to check
> the port's enabled state before disabling it. In any case if the port
> happened to be disabled, the following disabling would be just a nop and
> waiting for the buffer's idle state should succeed. Simplify the
> disabling sequence accordingly.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 23 +++++------------------
>  1 file changed, 5 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 3138dc4034797..24c56d2aa5f31 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3062,17 +3062,12 @@ static void mtl_disable_ddi_buf(struct intel_encoder *encoder,
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum port port = encoder->port;
> -	u32 val;
>  
>  	/* 3.b Clear DDI_CTL_DE Enable to 0. */
> -	val = intel_de_read(dev_priv, DDI_BUF_CTL(port));
> -	if (val & DDI_BUF_CTL_ENABLE) {
> -		val &= ~DDI_BUF_CTL_ENABLE;
> -		intel_de_write(dev_priv, DDI_BUF_CTL(port), val);
> +	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
>  
> -		/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
> -		mtl_wait_ddi_buf_idle(dev_priv, port);
> -	}
> +	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
> +	mtl_wait_ddi_buf_idle(dev_priv, port);
>  
>  	/* 3.d Disable D2D Link */
>  	mtl_ddi_disable_d2d_link(encoder);
> @@ -3089,15 +3084,8 @@ static void disable_ddi_buf(struct intel_encoder *encoder,
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum port port = encoder->port;
> -	bool wait = false;
> -	u32 val;
>  
> -	val = intel_de_read(dev_priv, DDI_BUF_CTL(port));
> -	if (val & DDI_BUF_CTL_ENABLE) {
> -		val &= ~DDI_BUF_CTL_ENABLE;
> -		intel_de_write(dev_priv, DDI_BUF_CTL(port), val);
> -		wait = true;
> -	}
> +	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
>  
>  	if (intel_crtc_has_dp_encoder(crtc_state))
>  		intel_de_rmw(dev_priv, dp_tp_ctl_reg(encoder, crtc_state),
> @@ -3105,8 +3093,7 @@ static void disable_ddi_buf(struct intel_encoder *encoder,
>  
>  	intel_ddi_disable_fec(encoder, crtc_state);
>  
> -	if (wait)
> -		intel_wait_ddi_buf_idle(dev_priv, port);
> +	intel_wait_ddi_buf_idle(dev_priv, port);
>  }
>  
>  static void intel_disable_ddi_buf(struct intel_encoder *encoder,

-- 
Jani Nikula, Intel

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

* Re: [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle via DDI_BUF_CTL
  2025-01-29 20:02 ` [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle " Imre Deak
@ 2025-02-05 12:35   ` Jani Nikula
  2025-02-05 12:47     ` Imre Deak
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-02-05 12:35 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> When waiting for a port to idle, there is no point in distinguishing the
> platform specific timeouts, instead of just using the maximum timeout.

Why?

All of this sounds kind of reasonable, but we'll need a better rationale
than "there is no point".

> Simplify things accordingly, describing the Bspec platform specific
> timeouts in code comments.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 78 +++++++++++-------------
>  1 file changed, 36 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 24c56d2aa5f31..d040558b5d029 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -177,69 +177,63 @@ static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder,
>  		       trans->entries[level].hsw.trans2);
>  }
>  
> -static void mtl_wait_ddi_buf_idle(struct drm_i915_private *i915, enum port port)
> +static i915_reg_t intel_ddi_buf_status_reg(struct intel_display *display, enum port port)
>  {
> -	int ret;
> +	struct drm_i915_private *i915 = to_i915(display->drm);

Please don't add new i915 uses, display will work just fine here.

>  
> -	/* FIXME: find out why Bspec's 100us timeout is too short */
> -	ret = wait_for_us((intel_de_read(i915, XELPDP_PORT_BUF_CTL1(i915, port)) &
> -			   XELPDP_PORT_BUF_PHY_IDLE), 10000);
> -	if (ret)
> -		drm_err(&i915->drm, "Timeout waiting for DDI BUF %c to get idle\n",
> -			port_name(port));
> +	if (DISPLAY_VER(display) >= 14)
> +		return XELPDP_PORT_BUF_CTL1(i915, port);
> +	else
> +		return DDI_BUF_CTL(port);
>  }
>  
>  void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
>  			     enum port port)
>  {
> -	if (IS_BROXTON(dev_priv)) {
> +	struct intel_display *display = &dev_priv->display;
> +
> +	/*
> +	 * Bspec's platform specific timeouts:
> +	 * MTL+   : 100 us
> +	 * BXT    : fixed 16 us
> +	 * HSW-ADL: 8 us
> +	 *
> +	 * FIXME: MTL requires 10 ms based on tests, find out why 100 us is too short
> +	 */

Seems a bit odd to me to list all the platform specific timeouts, and
then largely ignore them without explanation!

Also, 10 ms is several orders of magnitude longer than it should need to
be on all platforms.

> +	if (display->platform.broxton) {
>  		udelay(16);
>  		return;
>  	}
>  
> -	if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
> -			 DDI_BUF_IS_IDLE), 8))
> -		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get idle\n",
> +	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
> +	if (intel_de_wait_for_set(display, intel_ddi_buf_status_reg(display, port),
> +				  DDI_BUF_IS_IDLE, 10))
> +		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get idle\n",
>  			port_name(port));
>  }
>  
>  static void intel_wait_ddi_buf_active(struct intel_encoder *encoder)
>  {
> -	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> +	struct intel_display *display = to_intel_display(encoder);
>  	enum port port = encoder->port;
> -	int timeout_us;
> -	int ret;
>  
> -	/* Wait > 518 usecs for DDI_BUF_CTL to be non idle */
> -	if (DISPLAY_VER(dev_priv) < 10) {
> +	/*
> +	 * Bspec's platform specific timeouts:
> +	 * MTL+             : 10000 us
> +	 * DG2              : 1200 us
> +	 * TGL-ADL combo PHY: 1000 us
> +	 * TGL-ADL TypeC PHY: 3000 us
> +	 * HSW-ICL          : fixed 518 us
> +	 */
> +	if (DISPLAY_VER(display) < 10) {
>  		usleep_range(518, 1000);
>  		return;
>  	}
>  
> -	if (DISPLAY_VER(dev_priv) >= 14) {
> -		timeout_us = 10000;
> -	} else if (IS_DG2(dev_priv)) {
> -		timeout_us = 1200;
> -	} else if (DISPLAY_VER(dev_priv) >= 12) {
> -		if (intel_encoder_is_tc(encoder))
> -			timeout_us = 3000;
> -		else
> -			timeout_us = 1000;
> -	} else {
> -		timeout_us = 500;
> -	}
> -
> -	if (DISPLAY_VER(dev_priv) >= 14)
> -		ret = _wait_for(!(intel_de_read(dev_priv,
> -						XELPDP_PORT_BUF_CTL1(dev_priv, port)) &
> -				  XELPDP_PORT_BUF_PHY_IDLE),
> -				timeout_us, 10, 10);
> -	else
> -		ret = _wait_for(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & DDI_BUF_IS_IDLE),
> -				timeout_us, 10, 10);
> -
> -	if (ret)
> -		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get active\n",
> +	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
> +	if (intel_de_wait_for_clear(display, intel_ddi_buf_status_reg(display, port),
> +				    DDI_BUF_IS_IDLE, 10))
> +		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get active\n",
>  			port_name(port));
>  }
>  
> @@ -3067,7 +3061,7 @@ static void mtl_disable_ddi_buf(struct intel_encoder *encoder,
>  	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
>  
>  	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */

Comment is now stale. (Which is why we should never add comments like
that.)

> -	mtl_wait_ddi_buf_idle(dev_priv, port);
> +	intel_wait_ddi_buf_idle(dev_priv, port);
>  
>  	/* 3.d Disable D2D Link */
>  	mtl_ddi_disable_d2d_link(encoder);

-- 
Jani Nikula, Intel

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

* Re: [PATCH 08/17] drm/i915/ddi: Move platform checks within mtl_ddi_enable/disable_d2d_link()
  2025-01-29 20:02 ` [PATCH 08/17] drm/i915/ddi: Move platform checks within mtl_ddi_enable/disable_d2d_link() Imre Deak
@ 2025-02-05 12:42   ` Jani Nikula
  2025-02-05 13:46     ` Imre Deak
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-02-05 12:42 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> The prefix of the mtl_ddi_enable_d2d() / mtl_ddi_disable_d2d_link()
> names show already what are the relevant platforms, so the corresponding
> platform check is a detail that can be hidden in the functions, do so.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

But unrelated bafflement below.

> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index d040558b5d029..07188606a0177 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -2545,6 +2545,9 @@ mtl_ddi_enable_d2d(struct intel_encoder *encoder)
>  	i915_reg_t reg;
>  	u32 set_bits, wait_bits;
>  
> +	if (DISPLAY_VER(dev_priv) < 14)
> +		return;
> +
>  	if (DISPLAY_VER(dev_priv) >= 20) {
>  		reg = DDI_BUF_CTL(port);

Unrelated to this patch, this seems weird. DDI_BUF_CTL for display
version 20+? While XELPDP_PORT_BUF_CTL1() also has a check for >= 20.

>  		set_bits = XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> @@ -3035,6 +3038,9 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
>  	i915_reg_t reg;
>  	u32 clr_bits, wait_bits;
>  
> +	if (DISPLAY_VER(dev_priv) < 14)
> +		return;
> +
>  	if (DISPLAY_VER(dev_priv) >= 20) {
>  		reg = DDI_BUF_CTL(port);
>  		clr_bits = XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> @@ -3411,8 +3417,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
>  		hsw_prepare_hdmi_ddi_buffers(encoder, crtc_state);
>  
>  	/* e. Enable D2D Link for C10/C20 Phy */
> -	if (DISPLAY_VER(dev_priv) >= 14)
> -		mtl_ddi_enable_d2d(encoder);
> +	mtl_ddi_enable_d2d(encoder);

Why do we have mtl_ddi_enable_d2d() and mtl_ddi_disable_d2d_link(). It
just boggles my mind that the names mismatch.


>  
>  	encoder->set_signal_levels(encoder, crtc_state);

-- 
Jani Nikula, Intel

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

* Re: [PATCH 09/17] drm/i915/ddi: Unify the platform specific functions disabling a port
  2025-01-29 20:02 ` [PATCH 09/17] drm/i915/ddi: Unify the platform specific functions disabling a port Imre Deak
@ 2025-02-05 12:45   ` Jani Nikula
  0 siblings, 0 replies; 49+ messages in thread
From: Jani Nikula @ 2025-02-05 12:45 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> The functions disabling a port for MTL+ and earlier platforms only
> differ by an extra step on MTL+ (to disable the D2D link) and the point
> at which the port's idle state is waited for. Combine the two functions
> accounting for the above differences, removing the duplication.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 43 ++++--------------------
>  1 file changed, 7 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 07188606a0177..73702ccbb3773 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3057,58 +3057,29 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
>  			port_name(port));
>  }
>  
> -static void mtl_disable_ddi_buf(struct intel_encoder *encoder,
> -				const struct intel_crtc_state *crtc_state)
> +static void intel_disable_ddi_buf(struct intel_encoder *encoder,
> +				  const struct intel_crtc_state *crtc_state)
>  {
> +	struct intel_display *display = to_intel_display(encoder);
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum port port = encoder->port;
>  
> -	/* 3.b Clear DDI_CTL_DE Enable to 0. */
>  	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
>  
> -	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
> -	intel_wait_ddi_buf_idle(dev_priv, port);
> +	if (DISPLAY_VER(display) >= 14)
> +		intel_wait_ddi_buf_idle(dev_priv, port);
>  
> -	/* 3.d Disable D2D Link */
>  	mtl_ddi_disable_d2d_link(encoder);
>  
> -	/* 3.e Disable DP_TP_CTL */
>  	if (intel_crtc_has_dp_encoder(crtc_state)) {
>  		intel_de_rmw(dev_priv, dp_tp_ctl_reg(encoder, crtc_state),
>  			     DP_TP_CTL_ENABLE, 0);
>  	}
> -}
> -
> -static void disable_ddi_buf(struct intel_encoder *encoder,
> -			    const struct intel_crtc_state *crtc_state)
> -{
> -	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	enum port port = encoder->port;
> -
> -	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
> -
> -	if (intel_crtc_has_dp_encoder(crtc_state))
> -		intel_de_rmw(dev_priv, dp_tp_ctl_reg(encoder, crtc_state),
> -			     DP_TP_CTL_ENABLE, 0);
>  
>  	intel_ddi_disable_fec(encoder, crtc_state);
>  
> -	intel_wait_ddi_buf_idle(dev_priv, port);
> -}
> -
> -static void intel_disable_ddi_buf(struct intel_encoder *encoder,
> -				  const struct intel_crtc_state *crtc_state)
> -{
> -	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -
> -	if (DISPLAY_VER(dev_priv) >= 14) {
> -		mtl_disable_ddi_buf(encoder, crtc_state);
> -
> -		/* 3.f Disable DP_TP_CTL FEC Enable if it is needed */
> -		intel_ddi_disable_fec(encoder, crtc_state);
> -	} else {
> -		disable_ddi_buf(encoder, crtc_state);
> -	}
> +	if (DISPLAY_VER(display) < 14)
> +		intel_wait_ddi_buf_idle(dev_priv, port);
>  
>  	intel_ddi_wait_for_fec_status(encoder, crtc_state, false);
>  }

-- 
Jani Nikula, Intel

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

* Re: [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle via DDI_BUF_CTL
  2025-02-05 12:35   ` Jani Nikula
@ 2025-02-05 12:47     ` Imre Deak
  2025-02-05 13:02       ` Jani Nikula
  0 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-02-05 12:47 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, intel-xe

On Wed, Feb 05, 2025 at 02:35:18PM +0200, Jani Nikula wrote:
> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > When waiting for a port to idle, there is no point in distinguishing the
> > platform specific timeouts, instead of just using the maximum timeout.
> 
> Why?
> 
> All of this sounds kind of reasonable, but we'll need a better rationale
> than "there is no point".

The rational is that there is no point in the complexity of specifying
an exact timeout and for that the suitable wait API. The sequence in
particular is not performance critical at all either and due to
scheduling it's not guaranteed anyhow how long the wait will last at the
given timescale. In the usual case where the wait succeeds the actual
time waited does not change with the increased timeout.

> > Simplify things accordingly, describing the Bspec platform specific
> > timeouts in code comments.
> >
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c | 78 +++++++++++-------------
> >  1 file changed, 36 insertions(+), 42 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index 24c56d2aa5f31..d040558b5d029 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -177,69 +177,63 @@ static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder,
> >  		       trans->entries[level].hsw.trans2);
> >  }
> >  
> > -static void mtl_wait_ddi_buf_idle(struct drm_i915_private *i915, enum port port)
> > +static i915_reg_t intel_ddi_buf_status_reg(struct intel_display *display, enum port port)
> >  {
> > -	int ret;
> > +	struct drm_i915_private *i915 = to_i915(display->drm);
> 
> Please don't add new i915 uses, display will work just fine here.
> 
> >  
> > -	/* FIXME: find out why Bspec's 100us timeout is too short */
> > -	ret = wait_for_us((intel_de_read(i915, XELPDP_PORT_BUF_CTL1(i915, port)) &
> > -			   XELPDP_PORT_BUF_PHY_IDLE), 10000);
> > -	if (ret)
> > -		drm_err(&i915->drm, "Timeout waiting for DDI BUF %c to get idle\n",
> > -			port_name(port));
> > +	if (DISPLAY_VER(display) >= 14)
> > +		return XELPDP_PORT_BUF_CTL1(i915, port);
> > +	else
> > +		return DDI_BUF_CTL(port);
> >  }
> >  
> >  void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
> >  			     enum port port)
> >  {
> > -	if (IS_BROXTON(dev_priv)) {
> > +	struct intel_display *display = &dev_priv->display;
> > +
> > +	/*
> > +	 * Bspec's platform specific timeouts:
> > +	 * MTL+   : 100 us
> > +	 * BXT    : fixed 16 us
> > +	 * HSW-ADL: 8 us
> > +	 *
> > +	 * FIXME: MTL requires 10 ms based on tests, find out why 100 us is too short
> > +	 */
> 
> Seems a bit odd to me to list all the platform specific timeouts, and
> then largely ignore them without explanation!

It's documented so after any future platform requirement changes
(dropping support for a platform, adding a new platform with a new
timeout) can be applied to the timeout used below.

> Also, 10 ms is several orders of magnitude longer than it should need to
> be on all platforms.

I described above why this doesn't matter (in the usual case the wait
duration will not change).

> 
> > +	if (display->platform.broxton) {
> >  		udelay(16);
> >  		return;
> >  	}
> >  
> > -	if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
> > -			 DDI_BUF_IS_IDLE), 8))
> > -		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get idle\n",
> > +	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
> > +	if (intel_de_wait_for_set(display, intel_ddi_buf_status_reg(display, port),
> > +				  DDI_BUF_IS_IDLE, 10))
> > +		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get idle\n",
> >  			port_name(port));
> >  }
> >  
> >  static void intel_wait_ddi_buf_active(struct intel_encoder *encoder)
> >  {
> > -	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > +	struct intel_display *display = to_intel_display(encoder);
> >  	enum port port = encoder->port;
> > -	int timeout_us;
> > -	int ret;
> >  
> > -	/* Wait > 518 usecs for DDI_BUF_CTL to be non idle */
> > -	if (DISPLAY_VER(dev_priv) < 10) {
> > +	/*
> > +	 * Bspec's platform specific timeouts:
> > +	 * MTL+             : 10000 us
> > +	 * DG2              : 1200 us
> > +	 * TGL-ADL combo PHY: 1000 us
> > +	 * TGL-ADL TypeC PHY: 3000 us
> > +	 * HSW-ICL          : fixed 518 us
> > +	 */
> > +	if (DISPLAY_VER(display) < 10) {
> >  		usleep_range(518, 1000);
> >  		return;
> >  	}
> >  
> > -	if (DISPLAY_VER(dev_priv) >= 14) {
> > -		timeout_us = 10000;
> > -	} else if (IS_DG2(dev_priv)) {
> > -		timeout_us = 1200;
> > -	} else if (DISPLAY_VER(dev_priv) >= 12) {
> > -		if (intel_encoder_is_tc(encoder))
> > -			timeout_us = 3000;
> > -		else
> > -			timeout_us = 1000;
> > -	} else {
> > -		timeout_us = 500;
> > -	}
> > -
> > -	if (DISPLAY_VER(dev_priv) >= 14)
> > -		ret = _wait_for(!(intel_de_read(dev_priv,
> > -						XELPDP_PORT_BUF_CTL1(dev_priv, port)) &
> > -				  XELPDP_PORT_BUF_PHY_IDLE),
> > -				timeout_us, 10, 10);
> > -	else
> > -		ret = _wait_for(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & DDI_BUF_IS_IDLE),
> > -				timeout_us, 10, 10);
> > -
> > -	if (ret)
> > -		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get active\n",
> > +	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
> > +	if (intel_de_wait_for_clear(display, intel_ddi_buf_status_reg(display, port),
> > +				    DDI_BUF_IS_IDLE, 10))
> > +		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get active\n",
> >  			port_name(port));
> >  }
> >  
> > @@ -3067,7 +3061,7 @@ static void mtl_disable_ddi_buf(struct intel_encoder *encoder,
> >  	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
> >  
> >  	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
> 
> Comment is now stale. (Which is why we should never add comments like
> that.)

Right, I remove all these later in the patchset.

> 
> > -	mtl_wait_ddi_buf_idle(dev_priv, port);
> > +	intel_wait_ddi_buf_idle(dev_priv, port);
> >  
> >  	/* 3.d Disable D2D Link */
> >  	mtl_ddi_disable_d2d_link(encoder);
> 
> -- 
> Jani Nikula, Intel

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

* Re: [PATCH 10/17] drm/i915/ddi: Add a helper to enable a port
  2025-01-29 20:02 ` [PATCH 10/17] drm/i915/ddi: Add a helper to enable " Imre Deak
@ 2025-02-05 12:49   ` Jani Nikula
  2025-02-05 14:43     ` Imre Deak
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-02-05 12:49 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> Add a helper to enable a port instead of open-coding it.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 34 +++++++++++-------------
>  1 file changed, 16 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 73702ccbb3773..ddb182550ad0f 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3057,6 +3057,17 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
>  			port_name(port));
>  }
>  
> +static void intel_enable_ddi_buf(struct intel_encoder *encoder, u32 buf_ctl)

This is in line with current code, but I'd use intel_ddi_buf_enable()
instead.

> +{
> +	struct intel_display *display = to_intel_display(encoder);
> +	enum port port = encoder->port;
> +
> +	intel_de_write(display, DDI_BUF_CTL(port), buf_ctl | DDI_BUF_CTL_ENABLE);
> +	intel_de_posting_read(display, DDI_BUF_CTL(port));
> +
> +	intel_wait_ddi_buf_active(encoder);
> +}
> +
>  static void intel_disable_ddi_buf(struct intel_encoder *encoder,
>  				  const struct intel_crtc_state *crtc_state)
>  {
> @@ -3375,7 +3386,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
>  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
>  	struct drm_connector *connector = conn_state->connector;
>  	enum port port = encoder->port;
> -	u32 buf_ctl;
> +	u32 buf_ctl = 0;
>  
>  	if (!intel_hdmi_handle_sink_scrambling(encoder, connector,
>  					       crtc_state->hdmi_high_tmds_clock_ratio,
> @@ -3440,8 +3451,6 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
>  	 * is filled with lane count, already set in the crtc_state.
>  	 * The same is required to be filled in PORT_BUF_CTL for C10/20 Phy.
>  	 */
> -	buf_ctl = DDI_BUF_CTL_ENABLE;
> -
>  	if (dig_port->lane_reversal)
>  		buf_ctl |= DDI_BUF_PORT_REVERSAL;
>  	if (dig_port->ddi_a_4_lanes)
> @@ -3467,9 +3476,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
>  		buf_ctl |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
>  	}
>  
> -	intel_de_write(dev_priv, DDI_BUF_CTL(port), buf_ctl);
> -
> -	intel_wait_ddi_buf_active(encoder);
> +	intel_enable_ddi_buf(encoder, buf_ctl);
>  }
>  
>  static void intel_ddi_enable(struct intel_atomic_state *state,
> @@ -3692,7 +3699,6 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
>  	struct intel_display *display = to_intel_display(crtc_state);
>  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
>  	struct intel_encoder *encoder = &dig_port->base;
> -	enum port port = encoder->port;
>  	u32 dp_tp_ctl;
>  
>  	/*
> @@ -3726,15 +3732,11 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
>  	mtl_port_buf_ctl_program(encoder, crtc_state);
>  
>  	/* 6.i Configure and enable DDI_CTL_DE to start sending valid data to port slice */
> -	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
>  	if (DISPLAY_VER(display) >= 20)
>  		intel_dp->DP |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
>  
> -	intel_de_write(display, DDI_BUF_CTL(port), intel_dp->DP);
> -	intel_de_posting_read(display, DDI_BUF_CTL(port));
> -
> -	/* 6.j Poll for PORT_BUF_CTL Idle Status == 0, timeout after 100 us */
> -	intel_wait_ddi_buf_active(encoder);
> +	intel_enable_ddi_buf(encoder, intel_dp->DP);
> +	intel_dp->DP |= DDI_BUF_CTL_ENABLE;

I hate this last line, but that's another story.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>  }
>  
>  static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> @@ -3743,7 +3745,6 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
>  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
>  	struct intel_encoder *encoder = &dig_port->base;
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	enum port port = encoder->port;
>  	u32 dp_tp_ctl;
>  
>  	dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
> @@ -3766,11 +3767,8 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
>  	    (intel_tc_port_in_dp_alt_mode(dig_port) || intel_tc_port_in_legacy_mode(dig_port)))
>  		adlp_tbt_to_dp_alt_switch_wa(encoder);
>  
> +	intel_enable_ddi_buf(encoder, intel_dp->DP);
>  	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
> -	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
> -	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
> -
> -	intel_wait_ddi_buf_active(encoder);
>  }
>  
>  static void intel_ddi_set_link_train(struct intel_dp *intel_dp,

-- 
Jani Nikula, Intel

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

* Re: [PATCH 11/17] drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions
  2025-01-29 20:02 ` [PATCH 11/17] drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions Imre Deak
@ 2025-02-05 12:52   ` Jani Nikula
  2025-02-05 14:52     ` Imre Deak
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-02-05 12:52 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe; +Cc: Imre Deak

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> From: Imre Deak <imre.deak@gmail.com>
>
> Align the DDI_BUF_CTL register flag definitions with how this is done
> elsewhere.
>
> Signed-off-by: Imre Deak <imre.deak@gmail.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 7fe4e71fc08ec..5cee6a96270af 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -3621,27 +3621,29 @@ enum skl_power_gate {
>  #define _DDI_BUF_CTL_B				0x64100
>  /* Known as DDI_CTL_DE in MTL+ */
>  #define DDI_BUF_CTL(port) _MMIO_PORT(port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B)
> -#define  DDI_BUF_CTL_ENABLE			(1 << 31)
> +#define  DDI_BUF_CTL_ENABLE			REG_BIT(31)
>  #define  XE2LPD_DDI_BUF_D2D_LINK_ENABLE		REG_BIT(29)
>  #define  XE2LPD_DDI_BUF_D2D_LINK_STATE		REG_BIT(28)
> -#define  DDI_BUF_TRANS_SELECT(n)	((n) << 24)
> -#define  DDI_BUF_EMP_MASK			(0xf << 24)
> -#define  DDI_BUF_PHY_LINK_RATE(r)		((r) << 20)
> +#define  DDI_BUF_EMP_MASK			REG_GENMASK(27, 24)
> +#define  DDI_BUF_TRANS_SELECT(n)		REG_FIELD_PREP(DDI_BUF_EMP_MASK, n)
> +#define  DDI_BUF_PHY_LINK_RATE_MASK		REG_GENMASK(23, 20)
> +#define  DDI_BUF_PHY_LINK_RATE(r)		REG_FIELD_PREP(DDI_BUF_PHY_LINK_RATE_MASK, r)

Ville has been advocating wrapping macro arguments in parens also in
these cases, and I'm starting to lean that way too.

Other than that,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>  #define  DDI_BUF_PORT_DATA_MASK			REG_GENMASK(19, 18)
>  #define  DDI_BUF_PORT_DATA_10BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 0)
>  #define  DDI_BUF_PORT_DATA_20BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 1)
>  #define  DDI_BUF_PORT_DATA_40BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 2)
> -#define  DDI_BUF_PORT_REVERSAL			(1 << 16)
> +#define  DDI_BUF_PORT_REVERSAL			REG_BIT(16)
>  #define  DDI_BUF_LANE_STAGGER_DELAY_MASK	REG_GENMASK(15, 8)
>  #define  DDI_BUF_LANE_STAGGER_DELAY(symbols)	REG_FIELD_PREP(DDI_BUF_LANE_STAGGER_DELAY_MASK, \
>  							       symbols)
> -#define  DDI_BUF_IS_IDLE			(1 << 7)
> +#define  DDI_BUF_IS_IDLE			REG_BIT(7)
>  #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
> -#define  DDI_A_4_LANES				(1 << 4)
> -#define  DDI_PORT_WIDTH(width)			(((width) == 3 ? 4 : ((width) - 1)) << 1)
> -#define  DDI_PORT_WIDTH_MASK			(7 << 1)
> +#define  DDI_A_4_LANES				REG_BIT(4)
> +#define  DDI_PORT_WIDTH_MASK			REG_GENMASK(3, 1)
> +#define  DDI_PORT_WIDTH(width)			REG_FIELD_PREP(DDI_PORT_WIDTH_MASK, \
> +							       (width) == 3 ? 4 : (width) - 1)
>  #define  DDI_PORT_WIDTH_SHIFT			1
> -#define  DDI_INIT_DISPLAY_DETECTED		(1 << 0)
> +#define  DDI_INIT_DISPLAY_DETECTED		REG_BIT(0)
>  
>  /* DDI Buffer Translations */
>  #define _DDI_BUF_TRANS_A		0x64E00

-- 
Jani Nikula, Intel

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

* Re: [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle via DDI_BUF_CTL
  2025-02-05 12:47     ` Imre Deak
@ 2025-02-05 13:02       ` Jani Nikula
  2025-02-12 11:48         ` Kahola, Mika
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-02-05 13:02 UTC (permalink / raw)
  To: imre.deak; +Cc: intel-gfx, intel-xe

On Wed, 05 Feb 2025, Imre Deak <imre.deak@intel.com> wrote:
> On Wed, Feb 05, 2025 at 02:35:18PM +0200, Jani Nikula wrote:
>> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
>> > When waiting for a port to idle, there is no point in distinguishing the
>> > platform specific timeouts, instead of just using the maximum timeout.
>> 
>> Why?
>> 
>> All of this sounds kind of reasonable, but we'll need a better rationale
>> than "there is no point".
>
> The rational is that there is no point in the complexity of specifying
> an exact timeout and for that the suitable wait API. The sequence in
> particular is not performance critical at all either and due to
> scheduling it's not guaranteed anyhow how long the wait will last at the
> given timescale. In the usual case where the wait succeeds the actual
> time waited does not change with the increased timeout.

Fair. Just needs to be in the commit message. ;)

BR,
Jani.

>
>> > Simplify things accordingly, describing the Bspec platform specific
>> > timeouts in code comments.
>> >
>> > Signed-off-by: Imre Deak <imre.deak@intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/display/intel_ddi.c | 78 +++++++++++-------------
>> >  1 file changed, 36 insertions(+), 42 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
>> > index 24c56d2aa5f31..d040558b5d029 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
>> > @@ -177,69 +177,63 @@ static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder,
>> >  		       trans->entries[level].hsw.trans2);
>> >  }
>> >  
>> > -static void mtl_wait_ddi_buf_idle(struct drm_i915_private *i915, enum port port)
>> > +static i915_reg_t intel_ddi_buf_status_reg(struct intel_display *display, enum port port)
>> >  {
>> > -	int ret;
>> > +	struct drm_i915_private *i915 = to_i915(display->drm);
>> 
>> Please don't add new i915 uses, display will work just fine here.
>> 
>> >  
>> > -	/* FIXME: find out why Bspec's 100us timeout is too short */
>> > -	ret = wait_for_us((intel_de_read(i915, XELPDP_PORT_BUF_CTL1(i915, port)) &
>> > -			   XELPDP_PORT_BUF_PHY_IDLE), 10000);
>> > -	if (ret)
>> > -		drm_err(&i915->drm, "Timeout waiting for DDI BUF %c to get idle\n",
>> > -			port_name(port));
>> > +	if (DISPLAY_VER(display) >= 14)
>> > +		return XELPDP_PORT_BUF_CTL1(i915, port);
>> > +	else
>> > +		return DDI_BUF_CTL(port);
>> >  }
>> >  
>> >  void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
>> >  			     enum port port)
>> >  {
>> > -	if (IS_BROXTON(dev_priv)) {
>> > +	struct intel_display *display = &dev_priv->display;
>> > +
>> > +	/*
>> > +	 * Bspec's platform specific timeouts:
>> > +	 * MTL+   : 100 us
>> > +	 * BXT    : fixed 16 us
>> > +	 * HSW-ADL: 8 us
>> > +	 *
>> > +	 * FIXME: MTL requires 10 ms based on tests, find out why 100 us is too short
>> > +	 */
>> 
>> Seems a bit odd to me to list all the platform specific timeouts, and
>> then largely ignore them without explanation!
>
> It's documented so after any future platform requirement changes
> (dropping support for a platform, adding a new platform with a new
> timeout) can be applied to the timeout used below.
>
>> Also, 10 ms is several orders of magnitude longer than it should need to
>> be on all platforms.
>
> I described above why this doesn't matter (in the usual case the wait
> duration will not change).
>
>> 
>> > +	if (display->platform.broxton) {
>> >  		udelay(16);
>> >  		return;
>> >  	}
>> >  
>> > -	if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
>> > -			 DDI_BUF_IS_IDLE), 8))
>> > -		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get idle\n",
>> > +	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
>> > +	if (intel_de_wait_for_set(display, intel_ddi_buf_status_reg(display, port),
>> > +				  DDI_BUF_IS_IDLE, 10))
>> > +		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get idle\n",
>> >  			port_name(port));
>> >  }
>> >  
>> >  static void intel_wait_ddi_buf_active(struct intel_encoder *encoder)
>> >  {
>> > -	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>> > +	struct intel_display *display = to_intel_display(encoder);
>> >  	enum port port = encoder->port;
>> > -	int timeout_us;
>> > -	int ret;
>> >  
>> > -	/* Wait > 518 usecs for DDI_BUF_CTL to be non idle */
>> > -	if (DISPLAY_VER(dev_priv) < 10) {
>> > +	/*
>> > +	 * Bspec's platform specific timeouts:
>> > +	 * MTL+             : 10000 us
>> > +	 * DG2              : 1200 us
>> > +	 * TGL-ADL combo PHY: 1000 us
>> > +	 * TGL-ADL TypeC PHY: 3000 us
>> > +	 * HSW-ICL          : fixed 518 us
>> > +	 */
>> > +	if (DISPLAY_VER(display) < 10) {
>> >  		usleep_range(518, 1000);
>> >  		return;
>> >  	}
>> >  
>> > -	if (DISPLAY_VER(dev_priv) >= 14) {
>> > -		timeout_us = 10000;
>> > -	} else if (IS_DG2(dev_priv)) {
>> > -		timeout_us = 1200;
>> > -	} else if (DISPLAY_VER(dev_priv) >= 12) {
>> > -		if (intel_encoder_is_tc(encoder))
>> > -			timeout_us = 3000;
>> > -		else
>> > -			timeout_us = 1000;
>> > -	} else {
>> > -		timeout_us = 500;
>> > -	}
>> > -
>> > -	if (DISPLAY_VER(dev_priv) >= 14)
>> > -		ret = _wait_for(!(intel_de_read(dev_priv,
>> > -						XELPDP_PORT_BUF_CTL1(dev_priv, port)) &
>> > -				  XELPDP_PORT_BUF_PHY_IDLE),
>> > -				timeout_us, 10, 10);
>> > -	else
>> > -		ret = _wait_for(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & DDI_BUF_IS_IDLE),
>> > -				timeout_us, 10, 10);
>> > -
>> > -	if (ret)
>> > -		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get active\n",
>> > +	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
>> > +	if (intel_de_wait_for_clear(display, intel_ddi_buf_status_reg(display, port),
>> > +				    DDI_BUF_IS_IDLE, 10))
>> > +		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get active\n",
>> >  			port_name(port));
>> >  }
>> >  
>> > @@ -3067,7 +3061,7 @@ static void mtl_disable_ddi_buf(struct intel_encoder *encoder,
>> >  	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
>> >  
>> >  	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after 100us */
>> 
>> Comment is now stale. (Which is why we should never add comments like
>> that.)
>
> Right, I remove all these later in the patchset.
>
>> 
>> > -	mtl_wait_ddi_buf_idle(dev_priv, port);
>> > +	intel_wait_ddi_buf_idle(dev_priv, port);
>> >  
>> >  	/* 3.d Disable D2D Link */
>> >  	mtl_ddi_disable_d2d_link(encoder);
>> 
>> -- 
>> Jani Nikula, Intel

-- 
Jani Nikula, Intel

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

* Re: [PATCH 04/17] drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL
  2025-02-05 12:22   ` Jani Nikula
@ 2025-02-05 13:20     ` Imre Deak
  0 siblings, 0 replies; 49+ messages in thread
From: Imre Deak @ 2025-02-05 13:20 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, intel-xe, Imre Deak

On Wed, Feb 05, 2025 at 02:22:56PM +0200, Jani Nikula wrote:
> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > From: Imre Deak <imre.deak@gmail.com>
> >
> > Add the missing PHY lane stagger delay programming for ICL-ADL
> > platforms on TypeC DP outputs.
> >
> > Bspec: 7534, 49533
> > Signed-off-by: Imre Deak <imre.deak@gmail.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c | 18 ++++++++++++++++++
> >  drivers/gpu/drm/i915/i915_reg.h          |  3 +++
> >  2 files changed, 21 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index 76e8296cb134b..6192c0d3c87a5 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -328,9 +328,21 @@ static u32 ddi_buf_phy_link_rate(int port_clock)
> >  	}
> >  }
> >  
> > +static int dp_phy_lane_stagger_delay(int port_clock)
> > +{
> > +	/*
> > +	 * Return the number of link symbols per 100 ns:
> > +	 * port_clock (10 kHz) -> bits    / 100 us
> > +	 * / symbol_size       -> symbols / 100 us
> > +	 * / 1000              -> symbols / 100 ns
> > +	 */
> > +	return DIV_ROUND_UP(port_clock, intel_dp_link_symbol_size(port_clock) * 1000);
> 
> Okay, this checks out, but it was incredibly difficult (for me) to
> follow, even with the comment. The meaning of 100 ns is also not
> documented i.e. we want a lane stagger delay of 100 ns or greater, and
> we must express this in terms of symbols in the register.

I could clarify the above one-line code comment based on the bspec
description as (i.e. replace "Return the number of link symbols per 100
ns" with):

"""
Return the number of symbol clocks delay used to stagger the
assertion/desassertion of the port lane enables. The target delay time
is 100 ns or greater, return the number of symbols specific to
the provided port_clock (aka link clock) corresponding to this delay
time, i.e. so that

   number_of_symbols * duration_of_one_symbol >= 100 ns

The delay must be applied only on TypeC DP outputs, for everything else
the delay must be set to 0.
"""

followed by the above unit conversion hints.

> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> > +}
> > +
> >  static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
> >  				      const struct intel_crtc_state *crtc_state)
> >  {
> > +	struct intel_display *display = to_intel_display(encoder);
> >  	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> >  	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> >  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> > @@ -356,6 +368,12 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
> >  		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
> >  			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
> >  	}
> > +
> > +	if (IS_DISPLAY_VER(display, 11, 13) && intel_encoder_is_tc(encoder)) {
> > +		int delay = dp_phy_lane_stagger_delay(crtc_state->port_clock);
> > +
> > +		intel_dp->DP |= DDI_BUF_LANE_STAGGER_DELAY(delay);
> > +	}
> >  }
> >  
> >  static int icl_calc_tbt_pll_link(struct drm_i915_private *dev_priv,
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index 04e47d0a8ab92..7fe4e71fc08ec 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -3632,6 +3632,9 @@ enum skl_power_gate {
> >  #define  DDI_BUF_PORT_DATA_20BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 1)
> >  #define  DDI_BUF_PORT_DATA_40BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 2)
> >  #define  DDI_BUF_PORT_REVERSAL			(1 << 16)
> > +#define  DDI_BUF_LANE_STAGGER_DELAY_MASK	REG_GENMASK(15, 8)
> > +#define  DDI_BUF_LANE_STAGGER_DELAY(symbols)	REG_FIELD_PREP(DDI_BUF_LANE_STAGGER_DELAY_MASK, \
> > +							       symbols)
> >  #define  DDI_BUF_IS_IDLE			(1 << 7)
> >  #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
> >  #define  DDI_A_4_LANES				(1 << 4)
> 
> -- 
> Jani Nikula, Intel

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

* Re: [PATCH 08/17] drm/i915/ddi: Move platform checks within mtl_ddi_enable/disable_d2d_link()
  2025-02-05 12:42   ` Jani Nikula
@ 2025-02-05 13:46     ` Imre Deak
  0 siblings, 0 replies; 49+ messages in thread
From: Imre Deak @ 2025-02-05 13:46 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, intel-xe

On Wed, Feb 05, 2025 at 02:42:12PM +0200, Jani Nikula wrote:
> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > The prefix of the mtl_ddi_enable_d2d() / mtl_ddi_disable_d2d_link()
> > names show already what are the relevant platforms, so the corresponding
> > platform check is a detail that can be hidden in the functions, do so.
> >
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> But unrelated bafflement below.
> 
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index d040558b5d029..07188606a0177 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -2545,6 +2545,9 @@ mtl_ddi_enable_d2d(struct intel_encoder *encoder)
> >  	i915_reg_t reg;
> >  	u32 set_bits, wait_bits;
> >  
> > +	if (DISPLAY_VER(dev_priv) < 14)
> > +		return;
> > +
> >  	if (DISPLAY_VER(dev_priv) >= 20) {
> >  		reg = DDI_BUF_CTL(port);
> 
> Unrelated to this patch, this seems weird. DDI_BUF_CTL for display
> version 20+? 

Yes, some DDI buffer control/status flags got shuffled around across
different platforms. The D2D enabling flag was originally added on MTL
in the new XELPDP_PORT_BUF_CTL1 register, then on LNL this same D2D
enabling flag was moved (back) to the old DDI_BUF_CTL register. A
similar shuffling happened with the DDI buffer (PHY) enabled _status_
flag (vs. the DDI buffer enabled _control_ flag, which was not
shuffled).

> While XELPDP_PORT_BUF_CTL1() also has a check for >= 20.

Yes, flags other than the D2D enable control/status are in
XELPDP_PORT_BUF_CTL1 reg for LNL+. So both MTL and LNL+ uses this
register, but the mapping of the register for port A/B changed on LNL+.

> 
> >  		set_bits = XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> > @@ -3035,6 +3038,9 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
> >  	i915_reg_t reg;
> >  	u32 clr_bits, wait_bits;
> >  
> > +	if (DISPLAY_VER(dev_priv) < 14)
> > +		return;
> > +
> >  	if (DISPLAY_VER(dev_priv) >= 20) {
> >  		reg = DDI_BUF_CTL(port);
> >  		clr_bits = XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> > @@ -3411,8 +3417,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
> >  		hsw_prepare_hdmi_ddi_buffers(encoder, crtc_state);
> >  
> >  	/* e. Enable D2D Link for C10/C20 Phy */
> > -	if (DISPLAY_VER(dev_priv) >= 14)
> > -		mtl_ddi_enable_d2d(encoder);
> > +	mtl_ddi_enable_d2d(encoder);
> 
> Why do we have mtl_ddi_enable_d2d() and mtl_ddi_disable_d2d_link(). It
> just boggles my mind that the names mismatch.

Yes, it's not consistent. I can include the
s/mtl_ddi_disable_d2d_link/mtl_ddi_disable_ddi/
change in this patch.

> >  
> >  	encoder->set_signal_levels(encoder, crtc_state);
> 
> -- 
> Jani Nikula, Intel

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

* Re: [PATCH 10/17] drm/i915/ddi: Add a helper to enable a port
  2025-02-05 12:49   ` Jani Nikula
@ 2025-02-05 14:43     ` Imre Deak
  0 siblings, 0 replies; 49+ messages in thread
From: Imre Deak @ 2025-02-05 14:43 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, intel-xe

On Wed, Feb 05, 2025 at 02:49:49PM +0200, Jani Nikula wrote:
> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > Add a helper to enable a port instead of open-coding it.
> >
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c | 34 +++++++++++-------------
> >  1 file changed, 16 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index 73702ccbb3773..ddb182550ad0f 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -3057,6 +3057,17 @@ mtl_ddi_disable_d2d_link(struct intel_encoder *encoder)
> >  			port_name(port));
> >  }
> >  
> > +static void intel_enable_ddi_buf(struct intel_encoder *encoder, u32 buf_ctl)
> 
> This is in line with current code, but I'd use intel_ddi_buf_enable()
> instead.

Okay, can rename this and accordingly in this patch rename
intel_disable_ddi_buf() to intel_ddi_buf_disable().

> > +{
> > +	struct intel_display *display = to_intel_display(encoder);
> > +	enum port port = encoder->port;
> > +
> > +	intel_de_write(display, DDI_BUF_CTL(port), buf_ctl | DDI_BUF_CTL_ENABLE);
> > +	intel_de_posting_read(display, DDI_BUF_CTL(port));
> > +
> > +	intel_wait_ddi_buf_active(encoder);
> > +}
> > +
> >  static void intel_disable_ddi_buf(struct intel_encoder *encoder,
> >  				  const struct intel_crtc_state *crtc_state)
> >  {
> > @@ -3375,7 +3386,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
> >  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> >  	struct drm_connector *connector = conn_state->connector;
> >  	enum port port = encoder->port;
> > -	u32 buf_ctl;
> > +	u32 buf_ctl = 0;
> >  
> >  	if (!intel_hdmi_handle_sink_scrambling(encoder, connector,
> >  					       crtc_state->hdmi_high_tmds_clock_ratio,
> > @@ -3440,8 +3451,6 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
> >  	 * is filled with lane count, already set in the crtc_state.
> >  	 * The same is required to be filled in PORT_BUF_CTL for C10/20 Phy.
> >  	 */
> > -	buf_ctl = DDI_BUF_CTL_ENABLE;
> > -
> >  	if (dig_port->lane_reversal)
> >  		buf_ctl |= DDI_BUF_PORT_REVERSAL;
> >  	if (dig_port->ddi_a_4_lanes)
> > @@ -3467,9 +3476,7 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
> >  		buf_ctl |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
> >  	}
> >  
> > -	intel_de_write(dev_priv, DDI_BUF_CTL(port), buf_ctl);
> > -
> > -	intel_wait_ddi_buf_active(encoder);
> > +	intel_enable_ddi_buf(encoder, buf_ctl);
> >  }
> >  
> >  static void intel_ddi_enable(struct intel_atomic_state *state,
> > @@ -3692,7 +3699,6 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> >  	struct intel_display *display = to_intel_display(crtc_state);
> >  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> >  	struct intel_encoder *encoder = &dig_port->base;
> > -	enum port port = encoder->port;
> >  	u32 dp_tp_ctl;
> >  
> >  	/*
> > @@ -3726,15 +3732,11 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> >  	mtl_port_buf_ctl_program(encoder, crtc_state);
> >  
> >  	/* 6.i Configure and enable DDI_CTL_DE to start sending valid data to port slice */
> > -	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
> >  	if (DISPLAY_VER(display) >= 20)
> >  		intel_dp->DP |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> >  
> > -	intel_de_write(display, DDI_BUF_CTL(port), intel_dp->DP);
> > -	intel_de_posting_read(display, DDI_BUF_CTL(port));
> > -
> > -	/* 6.j Poll for PORT_BUF_CTL Idle Status == 0, timeout after 100 us */
> > -	intel_wait_ddi_buf_active(encoder);
> > +	intel_enable_ddi_buf(encoder, intel_dp->DP);
> > +	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
> 
> I hate this last line, but that's another story.

Not sure why intel_dp->DP was added at all originally, I think the
register should be updated with RMW everywhere instead (removing
intel_dp->DP), I have a change in that direction in patch 12.

> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> 
> >  }
> >  
> >  static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> > @@ -3743,7 +3745,6 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> >  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> >  	struct intel_encoder *encoder = &dig_port->base;
> >  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > -	enum port port = encoder->port;
> >  	u32 dp_tp_ctl;
> >  
> >  	dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
> > @@ -3766,11 +3767,8 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> >  	    (intel_tc_port_in_dp_alt_mode(dig_port) || intel_tc_port_in_legacy_mode(dig_port)))
> >  		adlp_tbt_to_dp_alt_switch_wa(encoder);
> >  
> > +	intel_enable_ddi_buf(encoder, intel_dp->DP);
> >  	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
> > -	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
> > -	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
> > -
> > -	intel_wait_ddi_buf_active(encoder);
> >  }
> >  
> >  static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
> 
> -- 
> Jani Nikula, Intel

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

* Re: [PATCH 11/17] drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions
  2025-02-05 12:52   ` Jani Nikula
@ 2025-02-05 14:52     ` Imre Deak
  0 siblings, 0 replies; 49+ messages in thread
From: Imre Deak @ 2025-02-05 14:52 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, intel-xe, Imre Deak

On Wed, Feb 05, 2025 at 02:52:08PM +0200, Jani Nikula wrote:
> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > From: Imre Deak <imre.deak@gmail.com>
> >
> > Align the DDI_BUF_CTL register flag definitions with how this is done
> > elsewhere.
> >
> > Signed-off-by: Imre Deak <imre.deak@gmail.com>
> > ---
> >  drivers/gpu/drm/i915/i915_reg.h | 22 ++++++++++++----------
> >  1 file changed, 12 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index 7fe4e71fc08ec..5cee6a96270af 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -3621,27 +3621,29 @@ enum skl_power_gate {
> >  #define _DDI_BUF_CTL_B				0x64100
> >  /* Known as DDI_CTL_DE in MTL+ */
> >  #define DDI_BUF_CTL(port) _MMIO_PORT(port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B)
> > -#define  DDI_BUF_CTL_ENABLE			(1 << 31)
> > +#define  DDI_BUF_CTL_ENABLE			REG_BIT(31)
> >  #define  XE2LPD_DDI_BUF_D2D_LINK_ENABLE		REG_BIT(29)
> >  #define  XE2LPD_DDI_BUF_D2D_LINK_STATE		REG_BIT(28)
> > -#define  DDI_BUF_TRANS_SELECT(n)	((n) << 24)
> > -#define  DDI_BUF_EMP_MASK			(0xf << 24)
> > -#define  DDI_BUF_PHY_LINK_RATE(r)		((r) << 20)
> > +#define  DDI_BUF_EMP_MASK			REG_GENMASK(27, 24)
> > +#define  DDI_BUF_TRANS_SELECT(n)		REG_FIELD_PREP(DDI_BUF_EMP_MASK, n)
> > +#define  DDI_BUF_PHY_LINK_RATE_MASK		REG_GENMASK(23, 20)
> > +#define  DDI_BUF_PHY_LINK_RATE(r)		REG_FIELD_PREP(DDI_BUF_PHY_LINK_RATE_MASK, r)
> 
> Ville has been advocating wrapping macro arguments in parens also in
> these cases, and I'm starting to lean that way too.

That is parens around 'r' above, ok I suppose that's more robust (in
case the called macros don't use parens when required). 

> Other than that,
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> 
> >  #define  DDI_BUF_PORT_DATA_MASK			REG_GENMASK(19, 18)
> >  #define  DDI_BUF_PORT_DATA_10BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 0)
> >  #define  DDI_BUF_PORT_DATA_20BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 1)
> >  #define  DDI_BUF_PORT_DATA_40BIT		REG_FIELD_PREP(DDI_BUF_PORT_DATA_MASK, 2)
> > -#define  DDI_BUF_PORT_REVERSAL			(1 << 16)
> > +#define  DDI_BUF_PORT_REVERSAL			REG_BIT(16)
> >  #define  DDI_BUF_LANE_STAGGER_DELAY_MASK	REG_GENMASK(15, 8)
> >  #define  DDI_BUF_LANE_STAGGER_DELAY(symbols)	REG_FIELD_PREP(DDI_BUF_LANE_STAGGER_DELAY_MASK, \
> >  							       symbols)
> > -#define  DDI_BUF_IS_IDLE			(1 << 7)
> > +#define  DDI_BUF_IS_IDLE			REG_BIT(7)
> >  #define  DDI_BUF_CTL_TC_PHY_OWNERSHIP		REG_BIT(6)
> > -#define  DDI_A_4_LANES				(1 << 4)
> > -#define  DDI_PORT_WIDTH(width)			(((width) == 3 ? 4 : ((width) - 1)) << 1)
> > -#define  DDI_PORT_WIDTH_MASK			(7 << 1)
> > +#define  DDI_A_4_LANES				REG_BIT(4)
> > +#define  DDI_PORT_WIDTH_MASK			REG_GENMASK(3, 1)
> > +#define  DDI_PORT_WIDTH(width)			REG_FIELD_PREP(DDI_PORT_WIDTH_MASK, \
> > +							       (width) == 3 ? 4 : (width) - 1)
> >  #define  DDI_PORT_WIDTH_SHIFT			1
> > -#define  DDI_INIT_DISPLAY_DETECTED		(1 << 0)
> > +#define  DDI_INIT_DISPLAY_DETECTED		REG_BIT(0)
> >  
> >  /* DDI Buffer Translations */
> >  #define _DDI_BUF_TRANS_A		0x64E00
> 
> -- 
> Jani Nikula, Intel

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

* Re: [PATCH 13/17] drm/i915/ddi: Factor out a helper to get DDI_BUF_CTL's config value
  2025-01-29 20:02 ` [PATCH 13/17] drm/i915/ddi: Factor out a helper to get DDI_BUF_CTL's config value Imre Deak
@ 2025-02-10 18:06   ` Jani Nikula
  0 siblings, 0 replies; 49+ messages in thread
From: Jani Nikula @ 2025-02-10 18:06 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> Factor out a function to get the configuration fields in the DDI_BUF_CTL
> register. This can be used for configuring an HDMI output as well.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 32 ++++++++++++++++--------
>  1 file changed, 21 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 64c42505f2ad6..dd8ae5cf96c70 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -333,45 +333,55 @@ static int dp_phy_lane_stagger_delay(int port_clock)
>  	return DIV_ROUND_UP(port_clock, intel_dp_link_symbol_size(port_clock) * 1000);
>  }
>  
> -static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
> -				      const struct intel_crtc_state *crtc_state)
> +static u32 intel_ddi_buf_ctl_config_val(struct intel_encoder *encoder,
> +					const struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_display *display = to_intel_display(encoder);
>  	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> -	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> +	u32 val = 0;
>  
>  	/* DDI_BUF_CTL_ENABLE will be set by intel_ddi_prepare_link_retrain() later */
> -	intel_dp->DP = DDI_PORT_WIDTH(crtc_state->lane_count) |
> +	val |= DDI_PORT_WIDTH(crtc_state->lane_count) |
>  		DDI_BUF_TRANS_SELECT(0);
>  
>  	if (dig_port->lane_reversal)
> -		intel_dp->DP |= DDI_BUF_PORT_REVERSAL;
> +		val |= DDI_BUF_PORT_REVERSAL;
>  	if (dig_port->ddi_a_4_lanes)
> -		intel_dp->DP |= DDI_A_4_LANES;
> +		val |= DDI_A_4_LANES;
>  
>  	if (DISPLAY_VER(i915) >= 14) {
>  		if (intel_dp_is_uhbr(crtc_state))
> -			intel_dp->DP |= DDI_BUF_PORT_DATA_40BIT;
> +			val |= DDI_BUF_PORT_DATA_40BIT;
>  		else
> -			intel_dp->DP |= DDI_BUF_PORT_DATA_10BIT;
> +			val |= DDI_BUF_PORT_DATA_10BIT;
>  	}
>  
>  	if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
> -		intel_dp->DP |= ddi_buf_phy_link_rate(crtc_state->port_clock);
> +		val |= ddi_buf_phy_link_rate(crtc_state->port_clock);
>  		/*
>  		 * TODO: remove the following once DDI_BUF_CTL is updated via
>  		 * an RMW everywhere.
>  		 */
>  		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
> -			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
> +			val |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
>  	}
>  
>  	if (IS_DISPLAY_VER(display, 11, 13) && intel_encoder_is_tc(encoder)) {
>  		int delay = dp_phy_lane_stagger_delay(crtc_state->port_clock);
>  
> -		intel_dp->DP |= DDI_BUF_LANE_STAGGER_DELAY(delay);
> +		val |= DDI_BUF_LANE_STAGGER_DELAY(delay);
>  	}
> +
> +	return val;
> +}
> +
> +static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
> +				      const struct intel_crtc_state *crtc_state)
> +{
> +	struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> +
> +	intel_dp->DP = intel_ddi_buf_ctl_config_val(encoder, crtc_state);
>  }
>  
>  static u32 intel_ddi_buf_ctl_config_mask(struct intel_encoder *encoder)

-- 
Jani Nikula, Intel

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

* Re: [PATCH 12/17] drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write
  2025-01-29 20:02 ` [PATCH 12/17] drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write Imre Deak
@ 2025-02-10 18:13   ` Jani Nikula
  2025-02-10 18:25     ` Imre Deak
  0 siblings, 1 reply; 49+ messages in thread
From: Jani Nikula @ 2025-02-10 18:13 UTC (permalink / raw)
  To: Imre Deak, intel-gfx, intel-xe; +Cc: Imre Deak

On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> From: Imre Deak <imre.deak@gmail.com>
>
> The various flags in DDI_BUF_CTL must be programmed at different places
> during a modeset. The expected value of the register at any moment is
> cached in the intel_dp::DP variable and the whole register is written
> using this variable. A simpler way would be not maintaining the cached
> value of the register at all and update only specific fields in the
> register via read-modify-write. Some places - like D2D link enabling or
> the port disabling - use RMW already.
>
> Based on the above update the register via RMW during the port
> configuration / enabling as well. After all the places updating
> DDI_BUF_CTL are changed - probably the voltage-swing/pre-emphasis level
> setting is the only one remaining - tracking the register value in
> intel_dp:DP could be removed.
>
> Signed-off-by: Imre Deak <imre.deak@gmail.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index ddb182550ad0f..64c42505f2ad6 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -359,6 +359,10 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
>  
>  	if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
>  		intel_dp->DP |= ddi_buf_phy_link_rate(crtc_state->port_clock);
> +		/*
> +		 * TODO: remove the following once DDI_BUF_CTL is updated via
> +		 * an RMW everywhere.
> +		 */
>  		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
>  			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
>  	}
> @@ -370,6 +374,22 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
>  	}
>  }
>  
> +static u32 intel_ddi_buf_ctl_config_mask(struct intel_encoder *encoder)
> +{
> +	struct intel_display *display = to_intel_display(encoder);
> +	u32 mask = DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES |
> +		   DDI_PORT_WIDTH_MASK;

The caller only sets DDI_PORT_WIDTH() for display >= 14.

> +
> +	if (DISPLAY_VER(display) >= 14)
> +		mask |= DDI_BUF_PORT_DATA_MASK;

But doesn't touch this?

> +	if (display->platform.alderlake_p)
> +		mask |= DDI_BUF_PHY_LINK_RATE_MASK;

DDI_BUF_CTL_TC_PHY_OWNERSHIP?

> +	if (IS_DISPLAY_VER(display, 11, 13))
> +		mask |= DDI_BUF_LANE_STAGGER_DELAY_MASK;
> +
> +	return mask;
> +}

I don't know, this patch is incredibly hard to follow.

BR,
Jani.


> +
>  static int icl_calc_tbt_pll_link(struct drm_i915_private *dev_priv,
>  				 enum port port)
>  {
> @@ -3062,7 +3082,8 @@ static void intel_enable_ddi_buf(struct intel_encoder *encoder, u32 buf_ctl)
>  	struct intel_display *display = to_intel_display(encoder);
>  	enum port port = encoder->port;
>  
> -	intel_de_write(display, DDI_BUF_CTL(port), buf_ctl | DDI_BUF_CTL_ENABLE);
> +	intel_de_rmw(display, DDI_BUF_CTL(port),
> +		     intel_ddi_buf_ctl_config_mask(encoder), buf_ctl | DDI_BUF_CTL_ENABLE);
>  	intel_de_posting_read(display, DDI_BUF_CTL(port));
>  
>  	intel_wait_ddi_buf_active(encoder);

-- 
Jani Nikula, Intel

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

* Re: [PATCH 12/17] drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write
  2025-02-10 18:13   ` Jani Nikula
@ 2025-02-10 18:25     ` Imre Deak
  2025-02-12 11:51       ` Kahola, Mika
  0 siblings, 1 reply; 49+ messages in thread
From: Imre Deak @ 2025-02-10 18:25 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, intel-xe, Imre Deak

On Mon, Feb 10, 2025 at 08:13:14PM +0200, Jani Nikula wrote:
> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > From: Imre Deak <imre.deak@gmail.com>
> >
> > The various flags in DDI_BUF_CTL must be programmed at different places
> > during a modeset. The expected value of the register at any moment is
> > cached in the intel_dp::DP variable and the whole register is written
> > using this variable. A simpler way would be not maintaining the cached
> > value of the register at all and update only specific fields in the
> > register via read-modify-write. Some places - like D2D link enabling or
> > the port disabling - use RMW already.
> >
> > Based on the above update the register via RMW during the port
> > configuration / enabling as well. After all the places updating
> > DDI_BUF_CTL are changed - probably the voltage-swing/pre-emphasis level
> > setting is the only one remaining - tracking the register value in
> > intel_dp:DP could be removed.
> >
> > Signed-off-by: Imre Deak <imre.deak@gmail.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c | 23 ++++++++++++++++++++++-
> >  1 file changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index ddb182550ad0f..64c42505f2ad6 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -359,6 +359,10 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
> >  
> >  	if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
> >  		intel_dp->DP |= ddi_buf_phy_link_rate(crtc_state->port_clock);
> > +		/*
> > +		 * TODO: remove the following once DDI_BUF_CTL is updated via
> > +		 * an RMW everywhere.
> > +		 */
> >  		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
> >  			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
> >  	}
> > @@ -370,6 +374,22 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
> >  	}
> >  }
> >  
> > +static u32 intel_ddi_buf_ctl_config_mask(struct intel_encoder *encoder)
> > +{
> > +	struct intel_display *display = to_intel_display(encoder);
> > +	u32 mask = DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES |
> > +		   DDI_PORT_WIDTH_MASK;
> 
> The caller only sets DDI_PORT_WIDTH() for display >= 14.

It does get set everywhere. For HDMI on display < 14 it's set to 0
(ignored by the HW), on display >= 14 it's set to the actual port width.

> > +
> > +	if (DISPLAY_VER(display) >= 14)
> > +		mask |= DDI_BUF_PORT_DATA_MASK;
> 
> But doesn't touch this?

It's always set on display >= 14.

> 
> > +	if (display->platform.alderlake_p)
> > +		mask |= DDI_BUF_PHY_LINK_RATE_MASK;
> 
> DDI_BUF_CTL_TC_PHY_OWNERSHIP?

This shouldn't be changed during configuring and enabling the port.

> > +	if (IS_DISPLAY_VER(display, 11, 13))
> > +		mask |= DDI_BUF_LANE_STAGGER_DELAY_MASK;
> > +
> > +	return mask;
> > +}
> 
> I don't know, this patch is incredibly hard to follow.
> 
> BR,
> Jani.
> 
> 
> > +
> >  static int icl_calc_tbt_pll_link(struct drm_i915_private *dev_priv,
> >  				 enum port port)
> >  {
> > @@ -3062,7 +3082,8 @@ static void intel_enable_ddi_buf(struct intel_encoder *encoder, u32 buf_ctl)
> >  	struct intel_display *display = to_intel_display(encoder);
> >  	enum port port = encoder->port;
> >  
> > -	intel_de_write(display, DDI_BUF_CTL(port), buf_ctl | DDI_BUF_CTL_ENABLE);
> > +	intel_de_rmw(display, DDI_BUF_CTL(port),
> > +		     intel_ddi_buf_ctl_config_mask(encoder), buf_ctl | DDI_BUF_CTL_ENABLE);
> >  	intel_de_posting_read(display, DDI_BUF_CTL(port));
> >  
> >  	intel_wait_ddi_buf_active(encoder);
> 
> -- 
> Jani Nikula, Intel

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

* RE: [PATCH 14/17] drm/i915/ddi: Reuse helper to compute the HDMI DDI_BUF_CTL config
  2025-01-29 20:02 ` [PATCH 14/17] drm/i915/ddi: Reuse helper to compute the HDMI DDI_BUF_CTL config Imre Deak
@ 2025-02-11 14:06   ` Kahola, Mika
  0 siblings, 0 replies; 49+ messages in thread
From: Kahola, Mika @ 2025-02-11 14:06 UTC (permalink / raw)
  To: Deak, Imre, intel-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org

> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Imre
> Deak
> Sent: Wednesday, 29 January 2025 22.02
> To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Subject: [PATCH 14/17] drm/i915/ddi: Reuse helper to compute the HDMI
> DDI_BUF_CTL config
> 
> Reuse the existing helper to compute the configuration value of the DDI_BUF_CTL
> register for HDMI outputs instead of open-coding this.
> 
> Note that dropping the XE2LPD_DDI_BUF_D2D_LINK_ENABLE flag is ok, since an
> earlier mtl_ddi_enable_d2d() has set it already and intel_enable_ddi_buf()'s
> RMW will not update this flag.
> 

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 30 ++++++++----------------
>  1 file changed, 10 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> b/drivers/gpu/drm/i915/display/intel_ddi.c
> index dd8ae5cf96c70..e03ec9a235d33 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -339,11 +339,14 @@ static u32 intel_ddi_buf_ctl_config_val(struct
> intel_encoder *encoder,
>  	struct intel_display *display = to_intel_display(encoder);
>  	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
>  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> +	bool is_dp = intel_crtc_has_dp_encoder(crtc_state);
>  	u32 val = 0;
> 
>  	/* DDI_BUF_CTL_ENABLE will be set by intel_ddi_prepare_link_retrain()
> later */
> -	val |= DDI_PORT_WIDTH(crtc_state->lane_count) |
> -		DDI_BUF_TRANS_SELECT(0);
> +	if (is_dp || DISPLAY_VER(display) >= 14)
> +		val |= DDI_PORT_WIDTH(crtc_state->lane_count);
> +
> +	val |= DDI_BUF_TRANS_SELECT(0);
> 
>  	if (dig_port->lane_reversal)
>  		val |= DDI_BUF_PORT_REVERSAL;
> @@ -351,14 +354,15 @@ static u32 intel_ddi_buf_ctl_config_val(struct
> intel_encoder *encoder,
>  		val |= DDI_A_4_LANES;
> 
>  	if (DISPLAY_VER(i915) >= 14) {
> -		if (intel_dp_is_uhbr(crtc_state))
> +		if (is_dp && intel_dp_is_uhbr(crtc_state))
>  			val |= DDI_BUF_PORT_DATA_40BIT;
>  		else
>  			val |= DDI_BUF_PORT_DATA_10BIT;
>  	}
> 
>  	if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
> -		val |= ddi_buf_phy_link_rate(crtc_state->port_clock);
> +		if (is_dp)
> +			val |= ddi_buf_phy_link_rate(crtc_state->port_clock);
>  		/*
>  		 * TODO: remove the following once DDI_BUF_CTL is updated
> via
>  		 * an RMW everywhere.
> @@ -367,7 +371,7 @@ static u32 intel_ddi_buf_ctl_config_val(struct
> intel_encoder *encoder,
>  			val |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
>  	}
> 
> -	if (IS_DISPLAY_VER(display, 11, 13) && intel_encoder_is_tc(encoder)) {
> +	if (is_dp && IS_DISPLAY_VER(display, 11, 13) &&
> +intel_encoder_is_tc(encoder)) {
>  		int delay = dp_phy_lane_stagger_delay(crtc_state->port_clock);
> 
>  		val |= DDI_BUF_LANE_STAGGER_DELAY(delay);
> @@ -3417,7 +3421,6 @@ static void intel_ddi_enable_hdmi(struct
> intel_atomic_state *state,
>  	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
>  	struct drm_connector *connector = conn_state->connector;
>  	enum port port = encoder->port;
> -	u32 buf_ctl = 0;
> 
>  	if (!intel_hdmi_handle_sink_scrambling(encoder, connector,
>  					       crtc_state-
> >hdmi_high_tmds_clock_ratio,
> @@ -3482,11 +3485,6 @@ static void intel_ddi_enable_hdmi(struct
> intel_atomic_state *state,
>  	 * is filled with lane count, already set in the crtc_state.
>  	 * The same is required to be filled in PORT_BUF_CTL for C10/20 Phy.
>  	 */
> -	if (dig_port->lane_reversal)
> -		buf_ctl |= DDI_BUF_PORT_REVERSAL;
> -	if (dig_port->ddi_a_4_lanes)
> -		buf_ctl |= DDI_A_4_LANES;
> -
>  	if (DISPLAY_VER(dev_priv) >= 14) {
>  		u32 port_buf = 0;
> 
> @@ -3497,17 +3495,9 @@ static void intel_ddi_enable_hdmi(struct
> intel_atomic_state *state,
> 
>  		intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(dev_priv,
> port),
>  			     XELPDP_PORT_WIDTH_MASK |
> XELPDP_PORT_REVERSAL, port_buf);
> -
> -		buf_ctl |= DDI_PORT_WIDTH(crtc_state->lane_count);
> -
> -		if (DISPLAY_VER(dev_priv) >= 20)
> -			buf_ctl |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> -	} else if (IS_ALDERLAKE_P(dev_priv) && intel_encoder_is_tc(encoder)) {
> -		drm_WARN_ON(&dev_priv->drm,
> !intel_tc_port_in_legacy_mode(dig_port));
> -		buf_ctl |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
>  	}
> 
> -	intel_enable_ddi_buf(encoder, buf_ctl);
> +	intel_enable_ddi_buf(encoder, intel_ddi_buf_ctl_config_val(encoder,
> +crtc_state));
>  }
> 
>  static void intel_ddi_enable(struct intel_atomic_state *state,
> --
> 2.44.2


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

* RE: [PATCH 15/17] drm/i915/ddi: Reuse helper to compute the HDMI PORT_BUF_CTL1 config
  2025-01-29 20:02 ` [PATCH 15/17] drm/i915/ddi: Reuse helper to compute the HDMI PORT_BUF_CTL1 config Imre Deak
@ 2025-02-12  9:51   ` Kahola, Mika
  0 siblings, 0 replies; 49+ messages in thread
From: Kahola, Mika @ 2025-02-12  9:51 UTC (permalink / raw)
  To: Deak, Imre, intel-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org

> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Imre Deak
> Sent: Wednesday, 29 January 2025 22.02
> To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Subject: [PATCH 15/17] drm/i915/ddi: Reuse helper to compute the HDMI
> PORT_BUF_CTL1 config
> 
> Reuse the existing helper to compute the configuration value of the
> XELPDP_PORT_BUF_CTL1 register for HDMI outputs instead of open-coding this.
> 

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> b/drivers/gpu/drm/i915/display/intel_ddi.c
> index e03ec9a235d33..431db1e6b6f07 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -2607,9 +2607,12 @@ static void mtl_port_buf_ctl_program(struct
> intel_encoder *encoder,
>  	enum port port = encoder->port;
>  	u32 val = 0;
> 
> +	if (DISPLAY_VER(display) < 14)
> +		return;
> +
>  	val |= XELPDP_PORT_WIDTH(crtc_state->lane_count);
> 
> -	if (intel_dp_is_uhbr(crtc_state))
> +	if (intel_crtc_has_dp_encoder(crtc_state) &&
> +intel_dp_is_uhbr(crtc_state))
>  		val |= XELPDP_PORT_BUF_PORT_DATA_40BIT;
>  	else
>  		val |= XELPDP_PORT_BUF_PORT_DATA_10BIT; @@ -2618,7
> +2621,8 @@ static void mtl_port_buf_ctl_program(struct intel_encoder
> *encoder,
>  		val |= XELPDP_PORT_REVERSAL;
> 
>  	intel_de_rmw(display, XELPDP_PORT_BUF_CTL1(display, port),
> -		     XELPDP_PORT_WIDTH_MASK |
> XELPDP_PORT_BUF_PORT_DATA_WIDTH_MASK,
> +		     XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_REVERSAL |
> +		     XELPDP_PORT_BUF_PORT_DATA_WIDTH_MASK,
>  		     val);
>  }
> 
> @@ -3418,7 +3422,6 @@ static void intel_ddi_enable_hdmi(struct
> intel_atomic_state *state,  {
>  	struct intel_display *display = to_intel_display(encoder);
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
>  	struct drm_connector *connector = conn_state->connector;
>  	enum port port = encoder->port;
> 
> @@ -3485,17 +3488,7 @@ static void intel_ddi_enable_hdmi(struct
> intel_atomic_state *state,
>  	 * is filled with lane count, already set in the crtc_state.
>  	 * The same is required to be filled in PORT_BUF_CTL for C10/20 Phy.
>  	 */
> -	if (DISPLAY_VER(dev_priv) >= 14) {
> -		u32 port_buf = 0;
> -
> -		port_buf |= XELPDP_PORT_WIDTH(crtc_state->lane_count);
> -
> -		if (dig_port->lane_reversal)
> -			port_buf |= XELPDP_PORT_REVERSAL;
> -
> -		intel_de_rmw(dev_priv, XELPDP_PORT_BUF_CTL1(dev_priv,
> port),
> -			     XELPDP_PORT_WIDTH_MASK |
> XELPDP_PORT_REVERSAL, port_buf);
> -	}
> +	mtl_port_buf_ctl_program(encoder, crtc_state);
> 
>  	intel_enable_ddi_buf(encoder, intel_ddi_buf_ctl_config_val(encoder,
> crtc_state));  }
> --
> 2.44.2


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

* RE: [PATCH 16/17] drm/i915/ddi: Move platform/encoder checks within adlp_tbt_to_dp_alt_switch_wa()
  2025-01-29 20:02 ` [PATCH 16/17] drm/i915/ddi: Move platform/encoder checks within adlp_tbt_to_dp_alt_switch_wa() Imre Deak
@ 2025-02-12 11:06   ` Kahola, Mika
  0 siblings, 0 replies; 49+ messages in thread
From: Kahola, Mika @ 2025-02-12 11:06 UTC (permalink / raw)
  To: Deak, Imre, intel-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org
  Cc: Imre Deak

> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Imre Deak
> Sent: Wednesday, 29 January 2025 22.02
> To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Cc: Imre Deak <imre.deak@gmail.com>
> Subject: [PATCH 16/17] drm/i915/ddi: Move platform/encoder checks within
> adlp_tbt_to_dp_alt_switch_wa()
> 
> From: Imre Deak <imre.deak@gmail.com>
> 
> The prefix of adlp_tbt_to_dp_alt_switch_wa() function name shows already what
> is the relevant platform and encoder type/mode, so the corresponding checks are
> a detail that can be hidden in the function, do so.
> 

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Imre Deak <imre.deak@gmail.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 431db1e6b6f07..a2d82a4c4aa77 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3699,10 +3699,16 @@ intel_ddi_pre_pll_enable(struct intel_atomic_state
> *state,
> 
>  static void adlp_tbt_to_dp_alt_switch_wa(struct intel_encoder *encoder)  {
> +	struct intel_display *display = to_intel_display(encoder);
>  	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> +	struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
>  	enum tc_port tc_port = intel_encoder_to_tc(encoder);
>  	int ln;
> 
> +	if (!display->platform.alderlake_p ||
> +	    (!intel_tc_port_in_dp_alt_mode(dig_port) &&
> !intel_tc_port_in_legacy_mode(dig_port)))
> +		return;
> +
>  	for (ln = 0; ln < 2; ln++)
>  		intel_dkl_phy_rmw(i915, DKL_PCS_DW5(tc_port, ln),
> DKL_PCS_DW5_CORE_SOFTRESET, 0);  } @@ -3777,9 +3783,7 @@ static void
> intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
>  	intel_de_write(dev_priv, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
>  	intel_de_posting_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
> 
> -	if (IS_ALDERLAKE_P(dev_priv) &&
> -	    (intel_tc_port_in_dp_alt_mode(dig_port) ||
> intel_tc_port_in_legacy_mode(dig_port)))
> -		adlp_tbt_to_dp_alt_switch_wa(encoder);
> +	adlp_tbt_to_dp_alt_switch_wa(encoder);
> 
>  	intel_enable_ddi_buf(encoder, intel_dp->DP);
>  	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
> --
> 2.44.2


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

* RE: [PATCH 17/17] drm/i915/ddi: Unify the platform specific functions enabling a port
  2025-01-29 20:02 ` [PATCH 17/17] drm/i915/ddi: Unify the platform specific functions enabling a port Imre Deak
@ 2025-02-12 11:26   ` Kahola, Mika
  0 siblings, 0 replies; 49+ messages in thread
From: Kahola, Mika @ 2025-02-12 11:26 UTC (permalink / raw)
  To: Deak, Imre, intel-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org

> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Imre Deak
> Sent: Wednesday, 29 January 2025 22.02
> To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Subject: [PATCH 17/17] drm/i915/ddi: Unify the platform specific functions
> enabling a port
> 
> The functions enabling a port (as part of link training) for MTL+ and earlier
> platforms only differ by extra steps on MTL+:
> - enable the D2D link
> - set the link parameters
> - configure the PORT_BUF_CTL1 register
> 
> and an extra step on earlier platforms:
> - apply an ADLP TypeC workaround
> 
> All the extra steps are already/can be skipped on unrelated platforms.
> Combine the two functions accounting for the above differences, removing the
> duplication.
> 

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 52 ++++--------------------
>  1 file changed, 8 insertions(+), 44 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> b/drivers/gpu/drm/i915/display/intel_ddi.c
> index a2d82a4c4aa77..e8bea49a27dbc 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -2721,7 +2721,7 @@ static void mtl_ddi_pre_enable_dp(struct
> intel_atomic_state *state,
>  	 * stream or multi-stream master transcoder" can just be performed
>  	 * unconditionally here.
>  	 *
> -	 * mtl_ddi_prepare_link_retrain() that is called by
> +	 * intel_ddi_prepare_link_retrain() that is called by
>  	 * intel_dp_start_link_train() will execute steps: 6.d, 6.f, 6.g, 6.h,
>  	 * 6.i and 6.j
>  	 *
> @@ -3713,8 +3713,8 @@ static void adlp_tbt_to_dp_alt_switch_wa(struct
> intel_encoder *encoder)
>  		intel_dkl_phy_rmw(i915, DKL_PCS_DW5(tc_port, ln),
> DKL_PCS_DW5_CORE_SOFTRESET, 0);  }
> 
> -static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> -					 const struct intel_crtc_state
> *crtc_state)
> +static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> +					   const struct intel_crtc_state
> *crtc_state)
>  {
>  	struct intel_display *display = to_intel_display(crtc_state);
>  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); @@ -
> 3729,7 +3729,6 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp
> *intel_dp,
> 
>  	drm_WARN_ON(display->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
> 
> -	/* 6.d Configure and enable DP_TP_CTL with link training pattern 1
> selected */
>  	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||
>  	    intel_dp_is_uhbr(crtc_state)) {
> @@ -3742,16 +3741,15 @@ static void mtl_ddi_prepare_link_retrain(struct
> intel_dp *intel_dp,
>  	intel_de_write(display, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
>  	intel_de_posting_read(display, dp_tp_ctl_reg(encoder, crtc_state));
> 
> -	/* 6.f Enable D2D Link */
> +	adlp_tbt_to_dp_alt_switch_wa(encoder);
> +
>  	mtl_ddi_enable_d2d(encoder);
> 
> -	/* 6.g Configure voltage swing and related IO settings */
> -	encoder->set_signal_levels(encoder, crtc_state);
> +	if (DISPLAY_VER(display) >= 14)
> +		encoder->set_signal_levels(encoder, crtc_state);
> 
> -	/* 6.h Configure PORT_BUF_CTL1 */
>  	mtl_port_buf_ctl_program(encoder, crtc_state);
> 
> -	/* 6.i Configure and enable DDI_CTL_DE to start sending valid data to
> port slice */
>  	if (DISPLAY_VER(display) >= 20)
>  		intel_dp->DP |= XE2LPD_DDI_BUF_D2D_LINK_ENABLE;
> 
> @@ -3759,36 +3757,6 @@ static void mtl_ddi_prepare_link_retrain(struct
> intel_dp *intel_dp,
>  	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
>  }
> 
> -static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
> -					   const struct intel_crtc_state
> *crtc_state)
> -{
> -	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> -	struct intel_encoder *encoder = &dig_port->base;
> -	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	u32 dp_tp_ctl;
> -
> -	dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
> -
> -	drm_WARN_ON(&dev_priv->drm, dp_tp_ctl & DP_TP_CTL_ENABLE);
> -
> -	dp_tp_ctl = DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_PAT1;
> -	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) ||
> -	    intel_dp_is_uhbr(crtc_state)) {
> -		dp_tp_ctl |= DP_TP_CTL_MODE_MST;
> -	} else {
> -		dp_tp_ctl |= DP_TP_CTL_MODE_SST;
> -		if (crtc_state->enhanced_framing)
> -			dp_tp_ctl |= DP_TP_CTL_ENHANCED_FRAME_ENABLE;
> -	}
> -	intel_de_write(dev_priv, dp_tp_ctl_reg(encoder, crtc_state), dp_tp_ctl);
> -	intel_de_posting_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
> -
> -	adlp_tbt_to_dp_alt_switch_wa(encoder);
> -
> -	intel_enable_ddi_buf(encoder, intel_dp->DP);
> -	intel_dp->DP |= DDI_BUF_CTL_ENABLE;
> -}
> -
>  static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
>  				     const struct intel_crtc_state *crtc_state,
>  				     u8 dp_train_pat)
> @@ -4612,7 +4580,6 @@ static const struct drm_encoder_funcs intel_ddi_funcs
> = {
> 
>  static int intel_ddi_init_dp_connector(struct intel_digital_port *dig_port)  {
> -	struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
>  	struct intel_connector *connector;
>  	enum port port = dig_port->base.port;
> 
> @@ -4621,10 +4588,7 @@ static int intel_ddi_init_dp_connector(struct
> intel_digital_port *dig_port)
>  		return -ENOMEM;
> 
>  	dig_port->dp.output_reg = DDI_BUF_CTL(port);
> -	if (DISPLAY_VER(i915) >= 14)
> -		dig_port->dp.prepare_link_retrain =
> mtl_ddi_prepare_link_retrain;
> -	else
> -		dig_port->dp.prepare_link_retrain =
> intel_ddi_prepare_link_retrain;
> +	dig_port->dp.prepare_link_retrain = intel_ddi_prepare_link_retrain;
>  	dig_port->dp.set_link_train = intel_ddi_set_link_train;
>  	dig_port->dp.set_idle_link_train = intel_ddi_set_idle_link_train;
> 
> --
> 2.44.2


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

* RE: [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle via DDI_BUF_CTL
  2025-02-05 13:02       ` Jani Nikula
@ 2025-02-12 11:48         ` Kahola, Mika
  0 siblings, 0 replies; 49+ messages in thread
From: Kahola, Mika @ 2025-02-12 11:48 UTC (permalink / raw)
  To: Jani Nikula, Deak, Imre
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org

> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Jani Nikula
> Sent: Wednesday, 5 February 2025 15.02
> To: Deak, Imre <imre.deak@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Subject: Re: [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle via
> DDI_BUF_CTL
> 
> On Wed, 05 Feb 2025, Imre Deak <imre.deak@intel.com> wrote:
> > On Wed, Feb 05, 2025 at 02:35:18PM +0200, Jani Nikula wrote:
> >> On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> >> > When waiting for a port to idle, there is no point in
> >> > distinguishing the platform specific timeouts, instead of just using the
> maximum timeout.
> >>
> >> Why?
> >>
> >> All of this sounds kind of reasonable, but we'll need a better
> >> rationale than "there is no point".
> >
> > The rational is that there is no point in the complexity of specifying
> > an exact timeout and for that the suitable wait API. The sequence in
> > particular is not performance critical at all either and due to
> > scheduling it's not guaranteed anyhow how long the wait will last at
> > the given timescale. In the usual case where the wait succeeds the
> > actual time waited does not change with the increased timeout.
> 
> Fair. Just needs to be in the commit message. ;)
> 
> BR,
> Jani.
> 
> >
> >> > Simplify things accordingly, describing the Bspec platform specific
> >> > timeouts in code comments.
> >> >

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> >> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> >> > ---
> >> >  drivers/gpu/drm/i915/display/intel_ddi.c | 78
> >> > +++++++++++-------------
> >> >  1 file changed, 36 insertions(+), 42 deletions(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> >> > b/drivers/gpu/drm/i915/display/intel_ddi.c
> >> > index 24c56d2aa5f31..d040558b5d029 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> >> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> >> > @@ -177,69 +177,63 @@ static void hsw_prepare_hdmi_ddi_buffers(struct
> intel_encoder *encoder,
> >> >  		       trans->entries[level].hsw.trans2);
> >> >  }
> >> >
> >> > -static void mtl_wait_ddi_buf_idle(struct drm_i915_private *i915,
> >> > enum port port)
> >> > +static i915_reg_t intel_ddi_buf_status_reg(struct intel_display
> >> > +*display, enum port port)
> >> >  {
> >> > -	int ret;
> >> > +	struct drm_i915_private *i915 = to_i915(display->drm);
> >>
> >> Please don't add new i915 uses, display will work just fine here.
> >>
> >> >
> >> > -	/* FIXME: find out why Bspec's 100us timeout is too short */
> >> > -	ret = wait_for_us((intel_de_read(i915, XELPDP_PORT_BUF_CTL1(i915,
> port)) &
> >> > -			   XELPDP_PORT_BUF_PHY_IDLE), 10000);
> >> > -	if (ret)
> >> > -		drm_err(&i915->drm, "Timeout waiting for DDI BUF %c to get
> idle\n",
> >> > -			port_name(port));
> >> > +	if (DISPLAY_VER(display) >= 14)
> >> > +		return XELPDP_PORT_BUF_CTL1(i915, port);
> >> > +	else
> >> > +		return DDI_BUF_CTL(port);
> >> >  }
> >> >
> >> >  void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
> >> >  			     enum port port)
> >> >  {
> >> > -	if (IS_BROXTON(dev_priv)) {
> >> > +	struct intel_display *display = &dev_priv->display;
> >> > +
> >> > +	/*
> >> > +	 * Bspec's platform specific timeouts:
> >> > +	 * MTL+   : 100 us
> >> > +	 * BXT    : fixed 16 us
> >> > +	 * HSW-ADL: 8 us
> >> > +	 *
> >> > +	 * FIXME: MTL requires 10 ms based on tests, find out why 100 us is too
> short
> >> > +	 */
> >>
> >> Seems a bit odd to me to list all the platform specific timeouts, and
> >> then largely ignore them without explanation!
> >
> > It's documented so after any future platform requirement changes
> > (dropping support for a platform, adding a new platform with a new
> > timeout) can be applied to the timeout used below.
> >
> >> Also, 10 ms is several orders of magnitude longer than it should need
> >> to be on all platforms.
> >
> > I described above why this doesn't matter (in the usual case the wait
> > duration will not change).
> >
> >>
> >> > +	if (display->platform.broxton) {
> >> >  		udelay(16);
> >> >  		return;
> >> >  	}
> >> >
> >> > -	if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
> >> > -			 DDI_BUF_IS_IDLE), 8))
> >> > -		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to
> get idle\n",
> >> > +	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
> >> > +	if (intel_de_wait_for_set(display, intel_ddi_buf_status_reg(display, port),
> >> > +				  DDI_BUF_IS_IDLE, 10))
> >> > +		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get
> >> > +idle\n",
> >> >  			port_name(port));
> >> >  }
> >> >
> >> >  static void intel_wait_ddi_buf_active(struct intel_encoder
> >> > *encoder)  {
> >> > -	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> >> > +	struct intel_display *display = to_intel_display(encoder);
> >> >  	enum port port = encoder->port;
> >> > -	int timeout_us;
> >> > -	int ret;
> >> >
> >> > -	/* Wait > 518 usecs for DDI_BUF_CTL to be non idle */
> >> > -	if (DISPLAY_VER(dev_priv) < 10) {
> >> > +	/*
> >> > +	 * Bspec's platform specific timeouts:
> >> > +	 * MTL+             : 10000 us
> >> > +	 * DG2              : 1200 us
> >> > +	 * TGL-ADL combo PHY: 1000 us
> >> > +	 * TGL-ADL TypeC PHY: 3000 us
> >> > +	 * HSW-ICL          : fixed 518 us
> >> > +	 */
> >> > +	if (DISPLAY_VER(display) < 10) {
> >> >  		usleep_range(518, 1000);
> >> >  		return;
> >> >  	}
> >> >
> >> > -	if (DISPLAY_VER(dev_priv) >= 14) {
> >> > -		timeout_us = 10000;
> >> > -	} else if (IS_DG2(dev_priv)) {
> >> > -		timeout_us = 1200;
> >> > -	} else if (DISPLAY_VER(dev_priv) >= 12) {
> >> > -		if (intel_encoder_is_tc(encoder))
> >> > -			timeout_us = 3000;
> >> > -		else
> >> > -			timeout_us = 1000;
> >> > -	} else {
> >> > -		timeout_us = 500;
> >> > -	}
> >> > -
> >> > -	if (DISPLAY_VER(dev_priv) >= 14)
> >> > -		ret = _wait_for(!(intel_de_read(dev_priv,
> >> > -
> 	XELPDP_PORT_BUF_CTL1(dev_priv, port)) &
> >> > -				  XELPDP_PORT_BUF_PHY_IDLE),
> >> > -				timeout_us, 10, 10);
> >> > -	else
> >> > -		ret = _wait_for(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
> DDI_BUF_IS_IDLE),
> >> > -				timeout_us, 10, 10);
> >> > -
> >> > -	if (ret)
> >> > -		drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to
> get active\n",
> >> > +	static_assert(DDI_BUF_IS_IDLE == XELPDP_PORT_BUF_PHY_IDLE);
> >> > +	if (intel_de_wait_for_clear(display, intel_ddi_buf_status_reg(display,
> port),
> >> > +				    DDI_BUF_IS_IDLE, 10))
> >> > +		drm_err(display->drm, "Timeout waiting for DDI BUF %c to get
> >> > +active\n",
> >> >  			port_name(port));
> >> >  }
> >> >
> >> > @@ -3067,7 +3061,7 @@ static void mtl_disable_ddi_buf(struct
> intel_encoder *encoder,
> >> >  	intel_de_rmw(dev_priv, DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE, 0);
> >> >
> >> >  	/* 3.c Poll for PORT_BUF_CTL Idle Status == 1, timeout after
> >> > 100us */
> >>
> >> Comment is now stale. (Which is why we should never add comments like
> >> that.)
> >
> > Right, I remove all these later in the patchset.
> >
> >>
> >> > -	mtl_wait_ddi_buf_idle(dev_priv, port);
> >> > +	intel_wait_ddi_buf_idle(dev_priv, port);
> >> >
> >> >  	/* 3.d Disable D2D Link */
> >> >  	mtl_ddi_disable_d2d_link(encoder);
> >>
> >> --
> >> Jani Nikula, Intel
> 
> --
> Jani Nikula, Intel

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

* RE: [PATCH 12/17] drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write
  2025-02-10 18:25     ` Imre Deak
@ 2025-02-12 11:51       ` Kahola, Mika
  0 siblings, 0 replies; 49+ messages in thread
From: Kahola, Mika @ 2025-02-12 11:51 UTC (permalink / raw)
  To: Deak, Imre, Jani Nikula
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	Imre Deak

> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Imre
> Deak
> Sent: Monday, 10 February 2025 20.25
> To: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org; Imre Deak
> <imre.deak@gmail.com>
> Subject: Re: [PATCH 12/17] drm/i915/ddi: Configure/enable a port in
> DDI_BUF_CTL via read-modify-write
> 
> On Mon, Feb 10, 2025 at 08:13:14PM +0200, Jani Nikula wrote:
> > On Wed, 29 Jan 2025, Imre Deak <imre.deak@intel.com> wrote:
> > > From: Imre Deak <imre.deak@gmail.com>
> > >
> > > The various flags in DDI_BUF_CTL must be programmed at different
> > > places during a modeset. The expected value of the register at any
> > > moment is cached in the intel_dp::DP variable and the whole register
> > > is written using this variable. A simpler way would be not
> > > maintaining the cached value of the register at all and update only
> > > specific fields in the register via read-modify-write. Some places -
> > > like D2D link enabling or the port disabling - use RMW already.
> > >
> > > Based on the above update the register via RMW during the port
> > > configuration / enabling as well. After all the places updating
> > > DDI_BUF_CTL are changed - probably the voltage-swing/pre-emphasis
> > > level setting is the only one remaining - tracking the register
> > > value in intel_dp:DP could be removed.
> > >

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> > > Signed-off-by: Imre Deak <imre.deak@gmail.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_ddi.c | 23
> > > ++++++++++++++++++++++-
> > >  1 file changed, 22 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> > > b/drivers/gpu/drm/i915/display/intel_ddi.c
> > > index ddb182550ad0f..64c42505f2ad6 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > > @@ -359,6 +359,10 @@ static void intel_ddi_init_dp_buf_reg(struct
> > > intel_encoder *encoder,
> > >
> > >  	if (IS_ALDERLAKE_P(i915) && intel_encoder_is_tc(encoder)) {
> > >  		intel_dp->DP |= ddi_buf_phy_link_rate(crtc_state->port_clock);
> > > +		/*
> > > +		 * TODO: remove the following once DDI_BUF_CTL is updated
> via
> > > +		 * an RMW everywhere.
> > > +		 */
> > >  		if (!intel_tc_port_in_tbt_alt_mode(dig_port))
> > >  			intel_dp->DP |= DDI_BUF_CTL_TC_PHY_OWNERSHIP;
> > >  	}
> > > @@ -370,6 +374,22 @@ static void intel_ddi_init_dp_buf_reg(struct
> intel_encoder *encoder,
> > >  	}
> > >  }
> > >
> > > +static u32 intel_ddi_buf_ctl_config_mask(struct intel_encoder
> > > +*encoder) {
> > > +	struct intel_display *display = to_intel_display(encoder);
> > > +	u32 mask = DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES |
> > > +		   DDI_PORT_WIDTH_MASK;
> >
> > The caller only sets DDI_PORT_WIDTH() for display >= 14.
> 
> It does get set everywhere. For HDMI on display < 14 it's set to 0 (ignored by the
> HW), on display >= 14 it's set to the actual port width.
> 
> > > +
> > > +	if (DISPLAY_VER(display) >= 14)
> > > +		mask |= DDI_BUF_PORT_DATA_MASK;
> >
> > But doesn't touch this?
> 
> It's always set on display >= 14.
> 
> >
> > > +	if (display->platform.alderlake_p)
> > > +		mask |= DDI_BUF_PHY_LINK_RATE_MASK;
> >
> > DDI_BUF_CTL_TC_PHY_OWNERSHIP?
> 
> This shouldn't be changed during configuring and enabling the port.
> 
> > > +	if (IS_DISPLAY_VER(display, 11, 13))
> > > +		mask |= DDI_BUF_LANE_STAGGER_DELAY_MASK;
> > > +
> > > +	return mask;
> > > +}
> >
> > I don't know, this patch is incredibly hard to follow.
> >
> > BR,
> > Jani.
> >
> >
> > > +
> > >  static int icl_calc_tbt_pll_link(struct drm_i915_private *dev_priv,
> > >  				 enum port port)
> > >  {
> > > @@ -3062,7 +3082,8 @@ static void intel_enable_ddi_buf(struct
> intel_encoder *encoder, u32 buf_ctl)
> > >  	struct intel_display *display = to_intel_display(encoder);
> > >  	enum port port = encoder->port;
> > >
> > > -	intel_de_write(display, DDI_BUF_CTL(port), buf_ctl |
> DDI_BUF_CTL_ENABLE);
> > > +	intel_de_rmw(display, DDI_BUF_CTL(port),
> > > +		     intel_ddi_buf_ctl_config_mask(encoder), buf_ctl |
> > > +DDI_BUF_CTL_ENABLE);
> > >  	intel_de_posting_read(display, DDI_BUF_CTL(port));
> > >
> > >  	intel_wait_ddi_buf_active(encoder);
> >
> > --
> > Jani Nikula, Intel

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

end of thread, other threads:[~2025-02-12 11:51 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29 20:02 [PATCH 00/17] drm/i915/ddi: Fix/simplify port enabling/disabling Imre Deak
2025-01-29 20:02 ` [PATCH 01/17] drm/i915/dsi: Use TRANS_DDI_FUNC_CTL's own port width macro Imre Deak
2025-01-30 11:47   ` Jani Nikula
2025-01-29 20:02 ` [PATCH 02/17] drm/i915/ddi: Fix HDMI port width programming in DDI_BUF_CTL Imre Deak
2025-01-30 11:51   ` Jani Nikula
2025-01-30 13:33     ` Imre Deak
2025-01-29 20:02 ` [PATCH 03/17] drm/i915/ddi: Make all the PORT_WIDTH macros work the same way Imre Deak
2025-01-30 11:52   ` Jani Nikula
2025-01-29 20:02 ` [PATCH 04/17] drm/i915/ddi: Set missing TC DP PHY lane stagger delay in DDI_BUF_CTL Imre Deak
2025-02-05 12:22   ` Jani Nikula
2025-02-05 13:20     ` Imre Deak
2025-01-29 20:02 ` [PATCH 05/17] drm/i915/ddi: Simplify the port enabling via DDI_BUF_CTL Imre Deak
2025-01-30 11:55   ` Jani Nikula
2025-01-30 13:34     ` Imre Deak
2025-01-29 20:02 ` [PATCH 06/17] drm/i915/ddi: Simplify the port disabling " Imre Deak
2025-02-05 12:24   ` Jani Nikula
2025-01-29 20:02 ` [PATCH 07/17] drm/i915/ddi: Simplify waiting for a port to idle " Imre Deak
2025-02-05 12:35   ` Jani Nikula
2025-02-05 12:47     ` Imre Deak
2025-02-05 13:02       ` Jani Nikula
2025-02-12 11:48         ` Kahola, Mika
2025-01-29 20:02 ` [PATCH 08/17] drm/i915/ddi: Move platform checks within mtl_ddi_enable/disable_d2d_link() Imre Deak
2025-02-05 12:42   ` Jani Nikula
2025-02-05 13:46     ` Imre Deak
2025-01-29 20:02 ` [PATCH 09/17] drm/i915/ddi: Unify the platform specific functions disabling a port Imre Deak
2025-02-05 12:45   ` Jani Nikula
2025-01-29 20:02 ` [PATCH 10/17] drm/i915/ddi: Add a helper to enable " Imre Deak
2025-02-05 12:49   ` Jani Nikula
2025-02-05 14:43     ` Imre Deak
2025-01-29 20:02 ` [PATCH 11/17] drm/i915/ddi: Sanitize DDI_BUF_CTL register definitions Imre Deak
2025-02-05 12:52   ` Jani Nikula
2025-02-05 14:52     ` Imre Deak
2025-01-29 20:02 ` [PATCH 12/17] drm/i915/ddi: Configure/enable a port in DDI_BUF_CTL via read-modify-write Imre Deak
2025-02-10 18:13   ` Jani Nikula
2025-02-10 18:25     ` Imre Deak
2025-02-12 11:51       ` Kahola, Mika
2025-01-29 20:02 ` [PATCH 13/17] drm/i915/ddi: Factor out a helper to get DDI_BUF_CTL's config value Imre Deak
2025-02-10 18:06   ` Jani Nikula
2025-01-29 20:02 ` [PATCH 14/17] drm/i915/ddi: Reuse helper to compute the HDMI DDI_BUF_CTL config Imre Deak
2025-02-11 14:06   ` Kahola, Mika
2025-01-29 20:02 ` [PATCH 15/17] drm/i915/ddi: Reuse helper to compute the HDMI PORT_BUF_CTL1 config Imre Deak
2025-02-12  9:51   ` Kahola, Mika
2025-01-29 20:02 ` [PATCH 16/17] drm/i915/ddi: Move platform/encoder checks within adlp_tbt_to_dp_alt_switch_wa() Imre Deak
2025-02-12 11:06   ` Kahola, Mika
2025-01-29 20:02 ` [PATCH 17/17] drm/i915/ddi: Unify the platform specific functions enabling a port Imre Deak
2025-02-12 11:26   ` Kahola, Mika
2025-01-29 21:14 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/ddi: Fix/simplify port enabling/disabling Patchwork
2025-01-29 21:14 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-01-29 21:30 ` ✗ i915.CI.BAT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox