diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2019-06-10 14:48:34 -0700 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2019-06-11 12:41:41 -0700 |
commit | 63b1700b40d63a1369c0bc756d579bc242c658d7 (patch) | |
tree | 47ce861cc30fa73d2fe85be2d7df07b51257e4c4 | |
parent | 4f338ac0b2fa59ef0c10cb828a82922e1c39aa64 (diff) |
drm/i915/cnl: use ranges for voltage level lookup
Like was done for ICL, let's convert the voltage level lookup to use
frequency ranges rather than individual frequencies. For deciding the
voltage, the individual value doesn't really matter.
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190610214834.9789-1-lucas.demarchi@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/intel_cdclk.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c index 465a72d185ad..80e22507cd34 100644 --- a/drivers/gpu/drm/i915/intel_cdclk.c +++ b/drivers/gpu/drm/i915/intel_cdclk.c @@ -1531,15 +1531,12 @@ static int cnl_calc_cdclk(int min_cdclk) static u8 cnl_calc_voltage_level(int cdclk) { - switch (cdclk) { - default: - case 168000: - return 0; - case 336000: - return 1; - case 528000: + if (cdclk > 336000) return 2; - } + else if (cdclk > 168000) + return 1; + else + return 0; } static void cnl_cdclk_pll_update(struct drm_i915_private *dev_priv, |