]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drm: Use u64 for intermediate dotclock calculations
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 21 Oct 2016 14:15:40 +0000 (15:15 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 21 Oct 2016 18:23:16 +0000 (20:23 +0200)
commit8a5bbf327aa16025c78491266a6425807c7fbee0
treec43d7cf6a49be82fe24ee7fcb808f2f8e36b0978
parent93ca7e00667063a8dc86f04373e85e89a09efef4
drm: Use u64 for intermediate dotclock calculations

We have reached the era where monitor bandwidths now exceed 31bits in
frequency calculations, though as we stored them in kHz units we are
safe from overflow in the modelines for some time.

[   48.723720] UBSAN: Undefined behaviour in ../drivers/gpu/drm/drm_modes.c:325:49
[   48.726943] signed integer overflow:
[   48.728503] 2240 * 1000000 cannot be represented in type 'int'

Reported-by: Martin Liška <marxin.liska@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98372
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161021141540.26837-1-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_modes.c