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 F34E1C47DD9 for ; Mon, 22 Jan 2024 15:06:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61C9D10F31F; Mon, 22 Jan 2024 15:06:01 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2FBD510F318; Mon, 22 Jan 2024 15:06:00 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 6B324B80E77; Mon, 22 Jan 2024 15:05:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7C17C43394; Mon, 22 Jan 2024 15:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935927; bh=z9yFUwVMGr6KTvDqeyh995QcZ2urdt0fl6Xd/4eXJmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pABwJY5hfXFkcFFicK9wF1JV5BzUAozzzpoy3KWO34N6b0zdwqfRujsiDTQnH5hCn q+vpFB4CmdA4ApjP+WvPef0cFvHXtccIWJLSivpF4rav36i47S/LNbBKZ6x4X7iusd FLN7yRQcudz5L7Oo3G7wa2SD2OHtBk0kc8osrqPpY99e3Dh0JBpQMJ0YRzcFW32OVK in11jGDXiUhRchhUYBW4tfV9+5tLrITD+WqTZ8l4bdkIoF4EsOFqT778Zoon17QKqT 8HDO3C8PRxDBT9nfDGTpm5CfCCoFhBMDiK0OFa+dSusgZ9rHmcflvwqhuB4aLaaXhA yzcrsIuS5ZK4A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 17/73] drm/amd/display: Fix writeback_info is not removed Date: Mon, 22 Jan 2024 10:01:31 -0500 Message-ID: <20240122150432.992458-17-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 5b89d2ccc8466e0445a4994cb288fc009b565de5 ] [WHY] Counter j was not updated to present the num of writeback_info when writeback pipes are removed. [HOW] update j (num of writeback info) under the correct condition. 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 c232d38e70ae..79f3d7648eb7 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -546,11 +546,12 @@ bool dc_stream_remove_writeback(struct dc *dc, if (stream->writeback_info[i].dwb_pipe_inst == dwb_pipe_inst) stream->writeback_info[i].wb_enabled = false; - if (j < i) - /* trim the array */ + /* trim the array */ + if (j < i) { memcpy(&stream->writeback_info[j], &stream->writeback_info[i], sizeof(struct dc_writeback_info)); - j++; + j++; + } } } stream->num_wb_info = j; -- 2.43.0