]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: avoid 64-bit division
authorArnd Bergmann <arnd@arndb.de>
Mon, 8 Jul 2019 13:52:08 +0000 (15:52 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jul 2019 19:27:23 +0000 (14:27 -0500)
commita22bbd3edbc26dd470627a3adae56fd5ec787b7e
tree0bc01f7ec039cd2babe6b09d144b879deb3f1939
parent9179adada5b0eeb5d5499481dc9056b65b10a2c1
drm/amd/display: avoid 64-bit division

On 32-bit architectures, dividing a 64-bit integer in the kernel
leads to a link error:

ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!

Change the two recently introduced instances to a multiply+shift
operation that is also much cheaper on 32-bit architectures.
We can do that here, since both of them are really 32-bit numbers
that change a few percent.

Fixes: d59bee4f21f3 ("drm/amd/display: Move link functions from dc to dc_link")
Fixes: 6f0b4e246961 ("drm/amd/display: update calculated bounding box logic for NV")
Acked-by: Slava Abramov <slava.abramov@amd.com>
Tested-by: Slava Abramov <slava.abramov@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c