Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/rps: use intel_fsb_freq() and intel_mem_freq()

The rps init only happens once, so it's not important to use the cached
versions, and we can drop the dependency on them.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/6f3b703f7cb5605bf139cbe27697c1d4ffe7e719.1755511595.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Jani Nikula 6c9f41d8 6e977fe7

+8 -3
+8 -3
drivers/gpu/drm/i915/gt/intel_rps.c
··· 9 9 10 10 #include "display/intel_display.h" 11 11 #include "display/intel_display_rps.h" 12 + #include "soc/intel_dram.h" 12 13 #include "i915_drv.h" 13 14 #include "i915_irq.h" 14 15 #include "i915_reg.h" ··· 277 276 { 278 277 struct drm_i915_private *i915 = rps_to_i915(rps); 279 278 struct intel_uncore *uncore = rps_to_uncore(rps); 279 + unsigned int fsb_freq, mem_freq; 280 280 u8 fmax, fmin, fstart; 281 281 u32 rgvmodectl; 282 282 int c_m, i; 283 283 284 - if (i915->fsb_freq <= 3200000) 284 + fsb_freq = intel_fsb_freq(i915); 285 + mem_freq = intel_mem_freq(i915); 286 + 287 + if (fsb_freq <= 3200000) 285 288 c_m = 0; 286 - else if (i915->fsb_freq <= 4800000) 289 + else if (fsb_freq <= 4800000) 287 290 c_m = 1; 288 291 else 289 292 c_m = 2; 290 293 291 294 for (i = 0; i < ARRAY_SIZE(cparams); i++) { 292 295 if (cparams[i].i == c_m && 293 - cparams[i].t == DIV_ROUND_CLOSEST(i915->mem_freq, 1000)) { 296 + cparams[i].t == DIV_ROUND_CLOSEST(mem_freq, 1000)) { 294 297 rps->ips.m = cparams[i].m; 295 298 rps->ips.c = cparams[i].c; 296 299 break;