cpufreq: intel_pstate: increase precision of performance limits
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 22 Nov 2016 00:33:20 +0000 (16:33 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Nov 2016 01:31:49 +0000 (02:31 +0100)
commitd5dd33d9de0d50db7f3ba221f9c4e4f74e61a69d
treee7c131c80841832c05f352d66a6321b521ba425c
parent46992d6b55b558ac4128c1f846de3cfddfa7cf7c
cpufreq: intel_pstate: increase precision of performance limits

Even with round up of limits->min_perf and limits->max_perf, in some
cases resultant performance is 100 MHz less than the desired.

For example when the maximum frequency is 3.50 GHz, setting
scaling_min_frequency to 2.3 GHz always results in 2.2 GHz minimum.

Currently the fixed floating point operation uses 8 bit precision for
calculating limits->min_perf and limits->max_perf. For some operations
in this driver the 14 bit precision is used. Using the 14 bit precision
also for calculating limits->min_perf and limits->max_perf, addresses
this issue.

Introduced fp_ext_toint() equivalent to fp_toint() and int_ext_tofp()
equivalent to int_tofp() with 14 bit precision.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c