aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_tv.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-09-13 11:51:53 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-09-13 13:27:20 +0100
commit3123698f50fe4ac9ddb775dcd2b34a1d9cdd603f (patch)
tree19bf0a89fe2f609d5bb4a8cdbfb00c20ed280502 /drivers/gpu/drm/i915/intel_tv.c
parentdrm/i915: Squelch smatch warning for statement with no effect (diff)
downloadlinux-dev-3123698f50fe4ac9ddb775dcd2b34a1d9cdd603f.tar.xz
linux-dev-3123698f50fe4ac9ddb775dcd2b34a1d9cdd603f.zip
drm/i915: Use mul_u32_u32() for 32b x 32b -> 64b result
As realised by commit 9e3d6223d209 ("math64, timers: Fix 32bit mul_u64_u32_shr() and friends"), GCC does not always generate ideal code for performing a 32b x 32b multiply returning a 64b result (i.e. where we idiomatically use u64 result = (u64)x * (u32)x). This catches a couple of instances in the display code using (u64)x * (u32)y. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20170913105154.2910-1-chris@chris-wilson.co.uk Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_tv.c')
-rw-r--r--drivers/gpu/drm/i915/intel_tv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 0cc999fa09c5..a79a7591b2cf 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1385,7 +1385,7 @@ intel_tv_get_modes(struct drm_connector *connector)
mode_ptr->vsync_end = mode_ptr->vsync_start + 1;
mode_ptr->vtotal = vactive_s + 33;
- tmp = (u64) tv_mode->refresh * mode_ptr->vtotal;
+ tmp = mul_u32_u32(tv_mode->refresh, mode_ptr->vtotal);
tmp *= mode_ptr->htotal;
tmp = div_u64(tmp, 1000000);
mode_ptr->clock = (int) tmp;