[Intel-gfx] [PATCH 3/6] drm/i915/display: Embed the new struct steps for squashing

Srivatsa, Anusha anusha.srivatsa at intel.com
Mon Sep 19 22:54:46 UTC 2022



> -----Original Message-----
> From: Navare, Manasi D <manasi.d.navare at intel.com>
> Sent: Monday, September 19, 2022 12:39 PM
> To: Jani Nikula <jani.nikula at linux.intel.com>
> Cc: Srivatsa, Anusha <anusha.srivatsa at intel.com>; intel-
> gfx at lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH 3/6] drm/i915/display: Embed the new struct
> steps for squashing
> 
> On Mon, Sep 19, 2022 at 12:27:55PM +0300, Jani Nikula wrote:
> > On Fri, 16 Sep 2022, Anusha Srivatsa <anusha.srivatsa at intel.com> wrote:
> > > Populate the new struct steps for squash case.
> > >
> > > Signed-off-by: Anusha Srivatsa <anusha.srivatsa at intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_cdclk.c | 9 ++++++++-
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c
> > > b/drivers/gpu/drm/i915/display/intel_cdclk.c
> > > index 220d32adbd12..d2e81134b6f2 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> > > @@ -1973,8 +1973,9 @@ static bool intel_cdclk_can_crawl(struct
> > > drm_i915_private *dev_priv,
> > >
> > >  static bool intel_cdclk_can_squash(struct drm_i915_private *dev_priv,
> > >  				   const struct intel_cdclk_config *a,
> > > -				   const struct intel_cdclk_config *b)
> > > +				   struct intel_cdclk_config *b)
> >
> > Why are you dropping const?
@Jani Nikula @Navare, Manasi D
Looking at intel_modeset_calc_cdclk() from where this function is called, new_cdclk_state is not a const. Since we are going to be populating it in intel_cdclk_can_squash() and in intel_cdclk_can_crawl() in the next patch, keeping it non-const made sense.


> >
> > >  {
> > > +	struct cdclk_step *cdclk_transition = b->steps;
> >
> > The type name has step, the array is named steps, why is the variable
> > "transition"?
> 
> Yes I agree that the name cdclk_tranistion is confusing rather having
> cdclk_transition is unnecessary.
> Why cant you directly access b->steps->action, b->steps->cdclk
> 
Now that I look at it again, I see that cdclk_transition might be confusing. I will either rename it or directly access it as Manasi suggested.

Anusha
> Manasi
> 
> >
> > >  	/*
> > >  	 * FIXME should store a bit more state in intel_cdclk_config
> > >  	 * to differentiate squasher vs. cd2x divider properly. For @@
> > > -1984,6 +1985,12 @@ static bool intel_cdclk_can_squash(struct
> drm_i915_private *dev_priv,
> > >  	if (!has_cdclk_squasher(dev_priv))
> > >  		return false;
> > >
> > > +	if (a->cdclk != b->cdclk && a->vco != 0 &&
> > > +	    a->vco == b->vco &&	a->ref == b->ref) {
> > > +		cdclk_transition->action = CDCLK_SQUASH_ONLY;
> > > +		cdclk_transition->cdclk = b->cdclk;
> > > +	}
> > > +
> > >  	return a->cdclk != b->cdclk &&
> > >  		a->vco != 0 &&
> > >  		a->vco == b->vco &&
> >
> > --
> > Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list