Re: [PATCH] drm/i915/slpc: Fix PCODE IA Freq requests when using SLPC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 26 Aug 2022 03:13:18 -0700, Rodrigo Vivi wrote:
>
> We need to inform PCODE of a desired ring frequencies so PCODE update
> the memory frequencies to us. rps->min_freq and rps->max_freq are the
> frequencies used in that request. However they were unset when SLPC was
> enabled and PCODE never updated the memory freq.
>
> v2 (as Suggested by Ashutosh): if SLPC is in use, let's pick the right
>    frequencies from the get_ia_constants instead of the fake init of
>    rps' min and max.

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@xxxxxxxxx>

>
> Fixes: 7ba79a671568 ("drm/i915/guc/slpc: Gate Host RPS when SLPC is enabled")
> Cc: <stable@xxxxxxxxxxxxxxx> # v5.15+
> Cc: Ashutosh Dixit <ashutosh.dixit@xxxxxxxxx>
> Tested-by: Sushma Venkatesh Reddy <sushma.venkatesh.reddy@xxxxxxxxx>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/gt/intel_llc.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_llc.c b/drivers/gpu/drm/i915/gt/intel_llc.c
> index 14fe65812e42..766f9526da99 100644
> --- a/drivers/gpu/drm/i915/gt/intel_llc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_llc.c
> @@ -49,6 +49,7 @@ static unsigned int cpu_max_MHz(void)
>  static bool get_ia_constants(struct intel_llc *llc,
>			     struct ia_constants *consts)
>  {
> +	struct intel_guc_slpc *slpc = &llc_to_gt(llc)->uc.guc.slpc;
>	struct drm_i915_private *i915 = llc_to_gt(llc)->i915;
>	struct intel_rps *rps = &llc_to_gt(llc)->rps;
>
> @@ -65,8 +66,13 @@ static bool get_ia_constants(struct intel_llc *llc,
>	/* convert DDR frequency from units of 266.6MHz to bandwidth */
>	consts->min_ring_freq = mult_frac(consts->min_ring_freq, 8, 3);
>
> -	consts->min_gpu_freq = rps->min_freq;
> -	consts->max_gpu_freq = rps->max_freq;
> +	if (intel_uc_uses_guc_slpc(&llc_to_gt(llc)->uc)) {
> +		consts->min_gpu_freq = slpc->min_freq;
> +		consts->max_gpu_freq = slpc->rp0_freq;
> +	} else {
> +		consts->min_gpu_freq = rps->min_freq;
> +		consts->max_gpu_freq = rps->max_freq;
> +	}
>	if (GRAPHICS_VER(i915) >= 9) {
>		/* Convert GT frequency to 50 HZ units */
>		consts->min_gpu_freq /= GEN9_FREQ_SCALER;
> --
> 2.37.1
>



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux