]> git.baikalelectronics.ru Git - kernel.git/commit
drm/komeda: fix 32-bit komeda_crtc_update_clock_ratio
authorArnd Bergmann <arnd@arndb.de>
Mon, 17 Jun 2019 12:51:04 +0000 (14:51 +0200)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Fri, 21 Jun 2019 09:46:40 +0000 (10:46 +0100)
commit2ff7c85ef20c127c0c6c543794fe74f5282c29fc
tree157dc8fc775f90c09d9fc9baf8e1fbb4afab623f
parenta31cffde106f4cc9ce548a84f06f03f2d9fc4ee3
drm/komeda: fix 32-bit komeda_crtc_update_clock_ratio

clang points out a bug in the clock calculation on 32-bit, that leads
to the clock_ratio always being zero:

drivers/gpu/drm/arm/display/komeda/komeda_crtc.c:31:36: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        aclk = komeda_calc_aclk(kcrtc_st) << 32;

Move the shift into the division to make it apply on a 64-bit
variable. Also use the more expensive div64_u64() instead of div_u64()
to account for pxlclk being a 64-bit integer.

Fixes: 727e95d87b95 ("drm/komeda: Add engine clock requirement check for the downscaling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
drivers/gpu/drm/arm/display/komeda/komeda_crtc.c