All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/i915: Use pw_idx to derive PHY for ICL_LANE_ENABLE_AUX override
Date: Thu, 7 Mar 2024 19:58:12 +0200	[thread overview]
Message-ID: <ZeoANEo3ZNzj3yq8@intel.com> (raw)
In-Reply-To: <Zec27k4Wh9b1fiqs@ideak-desk.fi.intel.com>

On Tue, Mar 05, 2024 at 05:14:54PM +0200, Imre Deak wrote:
> On Thu, Feb 29, 2024 at 10:03:56PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > We don't actually know whether we should be picking the PHY
> > simply based on the AUX_CH/power well, or based on the VBT
> > defined AUX_CH->DDI->PHY relationship. At the moment we are
> > doing the former for the ANAOVRD workaround, and the latter
> > for the ICL_LANE_ENABLE_AUX override. Windows seems to use the
> > first approach for everything. So let's unify this to follow
> > that same approach for both.
> > 
> > Eventually we should try to figure out  which is actually
> > correct, or whether any of this even matters (ie. whether there
> > are any real machines where the DDI and its AUX_CH do not match
> > 1:1).
> > 
> > Note that this also changes the behaviour if we do end up
> > poking an AUX power well not associated with any port (as
> > per VBT). Previously we would have skipped the PHY register
> > write, but now we always write it.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  .../i915/display/intel_display_power_well.c   | 21 +++++++++++--------
> >  1 file changed, 12 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> > index a1edac6ce31f..f25ad7d2c784 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> > @@ -419,10 +419,12 @@ icl_combo_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
> >  
> >  	intel_de_rmw(dev_priv, regs->driver, 0, HSW_PWR_WELL_CTL_REQ(pw_idx));
> >  
> > -	/* FIXME this is a mess */
> > -	if (phy != PHY_NONE)
> > -		intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy),
> > -			     0, ICL_LANE_ENABLE_AUX);
> > +	/*
> > +	 * FIXME not sure if we should derive the PHY from the pw_idx, or
> > +	 * from the VBT defined AUX_CH->DDI->PHY mapping.
> > +	 */
> > +	intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(ICL_AUX_PW_TO_PHY(pw_idx)),
> > +		     0, ICL_LANE_ENABLE_AUX);
> 
> I wonder if the same PW -> PHY mapping could be used in
> icl_aux_power_well_enable/disable() as well (to make it more consistent
> if there is no encoder using the PW). Cross connecting combo, TC PHY AUX
> channels doesn't work anyway I think (maybe this could be actually
> checked in intel_bios_dp_aux_ch()).

We can't tell the PHY type from the pw, unless we add that
information to the power well definitions.

> 
> On the patchset:
> Reviewed-by: Imre Deak <imre.deak@intel.com>
> 
> 
> >  
> >  	hsw_wait_for_power_well_enable(dev_priv, power_well, false);
> >  
> > @@ -439,14 +441,15 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
> >  {
> >  	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
> >  	int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
> > -	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
> >  
> >  	drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
> >  
> > -	/* FIXME this is a mess */
> > -	if (phy != PHY_NONE)
> > -		intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy),
> > -			     ICL_LANE_ENABLE_AUX, 0);
> > +	/*
> > +	 * FIXME not sure if we should derive the PHY from the pw_idx, or
> > +	 * from the VBT defined AUX_CH->DDI->PHY mapping.
> > +	 */
> > +	intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(ICL_AUX_PW_TO_PHY(pw_idx)),
> > +		     ICL_LANE_ENABLE_AUX, 0);
> >  
> >  	intel_de_rmw(dev_priv, regs->driver, HSW_PWR_WELL_CTL_REQ(pw_idx), 0);
> >  
> > -- 
> > 2.43.0
> > 

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-03-07 17:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 20:03 [PATCH 1/4] drm/i915: Rename ICL_AUX_ANAOVRD1 to ICL_PORT_TX_DW6_AUX Ville Syrjala
2024-02-29 20:03 ` [PATCH 2/4] drm/i915: Use REG_BIT() & co. in intel_combo_phy_regs.h Ville Syrjala
2024-02-29 20:03 ` [PATCH 3/4] drm/i915: Use pw_idx to derive PHY for ICL_LANE_ENABLE_AUX override Ville Syrjala
2024-03-05 15:14   ` Imre Deak
2024-03-07 17:58     ` Ville Syrjälä [this message]
2024-02-29 20:03 ` [PATCH 4/4] drm/i915: Streamline eDP handling in icl_combo_phy_aux_power_well_enable() Ville Syrjala
2024-02-29 23:36 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915: Rename ICL_AUX_ANAOVRD1 to ICL_PORT_TX_DW6_AUX Patchwork
2024-02-29 23:49 ` ✓ Fi.CI.BAT: success " Patchwork
2024-03-01 23:53 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-05 14:42 ` [PATCH 1/4] " Imre Deak

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=ZeoANEo3ZNzj3yq8@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.