Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp175244lqo; Tue, 7 May 2024 16:43:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1kxXe3ECXJv7Yt6RQiIuo0LuX22u1dmnY8AT+0GfZv0CLfOHEcLuAgsT31KyqTHNGlOwjhvfIAQOSJCXdBFjmwpXENf9lIYJoPKifrw== X-Google-Smtp-Source: AGHT+IF3g0AHvIPSqC/AZ3SFIlEecVFkJozmZuT0P5VlX3mRfSwwSBbwLyOOcZpbiTxQ0uQYllMo X-Received: by 2002:a17:90a:d592:b0:2ae:7224:aaf8 with SMTP id 98e67ed59e1d1-2b6169e1905mr938424a91.30.1715125400568; Tue, 07 May 2024 16:43:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715125400; cv=pass; d=google.com; s=arc-20160816; b=it4f8WgJz+87IBRDmy8rzkVRxiTiL58BJ9u06RPr2AEHx8jPyfVSU7oR3BA4hYusU0 8hZjEBDSNUOdMpy2DY57bUuSvofurtMKjwezRSICimWqmIL2uRjK3+QclDpikp+SNQAO Qg6GT65KSkpiZaJsniyjRbN2YP5IZUNUGVXJT39gKLadwMzZNdFTJVRy3jMyFYnqZNUd 50YwpEcVX8ImyX6UQHeNvJ0rdOqkxHAwXTgrBd0wtZZkMmXi9ELphlwv/5ojD70VP5d6 IB0FYG7zFmXnMgbK2x9P0CwSqeTncl6tDkrnPYaJgIPXs31AcL0JxwS2To8bNL2tpQc/ lgDg== 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=Z3zn0cc3Xcv1K864TWkbwKEMSNgBn4NKjgqyFHWoV6g=; fh=0tuDEXItRPnaneMK97jESGNGTCbaSiG+Go8E3dF2S4U=; b=Jpwtmq9OVGFrg+YmTuyBtceJC1BT9yTaZp4f3Xxbda1eQXXz/u7YtwtSyPQtB6C42H YfYQ+MAYJ+V57dbR49hRuiHn0+d4qgYxbGVfNh+9t6ZJPAyw6mg0GYC4Suinh3SXb4ry 56SSvwX9NJNl5HvTk2oAXAD/AdrMHlaB0jnmImfZRK4FBLShZ+LdmSUnmeSJZkdyzdq5 fN0Duk++RUKk0Cki9I9AqJdKNNKPJRNkF/cP3rqZWD12cBf8HxOdvxamujiQMAJjjinP 6cLpko9YEyQ5pWllHM1sfcFv4193C/iLpFOonr7Ubz41g+zQDyndwXkKRJfpv/n9yeOc VZAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EyCT3krR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172426-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172426-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 98e67ed59e1d1-2b6288696aasi147049a91.37.2024.05.07.16.43.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:43:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172426-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=EyCT3krR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172426-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172426-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 BC2D6287453 for ; Tue, 7 May 2024 23:41:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F10F613792E; Tue, 7 May 2024 23:11:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EyCT3krR" 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 25421137914; Tue, 7 May 2024 23:11:40 +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=1715123500; cv=none; b=uUx8ixGI/z7oqEsGA92HB89JOzTTcSMrfbKInVE/8y5+RYks0pCKcA6qU44p6Ec+ybgalJjm5cK+wCf0A3XhehiQawcOUX/UDf8KRVUl2K5ZnDu0lwFpMVt0s5dwfCfGH+WddcXnrNVfUlwebOF0+bN4Ubx18Sxv9czRfaRhgao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123500; c=relaxed/simple; bh=qsBXv4eT55IdMwxy9x8mbzOnTPPBcW0txYfRfwsRTOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jQydAltV4qkUKSjnfYkA7PdYEb/JIVMZjJsZKGiF1NW5hmcEHk+V4Wc/sKvGdkG72KkLXgCwARjksZ2ZEDrVBd82/Mp1NawqVVzbyArqOe3l6TuVA6eGe3zBd63+LCVZHMg19QeAk3TgTDY7ST7sCPxjjIxW8B/I8SssyPXf5Fo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EyCT3krR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 181BCC4AF67; Tue, 7 May 2024 23:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123500; bh=qsBXv4eT55IdMwxy9x8mbzOnTPPBcW0txYfRfwsRTOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EyCT3krRBcjEArWrZezMU/H2izaznw9fMViBMbqa4Hsa1h82NiFNhSYiwvbcxr987 USBQn2fFaiis2hisxgZBXHhy4PZ1Ilw6UNgNq7QUEM3mtxrMirpD37mfx1BHzxImPw zWWgqUah38uit4kB1gDRLZKjBYkrO8mdZnPFA9vhLI0yGGJxncElMVG/EkKTO6dehK nEFrN2SkVWUK/dw9gdQEWD3fjiD61RVFV6mwCKyDxOb5aLP/lRrZsxwB0OLttRmETk J6JmS1cDaMzcB3DlscZdJ6V0wN6XcsuWBdfZXCVeoEKANBA7nUpNlay3y8+wRdSl0Y U7Ox2RustXWHg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Meenakshikumar Somasundaram , PeiChen Huang , Aurabindo Pillai , Daniel Wheeler , 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, srinivasan.shanmugam@amd.com, nathan@kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.6 31/43] drm/amd/display: Allocate zero bw after bw alloc enable Date: Tue, 7 May 2024 19:09:52 -0400 Message-ID: <20240507231033.393285-31-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507231033.393285-1-sashal@kernel.org> References: <20240507231033.393285-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.6.30 Content-Transfer-Encoding: 8bit From: Meenakshikumar Somasundaram [ Upstream commit 46fe9cb1a9e62f4e6229f48ae303ef8e6c1fdc64 ] [Why] During DP tunnel creation, CM preallocates BW and reduces estimated BW of other DPIA. CM release preallocation only when allocation is complete. Display mode validation logic validates timings based on bw available per host router. In multi display setup, this causes bw allocation failure when allocation greater than estimated bw. [How] Do zero alloc to make the CM to release preallocation and update estimated BW correctly for all DPIAs per host router. Reviewed-by: PeiChen Huang Acked-by: Aurabindo Pillai Signed-off-by: Meenakshikumar Somasundaram Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../amd/display/dc/link/protocols/link_dp_dpia_bw.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c index 5491b707cec88..5a965c26bf209 100644 --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c @@ -270,7 +270,7 @@ static void set_usb4_req_bw_req(struct dc_link *link, int req_bw) /* Error check whether requested and allocated are equal */ req_bw = requested_bw * (Kbps_TO_Gbps / link->dpia_bw_alloc_config.bw_granularity); - if (req_bw == link->dpia_bw_alloc_config.allocated_bw) { + if (req_bw && (req_bw == link->dpia_bw_alloc_config.allocated_bw)) { DC_LOG_ERROR("%s: Request bw equals to allocated bw for link(%d)\n", __func__, link->link_index); } @@ -341,6 +341,14 @@ bool link_dp_dpia_set_dptx_usb4_bw_alloc_support(struct dc_link *link) ret = true; init_usb4_bw_struct(link); link->dpia_bw_alloc_config.bw_alloc_enabled = true; + + /* + * During DP tunnel creation, CM preallocates BW and reduces estimated BW of other + * DPIA. CM release preallocation only when allocation is complete. Do zero alloc + * to make the CM to release preallocation and update estimated BW correctly for + * all DPIAs per host router + */ + link_dp_dpia_allocate_usb4_bandwidth_for_stream(link, 0); } } -- 2.43.0