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 5AD5CC47DAF for ; Mon, 22 Jan 2024 14:57:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4D6310F276; Mon, 22 Jan 2024 14:57:54 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD64A10F277; Mon, 22 Jan 2024 14:57:53 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 77589B80E77; Mon, 22 Jan 2024 14:57:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F6ABC43394; Mon, 22 Jan 2024 14:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935471; bh=WXssKxsGBsR/yKY6ti/K+rL0PFBq1lOYw7LKaLLK+1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OxG3Iup2OvZbewgNU4jdbFb2lEU2qzV/5hnHF9sHly2BbZNBaBxvZM7GwaoM8supu 43t+hYRwg4EBpujiH4HwQKsiRDA/kk1U2jIdEbl7tHXteizpvdVKFxYn6UtMloruBz +BFS7qcUD1U8BK5DHZuohn/KK8COML7zkbYsftRMyuiFKmfKO2i54yNfWB+4AoT48k 9Lq8dgCG5XYiKvaJizwtHQhFrGwpXElnAb+aRL3qcQPDTGzPsxZ08HSbsY2u2UUZsw aRHWfBvsm5MQkmqc6bXmrZxyOwjSAswVQegZtMdAf3hu9ND1DjmV8uaxlRpIxD2kP/ KglYN5JzL8riw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.7 22/88] drm/amd/display: Fix writeback_info never got updated Date: Mon, 22 Jan 2024 09:50:55 -0500 Message-ID: <20240122145608.990137-22-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> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 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, Daniel Wheeler , 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 c09919e6ea5fefd49d8b7b54aa5b222937163108 ] [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. Tested-by: Daniel Wheeler 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 4bdf105d1d71..5055af147c20 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -490,18 +490,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