]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Fix divide-by-zero in DPPCLK and DISPCLK calculation
authorGeorge Shen <george.shen@amd.com>
Fri, 20 May 2022 15:55:10 +0000 (11:55 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Jun 2022 22:17:24 +0000 (18:17 -0400)
commit7014da2609e5239b531d6657844a92db9d5fe7e4
tree8d81d97eff03aea7dca2792929bd4d0c0449aead
parent7983bd35791171272fb79c029368386669c5d27c
drm/amd/display: Fix divide-by-zero in DPPCLK and DISPCLK calculation

[Why]
Certain use cases will pass in zero in the new_clocks parameter for all
clocks. This results in a divide-by-zero error when attempting to round
up the new clock.

When new_clocks are zero, no rounding is required, so we can skip it.

[How]
Guard the division calculation with a check to make sure clocks are not
zero.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: George Shen <george.shen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c