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

Jani Nikula jani.nikula at linux.intel.com
Mon Sep 19 09:28:38 UTC 2022


On Fri, 16 Sep 2022, Anusha Srivatsa <anusha.srivatsa at intel.com> wrote:
> Populate the new struct steps for crawl 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 d2e81134b6f2..bb5bbb1ad982 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -1951,8 +1951,9 @@ void intel_cdclk_uninit_hw(struct drm_i915_private *i915)
>  
>  static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
>  				  const struct intel_cdclk_config *a,
> -				  const struct intel_cdclk_config *b)
> +				  struct intel_cdclk_config *b)

Same here, why are you dropping const?

>  {
> +	struct cdclk_step *cdclk_transition = b->steps;

Same here about naming.

>  	int a_div, b_div;
>  
>  	if (!HAS_CDCLK_CRAWL(dev_priv))
> @@ -1965,6 +1966,12 @@ static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
>  	a_div = DIV_ROUND_CLOSEST(a->vco, a->cdclk);
>  	b_div = DIV_ROUND_CLOSEST(b->vco, b->cdclk);
>  
> +	if (a->vco != 0 && b->vco != 0 && a->vco != b->vco &&
> +	    a_div == b_div && a->ref == b->ref) {
> +		cdclk_transition->action = CDCLK_CRAWL_ONLY;
> +		cdclk_transition->cdclk = b->cdclk;
> +	}
> +
>  	return a->vco != 0 && b->vco != 0 &&
>  		a->vco != b->vco &&
>  		a_div == b_div &&

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list