[Intel-gfx] [PATCH] drm/i915/rps: Centralize computation of freq caps

Lucas De Marchi lucas.demarchi at intel.com
Mon Mar 21 18:17:46 UTC 2022


On Mon, Mar 21, 2022 at 10:56:04AM -0700, Ashutosh Dixit wrote:
>diff --git a/drivers/gpu/drm/i915/gt/intel_rps_types.h b/drivers/gpu/drm/i915/gt/intel_rps_types.h
>index 3941d8551f52..5990df35b393 100644
>--- a/drivers/gpu/drm/i915/gt/intel_rps_types.h
>+++ b/drivers/gpu/drm/i915/gt/intel_rps_types.h
>@@ -37,6 +37,13 @@ enum {
> 	INTEL_RPS_TIMER,
> };
>
>+/* Freq caps exposed by HW, in units of 16.67 MHz for recent gens */

"recent gens" is probably too broad. Since we are exporting this struct
to other parts of the driver and we are already abstracting the
register location and bit position, maybe we should also already
abstract the unit in the same place? i.e. just make it always be
"units of 16.67 MHz", or even just make it a standard Hz unit.

If this would rather make things more complicated for places that expect
"hw units", then maybe just say in this comment the value is in "HW
units" and intel_gpu_freq() should be used to convert to hz.

thanks
Lucas De Marchi

>+struct intel_rps_freq_caps {
>+	u8 rp0_freq;		/* Non-overclocked max frequency. */
>+	u8 rp1_freq;		/* "less than" RP0 power/freqency */
>+	u8 min_freq;		/* AKA RPn. Minimum frequency */
>+};
>+
> struct intel_rps {
> 	struct mutex lock; /* protects enabling and the worker */
>


More information about the Intel-gfx mailing list