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 60748C47DAF for ; Mon, 22 Jan 2024 15:05:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED2A610F30E; Mon, 22 Jan 2024 15:05:26 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F3C710F30E; Mon, 22 Jan 2024 15:05:25 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 2E5BFB80E77; Mon, 22 Jan 2024 15:05:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C80D7C43394; Mon, 22 Jan 2024 15:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935923; bh=MjgvzQoYIT5tBm6Pw3QBsMi9YbSr4rTJjeC1r6LJDLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ahZR+xRJGgP11hSXng54cxi0GBoiI+wZqf5aoiL5syvKZZfBvbwXs6IvCD5aQjJ2A PZHvYQEtlNIgc3wnDyHjGaQz4ZR51MG4VxLyB3wCbrgjkNHbKqFKNRpB9R6kjTlNLM RP/lbfMd1hQXiDeM+2LNm4CwI+LEKdsL+SVLaRQOEv0z8hOYbgccxqSMe6O+f3rvem +w7EPxZixHEu0niX4FgrRmb2M9qqL67ua2LK/JdDDvoY0usPqZJ4Y7FA21B6bLR/BO qI157O/iOGUOYSQJ8G6fC4vjiMq1OWcOxPqy5l9h/qY4xtbGi7Kv/QvxG3eMMJ4WT2 FNXb+/sMSoHlw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 16/73] drm/amd/display: Fix writeback_info never got updated Date: Mon, 22 Jan 2024 10:01:30 -0500 Message-ID: <20240122150432.992458-16-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122150432.992458-1-sashal@kernel.org> References: <20240122150432.992458-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.13 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 ebe571fcefe3..c232d38e70ae 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -539,18 +539,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 (j < i) /* trim the array */ memcpy(&stream->writeback_info[j], &stream->writeback_info[i], -- 2.43.0