Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Mika Kahola" <mika.kahola@intel.com>
Subject: Re: [PATCH 5/5] drm/i915/cx0: Read out power-down state of both PHY lanes for reversed lanes
Date: Fri, 21 Nov 2025 10:31:07 +0200	[thread overview]
Message-ID: <aSAjS5p7ML4BXkGg@ideak-desk> (raw)
In-Reply-To: <DM3PPF208195D8D7262BD8D92C00DF77FDCE3D5A@DM3PPF208195D8D.namprd11.prod.outlook.com>

On Fri, Nov 21, 2025 at 05:54:46AM +0200, Suraj Kandpal wrote:
> > Subject: [PATCH 5/5] drm/i915/cx0: Read out power-down state of both PHY
> > lanes for reversed lanes
> > 
> > For a port used with lane reversal enabled the first two TX lanes will be enabled
> > in PHY lane#1 instead of PHY lane#0. At the moment the HW readout will read
> > out the power-down state for these two TX lanes from PHY lane#0 incorrectly.
> > The display HW lane reversal feature (vs. the similar TCSS lane swap) is only
> > used for TypeC legacy mode and for non-TypeC PHYs. Since in both of these
> > cases the display owns both PHY lanes, both of these PHY lanes' state can be
> > read out. Do that to fix cases when lane reversal is used with 1 or 2 active TX
> > lanes.
> > 
> > While at it add an assert to the PLL enable function about the above
> > assumption on when lane reversal can be used.
> > 
> > Cc: Mika Kahola <mika.kahola@intel.com>
> > Cc: Suraj Kandpal <suraj.kandpal@intel.com>
> > Fixes: 230d4c748113 ("drm/i915/cx0: Track the Cx0 PHY enabled lane count in
> > the PLL state")
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_cx0_phy.c | 24 ++++++++++++++++++--
> >  1 file changed, 22 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> > b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> > index 0d524735dcf95..27be2a490297f 100644
> > --- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> > +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> > @@ -2197,17 +2197,30 @@ static int readout_enabled_lane_count(struct intel_encoder *encoder)  {
> >  	struct intel_display *display = to_intel_display(encoder);
> >  	u8 enabled_tx_lane_count = 0;
> > -	int max_tx_lane_count;
> > +	int max_tx_lane_count = 4;
> > +	bool lane_reversal;
> >  	int tx_lane;
> > 
> > +	lane_reversal = intel_de_read(display, XELPDP_PORT_BUF_CTL1(display, encoder->port)) &
> > +			XELPDP_PORT_REVERSAL;
> > +
> 
> Can't we just do 
> struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> bool lane_reversal = dig_port->lane_reversal;
> 
> or are there limitations with that now?

The HW/SW state verification should check what was programmed to the HW
(comparing the HW state to the SW state), so the readout here shouldn't
use any SW state. Also the PLL code should be independent, not rely on
anything in intel_encoder (except for port which is used to read out the
PLL/PHY registers).

> Regards.
> Suraj Kandpal

  reply	other threads:[~2025-11-21  8:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 17:23 [PATCH 1/5] drm/i915/cx0: Fix port to PLL ID mapping on BMG Imre Deak
2025-11-20 17:23 ` [PATCH 2/5] drm/i915/tc: Add separate intel_tc_phy_port_to_tc() for TC DDI/PHY ports Imre Deak
2025-11-21  2:56   ` Kandpal, Suraj
2025-11-21 11:19   ` Jani Nikula
2025-11-21 15:26     ` Imre Deak
2025-11-20 17:23 ` [PATCH 3/5] drm/i915/cx0: Use intel_port_to_tc() instead of open coding it Imre Deak
2025-11-21  3:08   ` Kandpal, Suraj
2025-11-21 11:28   ` Jani Nikula
2025-11-21 15:30     ` Imre Deak
2025-11-20 17:23 ` [PATCH 4/5] drm/i915/cx0: Read out power-down state of both TXs in PHY lane 0 Imre Deak
2025-11-21  3:50   ` Kandpal, Suraj
2025-11-20 17:23 ` [PATCH 5/5] drm/i915/cx0: Read out power-down state of both PHY lanes for reversed lanes Imre Deak
2025-11-21  3:54   ` Kandpal, Suraj
2025-11-21  8:31     ` Imre Deak [this message]
2025-11-21  8:45       ` Kandpal, Suraj
2025-11-20 18:36 ` ✗ i915.CI.BAT: failure for series starting with [1/5] drm/i915/cx0: Fix port to PLL ID mapping on BMG Patchwork
2025-11-20 19:09   ` Imre Deak
2025-11-21 10:44 ` ✗ i915.CI.Full: " Patchwork
2025-11-21 19:47   ` Imre Deak
2025-11-24 14:06 ` Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSAjS5p7ML4BXkGg@ideak-desk \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mika.kahola@intel.com \
    --cc=suraj.kandpal@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox