Commit 94bbf802 authored by Ilya Bakoulin's avatar Ilya Bakoulin Committed by Alex Deucher

drm/amd/display: Fix MST PBN/X.Y value calculations

Changing PBN calculation to be more in line with spec. We don't need to
inflate PBN_NATIVE value by the 1.006 margin, since that is already
taken care of in the get_pbn_per_slot function.
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Acked-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: default avatarIlya Bakoulin <ilya.bakoulin@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 23cf5a5c
...@@ -1057,18 +1057,21 @@ static struct fixed31_32 get_pbn_from_bw_in_kbps(uint64_t kbps) ...@@ -1057,18 +1057,21 @@ static struct fixed31_32 get_pbn_from_bw_in_kbps(uint64_t kbps)
uint32_t denominator = 1; uint32_t denominator = 1;
/* /*
* margin 5300ppm + 300ppm ~ 0.6% as per spec, factor is 1.006 * The 1.006 factor (margin 5300ppm + 300ppm ~ 0.6% as per spec) is not
* required when determining PBN/time slot utilization on the link between
* us and the branch, since that overhead is already accounted for in
* the get_pbn_per_slot function.
*
* The unit of 54/64Mbytes/sec is an arbitrary unit chosen based on * The unit of 54/64Mbytes/sec is an arbitrary unit chosen based on
* common multiplier to render an integer PBN for all link rate/lane * common multiplier to render an integer PBN for all link rate/lane
* counts combinations * counts combinations
* calculate * calculate
* peak_kbps *= (1006/1000)
* peak_kbps *= (64/54) * peak_kbps *= (64/54)
* peak_kbps *= 8 convert to bytes * peak_kbps /= (8 * 1000) convert to bytes
*/ */
numerator = 64 * PEAK_FACTOR_X1000; numerator = 64;
denominator = 54 * 8 * 1000 * 1000; denominator = 54 * 8 * 1000;
kbps *= numerator; kbps *= numerator;
peak_kbps = dc_fixpt_from_fraction(kbps, denominator); peak_kbps = dc_fixpt_from_fraction(kbps, denominator);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment