From: jsg Date: Tue, 6 Feb 2024 03:14:23 +0000 (+0000) Subject: drm/amd/display: Fix MST PBN/X.Y value calculations X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1ad3b714919eade51a4d8c5b926be30b91cb0035;p=openbsd drm/amd/display: Fix MST PBN/X.Y value calculations From Ilya Bakoulin 01e7578c7cd3d8815fae130ac74b1303c056bd2d in linux-6.6.y/6.6.16 94bbf802efd0a8f13147d6664af6e653637340a8 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/dc/link/link_dpms.c b/sys/dev/pci/drm/amd/display/dc/link/link_dpms.c index 87a2f12aeb4..4450fbf788a 100644 --- a/sys/dev/pci/drm/amd/display/dc/link/link_dpms.c +++ b/sys/dev/pci/drm/amd/display/dc/link/link_dpms.c @@ -1059,18 +1059,21 @@ static struct fixed31_32 get_pbn_from_bw_in_kbps(uint64_t kbps) 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 * common multiplier to render an integer PBN for all link rate/lane * counts combinations * calculate - * peak_kbps *= (1006/1000) * peak_kbps *= (64/54) - * peak_kbps *= 8 convert to bytes + * peak_kbps /= (8 * 1000) convert to bytes */ - numerator = 64 * PEAK_FACTOR_X1000; - denominator = 54 * 8 * 1000 * 1000; + numerator = 64; + denominator = 54 * 8 * 1000; kbps *= numerator; peak_kbps = dc_fixpt_from_fraction(kbps, denominator);