drm/amd/display: Calculate link bandwidth in a common function
authorNikola Cornij <nikola.cornij@amd.com>
Tue, 19 Mar 2019 23:47:32 +0000 (19:47 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 22 Jun 2019 14:34:08 +0000 (09:34 -0500)
commitc2bcd914a2a7917442daf20a7b33d690f5903bea
tree39a2dc287053ccc8315d44ed4b60adc55d73a732
parentc5d3a38b1a18a0bcdfd4cc54e4396cce2aabc968
drm/amd/display: Calculate link bandwidth in a common function

[why]
Currently link bandwidth is calculated in various places using the same
multi-step formula. Doing this in one common place makes sure the same
formula will indeed be applied to all link bandwidth calculations.
It also makes it possible to apply link-setting-specific adjustments
that affect effective link bandwidth.

[how]
Replace all implementations of link bandwidth calculation with a call
to a function.

Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
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_dsc.c
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c