From mboxrd@z Thu Jan 1 00:00:00 1970 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 5AD7519752E; Thu, 6 Jun 2024 14:12:26 +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=1717683146; cv=none; b=nDiloobu24C+w7/iEwUE4Y+Vegknhx4HdXXSsPvq6+3Oo+DAPhHouqWwCjDFnS9ObO7L7YxrhJiu9uhMPUvxWwjtsage2DLfUJcyO95huUpQmE59Gn+TfW2ukQAccX0LLIdGdYjD/UwE6BJH4SRcEfNeNbvVnWKaQzHd2HdOnRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683146; c=relaxed/simple; bh=YhvRRrc+uXgnPyzVzPL4B+w/FS68uDAd5aOEdkaEoBY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=stT7IVsz3boTCwjLSoaluok0UUStntZ7iLA5iFy25+TvvNoq0b0UrVEcodsadcB1iyBbV63hPnyTrcqGwHg9LqtcnWdDhmGXqBUGcMds+Euchk8L1sPqKYrL+pWHNLfjmb8yAxl3VVN1j2IdkElHOUvWM2ZDDUaO8Oe8pk/PZWk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RdkRUweF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RdkRUweF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C926C2BD10; Thu, 6 Jun 2024 14:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717683146; bh=YhvRRrc+uXgnPyzVzPL4B+w/FS68uDAd5aOEdkaEoBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RdkRUweFUMt6LA51AfvBlNA0O46Q3SOu6tZfc6sc4LXxw/CRrufgQlcctDqUj0mmA nWW/GZHlKwveYs99R3fyoL4qPv7E9iLzO8z7i84JB5ET7DD5DCjLSzwl7eDJqk7I4C foYV1V4IbCnRgLUvHvw6KJp+QXesSwFUdXbJIznE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, PeiChen Huang , Aurabindo Pillai , Meenakshikumar Somasundaram , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 6.6 078/744] drm/amd/display: Allocate zero bw after bw alloc enable Date: Thu, 6 Jun 2024 15:55:50 +0200 Message-ID: <20240606131734.904848619@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606131732.440653204@linuxfoundation.org> References: <20240606131732.440653204@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ 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