[Intel-gfx] [10/12] drm/i915: Introduce HPD_PORT_TC<n>

Souza, Jose jose.souza at intel.com
Mon Sep 14 16:58:33 UTC 2020


On Mon, 2020-09-14 at 17:48 +0300, Ville Syrjälä wrote:
> On Sat, Sep 12, 2020 at 01:30:23AM +0000, Souza, Jose wrote:
> > On Wed, 2020-07-01 at 00:55 +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <
> > > ville.syrjala at linux.intel.com
> > > 
> > > 
> > > Make a clean split between hpd pins for DDI vs. TC. This matches
> > > how the actual hardware is split.
> > > 
> > > And with this we move the DDI/PHY->HPD pin mapping into the encoder
> > > init instead of having to remap yet again in the interrupt code.
> > > 
> > > Signed-off-by: Ville Syrjälä <
> > > ville.syrjala at linux.intel.com
> > > 
> > > 
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_ddi.c     |  65 +++++++++-
> > >  drivers/gpu/drm/i915/display/intel_hotplug.c |  25 +---
> > >  drivers/gpu/drm/i915/i915_drv.h              |  17 +--
> > >  drivers/gpu/drm/i915/i915_irq.c              | 121 +++++--------------
> > >  4 files changed, 102 insertions(+), 126 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > > index d024491738b3..a2c9815c5abc 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > > @@ -4847,6 +4847,57 @@ intel_ddi_max_lanes(struct intel_digital_port *intel_dport)
> > >  	return max_lanes;
> > >  }
> > >  
> > > +static enum hpd_pin tgl_hpd_pin(struct drm_i915_private *dev_priv,
> > > +				enum port port)
> > > +{
> > > +	if (port >= PORT_D)
> > > +		return HPD_PORT_TC1 + port - PORT_D;
> > > +	else
> > > +		return HPD_PORT_A + port - PORT_A;
> > > +}
> > > +
> > > +static enum hpd_pin rkl_hpd_pin(struct drm_i915_private *dev_priv,
> > > +				enum port port)
> > > +{
> > > +	if (HAS_PCH_TGP(dev_priv))
> > > +		return tgl_hpd_pin(dev_priv, port);
> > > +
> > > +	if (port >= PORT_D)
> > > +		return HPD_PORT_C + port - PORT_D;
> > 
> > The above looks wrong, for it would match with only the return bellow.
> 
> On rkl+tgp we want:
> PORT_A (DDI A)   -> HPD_PORT_A
> PORT_B (DDI B)   -> HPD_PORT_B
> PORT_D (DDI TC1) -> HPD_PORT_TC1
> PORT_E (DDI TC2) -> HPD_PORT_TC2
> 
> On rkl+cmp we want:
> PORT_A (DDI A)   -> HPD_PORT_A
> PORT_B (DDI B)   -> HPD_PORT_B
> PORT_D (DDI TC1) -> HPD_PORT_C
> PORT_E (DDI TC2) -> HPD_PORT_D

oohh okay, missed this.

> 
> > > +	else
> > > +		return HPD_PORT_A + port - PORT_A;
> > > +}
> > > +
> > > +static enum hpd_pin icl_hpd_pin(struct drm_i915_private *dev_priv,
> > > +				enum port port)
> > > +{
> > > +	if (port >= PORT_C)
> > > +		return HPD_PORT_TC1 + port - PORT_C;
> > > +	else
> > > +		return HPD_PORT_A + port - PORT_A;
> > > +}
> > > +
> > > +static enum hpd_pin ehl_hpd_pin(struct drm_i915_private *dev_priv,
> > > +				enum port port)
> > > +{
> > > +	if (port == PORT_D)
> > > +		return HPD_PORT_A;
> > > +
> > > +	if (HAS_PCH_MCC(dev_priv))
> > > +		return icl_hpd_pin(dev_priv, port);
> > 
> > Maybe call tgl_hpd_pin() for HAS_PCH_MCC()? The code bellow will match but just for consistency.
> 
> On jsl+mcc we want:
> PORT_A/D (DDI A/D) -> HPD_PORT_A
> PORT_B   (DDI B)   -> HPD_PORT_B
> PORT_C   (DDI C)   -> HPD_PORT_TC1
> 
> on jsl+icp we want:
> PORT_A/D (DDI A/D) -> HPD_PORT_A
> PORT_B   (DDI B)   -> HPD_PORT_B
> PORT_C   (DDI C)   -> HPD_PORT_C
> 
> 

The above would be the output of tgl_hpd_pin() but okay as it can be associate with SPT, LPT, ICP and TGP better keep the current code.

Reviewed-by: José Roberto de Souza <jose.souza at intel.com>




More information about the Intel-gfx mailing list