aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorKumar, Mahesh <mahesh1.kumar@intel.com>2017-07-05 10:31:45 -0400
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-07-13 10:37:20 -0400
commiteed02a7b53131abb796ba8a8cf2886cee366a89f (patch)
tree9b6c017f2f0073eb485e0df7e1471853d0bc3bc0 /drivers/gpu/drm/i915/intel_pm.c
parent07ab976d1971a91a7ac25d4782dc8985a2314b87 (diff)
drm/i915: Always perform internal fixed16 division in 64 bits
This patch combines fixed_16_16_div & fixed_16_16_div_u64 wrappers. And new fixed_16_16_div wrapper always performs division operation in u64 internally, to avoid any data loss which was happening in earlier version of wrapper. earlier wrapper was converting u32 to fixed16 in 32 bit so we were losing 16-MSB data. Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170705143154.32132-3-mahesh1.kumar@intel.com [mlankhorst: Fix typo in commit message.]
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 6db833e6dcbd..05eabadaa23d 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4276,7 +4276,7 @@ static uint_fixed_16_16_t skl_wm_method1(uint32_t pixel_rate, uint8_t cpp,
4276 return FP_16_16_MAX; 4276 return FP_16_16_MAX;
4277 4277
4278 wm_intermediate_val = latency * pixel_rate * cpp; 4278 wm_intermediate_val = latency * pixel_rate * cpp;
4279 ret = fixed_16_16_div_u64(wm_intermediate_val, 1000 * 512); 4279 ret = fixed_16_16_div(wm_intermediate_val, 1000 * 512);
4280 return ret; 4280 return ret;
4281} 4281}
4282 4282
@@ -4314,7 +4314,7 @@ intel_get_linetime_us(struct intel_crtc_state *cstate)
4314 return u32_to_fixed_16_16(0); 4314 return u32_to_fixed_16_16(0);
4315 4315
4316 crtc_htotal = cstate->base.adjusted_mode.crtc_htotal; 4316 crtc_htotal = cstate->base.adjusted_mode.crtc_htotal;
4317 linetime_us = fixed_16_16_div_u64(crtc_htotal * 1000, pixel_rate); 4317 linetime_us = fixed_16_16_div(crtc_htotal * 1000, pixel_rate);
4318 4318
4319 return linetime_us; 4319 return linetime_us;
4320} 4320}