[Intel-gfx] [PATCH v2 8/9] drm/i915/display: Eliminate IS_METEORLAKE checks

Matt Roper matthew.d.roper at intel.com
Thu Jul 27 19:05:17 UTC 2023


On Thu, Jul 27, 2023 at 03:38:46PM -0300, Lucas De Marchi wrote:
> On Mon, Jul 24, 2023 at 05:13:21PM -0700, Matt Roper wrote:
> > diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy.c b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> 
> for the phy checks what I have locally is:
> 
> > index 1b00ef2c6185..a42b3c4c0ed7 100644
> > --- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> > +++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
> > @@ -31,7 +31,7 @@
> > 
> > bool intel_is_c10phy(struct drm_i915_private *i915, enum phy phy)
> > {
> > -	if (IS_METEORLAKE(i915) && (phy < PHY_C))
> > +	if (DISPLAY_VER_FULL(i915) == IP_VER(14, 0) && phy < PHY_C)
> 
> 	if (DISPLAY_VER(i915) >= 14 && !IS_DGFX(i915) && (phy < PHY_C))

Why the !IS_DGFX check?  We can assume the PHYs will remain the same for
future platforms in general (at least until a platform shows up and
requires a change), but I don't think there's any reason yet to assume
that only igpu's will inherit the behavior and dgpu's won't.

> 
> > 		return true;
> > 
> > 	return false;
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 43cba98f7753..85efd77f491b 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -1767,7 +1767,7 @@ bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy)
> > 	if (IS_DG2(dev_priv))
> > 		/* DG2's "TC1" output uses a SNPS PHY */
> > 		return false;
> > -	else if (IS_ALDERLAKE_P(dev_priv) || IS_METEORLAKE(dev_priv))
> > +	else if (IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER_FULL(dev_priv) == IP_VER(14, 0))
> 
> 	else if (DISPLAY_VER(dev_priv) >= 13 && !IS_DGFX(dev_priv))

Same here.  This is probably fine if we switch the IS_DGFX to IS_DG2 to
exclude the single existing platform that we know doesn't follow this,
but I don't think we should assume the same will be true on future
dgpus.


Matt

> 
> > 		return phy >= PHY_F && phy <= PHY_I;
> > 	else if (IS_TIGERLAKE(dev_priv))
> > 		return phy >= PHY_D && phy <= PHY_I;
> 
> 
> would that be better or do you have something else in mind?
> 
> Lucas De Marchi
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-gfx mailing list