mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-22 05:54:06 -04:00
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>
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "display/intel_display.h"
|
||||
#include "display/intel_display_rps.h"
|
||||
#include "soc/intel_dram.h"
|
||||
#include "i915_drv.h"
|
||||
#include "i915_irq.h"
|
||||
#include "i915_reg.h"
|
||||
@@ -276,20 +277,24 @@ static void gen5_rps_init(struct intel_rps *rps)
|
||||
{
|
||||
struct drm_i915_private *i915 = rps_to_i915(rps);
|
||||
struct intel_uncore *uncore = rps_to_uncore(rps);
|
||||
unsigned int fsb_freq, mem_freq;
|
||||
u8 fmax, fmin, fstart;
|
||||
u32 rgvmodectl;
|
||||
int c_m, i;
|
||||
|
||||
if (i915->fsb_freq <= 3200000)
|
||||
fsb_freq = intel_fsb_freq(i915);
|
||||
mem_freq = intel_mem_freq(i915);
|
||||
|
||||
if (fsb_freq <= 3200000)
|
||||
c_m = 0;
|
||||
else if (i915->fsb_freq <= 4800000)
|
||||
else if (fsb_freq <= 4800000)
|
||||
c_m = 1;
|
||||
else
|
||||
c_m = 2;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(cparams); i++) {
|
||||
if (cparams[i].i == c_m &&
|
||||
cparams[i].t == DIV_ROUND_CLOSEST(i915->mem_freq, 1000)) {
|
||||
cparams[i].t == DIV_ROUND_CLOSEST(mem_freq, 1000)) {
|
||||
rps->ips.m = cparams[i].m;
|
||||
rps->ips.c = cparams[i].c;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user