drm/amd/display: Round KHz up when calculating clock requests
authorAric Cyr <aric.cyr@amd.com>
Mon, 21 Jun 2021 16:01:45 +0000 (12:01 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 8 Jul 2021 19:16:44 +0000 (15:16 -0400)
commitbabbdf5b3a8b7c4f5e169a7a3300d2a743c10ac6
tree4cd9978ba35f8ecf5c430b40084160a4831ed3f8
parentcc590fd27190fec00bf9ccc4e349146394e7fa87
drm/amd/display: Round KHz up when calculating clock requests

[Why]
When requesting clocks from SMU which takes MHz inputs, DC will round
down KHz when converting to MHz, thus potentially requesting too low a
clock value.

[How]
Round up (ceil) when converting KHz to MHz for clock requests to SMU.

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/dcn301_smu.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h