@@ -2126,6 +2126,31 @@ u32 intel_rps_get_max_frequency(struct intel_rps *rps)
21262126 return intel_gpu_freq (rps , rps -> max_freq_softlimit );
21272127}
21282128
2129+ /**
2130+ * intel_rps_get_max_raw_freq - returns the max frequency in some raw format.
2131+ * @rps: the intel_rps structure
2132+ *
2133+ * Returns the max frequency in a raw format. In newer platforms raw is in
2134+ * units of 50 MHz.
2135+ */
2136+ u32 intel_rps_get_max_raw_freq (struct intel_rps * rps )
2137+ {
2138+ struct intel_guc_slpc * slpc = rps_to_slpc (rps );
2139+ u32 freq ;
2140+
2141+ if (rps_uses_slpc (rps )) {
2142+ return DIV_ROUND_CLOSEST (slpc -> rp0_freq ,
2143+ GT_FREQUENCY_MULTIPLIER );
2144+ } else {
2145+ freq = rps -> max_freq ;
2146+ if (GRAPHICS_VER (rps_to_i915 (rps )) >= 9 ) {
2147+ /* Convert GT frequency to 50 MHz units */
2148+ freq /= GEN9_FREQ_SCALER ;
2149+ }
2150+ return freq ;
2151+ }
2152+ }
2153+
21292154u32 intel_rps_get_rp0_frequency (struct intel_rps * rps )
21302155{
21312156 struct intel_guc_slpc * slpc = rps_to_slpc (rps );
@@ -2214,6 +2239,31 @@ u32 intel_rps_get_min_frequency(struct intel_rps *rps)
22142239 return intel_gpu_freq (rps , rps -> min_freq_softlimit );
22152240}
22162241
2242+ /**
2243+ * intel_rps_get_min_raw_freq - returns the min frequency in some raw format.
2244+ * @rps: the intel_rps structure
2245+ *
2246+ * Returns the min frequency in a raw format. In newer platforms raw is in
2247+ * units of 50 MHz.
2248+ */
2249+ u32 intel_rps_get_min_raw_freq (struct intel_rps * rps )
2250+ {
2251+ struct intel_guc_slpc * slpc = rps_to_slpc (rps );
2252+ u32 freq ;
2253+
2254+ if (rps_uses_slpc (rps )) {
2255+ return DIV_ROUND_CLOSEST (slpc -> min_freq ,
2256+ GT_FREQUENCY_MULTIPLIER );
2257+ } else {
2258+ freq = rps -> min_freq ;
2259+ if (GRAPHICS_VER (rps_to_i915 (rps )) >= 9 ) {
2260+ /* Convert GT frequency to 50 MHz units */
2261+ freq /= GEN9_FREQ_SCALER ;
2262+ }
2263+ return freq ;
2264+ }
2265+ }
2266+
22172267static int set_min_freq (struct intel_rps * rps , u32 val )
22182268{
22192269 int ret = 0 ;
0 commit comments