From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35296C47DD9 for ; Mon, 22 Jan 2024 15:13:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE49B10F3AA; Mon, 22 Jan 2024 15:13:31 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id C78B710F3AA; Mon, 22 Jan 2024 15:13:30 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 67D8AB80E68; Mon, 22 Jan 2024 15:13:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41902C43390; Mon, 22 Jan 2024 15:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705936408; bh=pcNuVs4hs4tO9XuJJi8Usm+s98V3K4PNGoABx/m+dVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gTPQJqRXeZR9iA+McgvP5/Lz1BZj4s8rppGQttVq6FmxZn2AUGBhCt/a/xjvqxd8O gYC/YgpU104JC3XkSsnetHJv7iIyDqLhvBLiz4oH9WiTXJ0GyAFmn1xUklTg1zBTZ3 zhqpGgo1q71F0bcHVRP7GOjwJjV3i8eKmn4Ce5DbskWIw572umdXdOgGBwmyg4juAr nQtiunCF1PbrPcfycT+BheCHdqLeIvobMNZIws3Jp8RWTDihj0dJ2DSdRG/mUC4FL1 KApOv58iPE0+k/PgWwXtox3nSl2UAi60om1WVSjhZa2SkG7TodMYJUtKH1hkeHX2zZ cuaUS/g8+0how== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 09/35] drm/amd/display: Fix writeback_info never got updated Date: Mon, 22 Jan 2024 10:12:06 -0500 Message-ID: <20240122151302.995456-9-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122151302.995456-1-sashal@kernel.org> References: <20240122151302.995456-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.147 Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , dillon.varone@amd.com, dri-devel@lists.freedesktop.org, Alex Hung , airlied@gmail.com, qingqing.zhuo@amd.com, Xinhui.Pan@amd.com, Rodrigo.Siqueira@amd.com, amd-gfx@lists.freedesktop.org, sunpeng.li@amd.com, aurabindo.pillai@amd.com, alvin.lee2@amd.com, daniel@ffwll.ch, Alex Deucher , jun.lei@amd.com, Harry Wentland , christian.koenig@amd.com Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" From: Alex Hung [ Upstream commit 8a307777c36e15f38c9f23778babcd368144c7d8 ] [WHY] wb_enabled field is set to false before it is used, and the following code will never be executed. [HOW] Setting wb_enable to false after all removal work is completed. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c index 5dd57cf170f5..b7b72fc2cb37 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -509,18 +509,13 @@ bool dc_stream_remove_writeback(struct dc *dc, return false; } -// stream->writeback_info[dwb_pipe_inst].wb_enabled = false; - for (i = 0; i < stream->num_wb_info; i++) { - /*dynamic update*/ - if (stream->writeback_info[i].wb_enabled && - stream->writeback_info[i].dwb_pipe_inst == dwb_pipe_inst) { - stream->writeback_info[i].wb_enabled = false; - } - } - /* remove writeback info for disabled writeback pipes from stream */ for (i = 0, j = 0; i < stream->num_wb_info; i++) { if (stream->writeback_info[i].wb_enabled) { + + if (stream->writeback_info[i].dwb_pipe_inst == dwb_pipe_inst) + stream->writeback_info[i].wb_enabled = false; + if (i != j) /* trim the array */ stream->writeback_info[j] = stream->writeback_info[i]; -- 2.43.0