Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp385696rdb; Mon, 22 Jan 2024 07:15:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6057hm8B0YV6Ts9MzTqrpStjFR2+FwwjKwk8zIGSsQX50b3ww8e8UR0iULPH8z2/Tchdf X-Received: by 2002:a17:902:a616:b0:1d6:ea14:820a with SMTP id u22-20020a170902a61600b001d6ea14820amr1871574plq.94.1705936547931; Mon, 22 Jan 2024 07:15:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705936547; cv=pass; d=google.com; s=arc-20160816; b=ji8mTd4urM52eyFWgSdkN7j+TlZtYHJVbtlmNJY953d2eUS2xS03ztphEgU2brKCT6 DKxH94+1cxrXcoUDItQ14Vp0XoDDTpLXEREiZ2WIKdgcZgfjiHV5KZq/0n9mdA+L3itt MDF05RPCds6kQj3mW+l44o0ziHuW6truh9Q8OXBec3jE1ihfwZtSNKQbwLiSOgzyAKQH ZML/nfbzOBqbs8etzoP4sT+u+EphqBr6Cp8MeCreCm2sD5kTRThT3bA9gme+mOAuimCh jmap3waXaJ2iF2/DlbSVdDPG94zySyJqblnvxXlyLXiPtIJlHiASDlEOaqyctx5LGzDq A2Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=DpSP6EdFoUelaT8djt7vcR/i2enMLmKgRoQ9PLReUcA=; fh=rD+HJSvJv2KzqkjBO5BGLQb13Z9ebhiD0oEGBYBOKjU=; b=thnNzmR4KHO5VqzJBeEoDgl7/IfQ+5QrAO/ZyhhHD8D3x53oSOMD0k8+ig30skA2Ly 8V5cyhVtAXx0ZuPsaNsTuqPy0rcM8gUO4/Xg/nziB8MMHqPaFwVbBL/kZjAm3M5mKx9V GdDi4riIztRO+npjsbhXopdfoA8RGlsHu5zmnVO/GrgWf5jVCL8m8lFvDOXHJQ4VWL32 AcJuVHoe0rOmuaB6+0OojnmcMTO6vpF5DH2iCcQ/bu5bWz85s9DLFkaV+lJmCb2GfYEX J6PE+VsinqXPh+RgxHgWtMgtxzQWygZd6haMphYOvFjB5SMvFl/d4OCy3mX9nRi9YvPq oSug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kCkhfHTR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33232-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33232-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k14-20020a170902c40e00b001cf5c99a61csi8405004plk.180.2024.01.22.07.15.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:15:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33232-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kCkhfHTR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33232-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33232-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 13E12283750 for ; Mon, 22 Jan 2024 15:08:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3B4D3D960; Mon, 22 Jan 2024 14:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kCkhfHTR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BE694BAA5; Mon, 22 Jan 2024 14:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935432; cv=none; b=ugNuy2ZneyCfXViDVeThYWmhURnuyFS6Bhbf2cJFxVEIrJIE5jDAOMnBPVZ4yd42XTJftPYZqFx2wY6hak+NR2nLdWBkvJZD9xacIyfKc7EbCfY4DQAh7cvvd76gUg0w89VAdIwAvX11fGx98muRwoRMZaDbj9ZYQwxbx3yiev4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935432; c=relaxed/simple; bh=nfxEFGF3+T5BIAC6cZV5dCtwBWqySTxUjhchMOcDXfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=au0tNQfeMFvmiIRIkHqPTTzxuto3ykGFvHqFXxTe0262RnW2rKt+PBkd99mE309xExkoIjjZnhEZIF74/GNVwinYcZCFtK+Bx44y/E99Q1oFjTdUP/lCFShGXgDtV3HoCRode7eBgYxgoPgPyapqLqKYQ2To1b5vRRDUja2PGYY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kCkhfHTR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5964AC433C7; Mon, 22 Jan 2024 14:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935431; bh=nfxEFGF3+T5BIAC6cZV5dCtwBWqySTxUjhchMOcDXfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kCkhfHTRC2kH2pXYz7KUztLa9tYufgibbhgryJFkGfltf6MD+dJ/sXxCpMvwx+1gd T3fIP32qlh9eL6BGF75S3kLvqTLjuuMtOY+2KbzRGETM8KRDABiuAXIPzqosZp2u/H IVz4jKfxUFC174F9TzVM1kse/Q+jsaemjL+G5WLP3/4+Vw8FzBP3Ff2ifvw3wV2Ald 3wIXeYncrQT+7HFzLD+3n6pY7JdYGL1WhbY8aRKrBvzyucU9HxH32sxgpU8NY/jvnl Bib2Qi5K52LH7Kj201n4fGFPD9qi9uRDwBnQ0erTTMNapW2bzpro2yVgooI0WHnhc0 LMeIDZaOU6Nfg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ilya Bakoulin , Daniel Wheeler , Wenjing Liu , Rodrigo Siqueira , Alex Deucher , Sasha Levin , harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, Qingqing.Zhuo@amd.com, jun.lei@amd.com, hamza.mahfooz@amd.com, camille.cho@amd.com, jiapeng.chong@linux.alibaba.com, peichen.huang@amd.com, wayne.lin@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.7 18/88] drm/amd/display: Fix MST PBN/X.Y value calculations Date: Mon, 22 Jan 2024 09:50:51 -0500 Message-ID: <20240122145608.990137-18-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit From: Ilya Bakoulin [ Upstream commit 94bbf802efd0a8f13147d6664af6e653637340a8 ] 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: Daniel Wheeler Reviewed-by: Wenjing Liu Acked-by: Rodrigo Siqueira Signed-off-by: Ilya Bakoulin Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c index f8e01ca09d96..a3b3aec05d6b 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c @@ -1057,18 +1057,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); -- 2.43.0