summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2019-06-11 00:48:47 +0300
committerLucas De Marchi <lucas.demarchi@intel.com>2019-06-11 22:41:45 +0300
commit522d47cff1128fa0a1edbdf47eb211633a171ab8 (patch)
tree6149f9d6d1ae565393bc70ad43448e75cbcf0451
parent63b1700b40d63a1369c0bc756d579bc242c658d7 (diff)
downloadlinux-522d47cff1128fa0a1edbdf47eb211633a171ab8.tar.xz
drm/i915/skl: 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/20190610214847.9865-1-lucas.demarchi@intel.com
-rw-r--r--drivers/gpu/drm/i915/intel_cdclk.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
index 80e22507cd34..8993ab283562 100644
--- a/drivers/gpu/drm/i915/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/intel_cdclk.c
@@ -809,20 +809,14 @@ static int skl_calc_cdclk(int min_cdclk, int vco)
static u8 skl_calc_voltage_level(int cdclk)
{
- switch (cdclk) {
- default:
- case 308571:
- case 337500:
- return 0;
- case 450000:
- case 432000:
- return 1;
- case 540000:
- return 2;
- case 617143:
- case 675000:
+ if (cdclk > 540000)
return 3;
- }
+ else if (cdclk > 450000)
+ return 2;
+ else if (cdclk > 337500)
+ return 1;
+ else
+ return 0;
}
static void skl_dpll0_update(struct drm_i915_private *dev_priv,