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 70DD037C739; Mon, 5 May 2025 22:59:39 +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=1746485980; cv=none; b=ll9kr26kV/7/dv4XXLEdnwHhYDgWtuoHWWrOppHJV6p9cNHlrHHq3u4CnbkuTXWFkqCzROZDebzlTZ9C53pFHBNgDmPuxqsa7aOAfG6GnkdBmCrdQ8cx1/GQhxAaCdo1ceFWan5Dhzp7Lb9xP2gf0MVofYPO8H7bpMmBd+kH4bw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746485980; c=relaxed/simple; bh=TghLYy3tw75un8ZZnDmu4bdbeNos3GdnefPwQ3e2oz0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GUYirekb4pHjziOz72n9dkiH4n+M3GJ7sBmq8q2tbRUqVXHaBQMFw0PWbq+HgTyDccb0Z2ed32K9QvGgynjPoT7RebbuBWKTe5lbSC4atUr7NyVzWfEm46d4bdbIr9+nUL3EhlGXvGQr1oZbTqY8cU6S7B1GaCSD7KO0G/dXmRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=akuCe4FU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="akuCe4FU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEBAEC4CEEF; Mon, 5 May 2025 22:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746485979; bh=TghLYy3tw75un8ZZnDmu4bdbeNos3GdnefPwQ3e2oz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=akuCe4FUYlB+C5oqvT7rFmfxfsIoHokPyrM16jRUmP/KiM1VlrThz8FVtCEhLlGkD KWFQ6KVe82ithGGRzmalFtNVT4dR35MFJFtSNNg6i49oWf5XEVnoXgc8/Aj62EMbsL z81B3+/93llw8nJSsFJ0XscKxAVBu2bmK0F8maBck7BTyTL4xZwFOm81jV1vHtS+DW PoYJ3S2MqmUSWYAMZKPN4hZiMKYUI1R7EhC+jCActmI+TdqB9au5B7DlJ5O/Ls5+vA uLrLLqu6j3ZCFX/ZatR39y+7mRftxBYTRzS8w8A6xiDzN0BYqbcnrsESB4iSjtXcZu LJXxAolgz2Hgw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Leon Huang , Robin Chen , Tom Chung , Daniel Wheeler , Alex Deucher , Sasha Levin , harry.wentland@amd.com, sunpeng.li@amd.com, christian.koenig@amd.com, airlied@gmail.com, simona@ffwll.ch, wenjing.liu@amd.com, Kaitlyn.Tse@amd.com, anthony.koo@amd.com, jerry.zuo@amd.com, joshua.aberback@amd.com, jack.chang@amd.com, muyuan.yang@amd.com, Sungjoon.Kim@amd.com, michael.strauss@amd.com, xi.liu@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.6 095/294] drm/amd/display: Fix incorrect DPCD configs while Replay/PSR switch Date: Mon, 5 May 2025 18:53:15 -0400 Message-Id: <20250505225634.2688578-95-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250505225634.2688578-1-sashal@kernel.org> References: <20250505225634.2688578-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.89 Content-Transfer-Encoding: 8bit From: Leon Huang [ Upstream commit 0d9cabc8f591ea1cd97c071b853b75b155c13259 ] [Why] When switching between PSR/Replay, the DPCD config of previous mode is not cleared, resulting in unexpected behavior in TCON. [How] Initialize the DPCD in setup function Reviewed-by: Robin Chen Signed-off-by: Leon Huang Signed-off-by: Tom Chung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../link/protocols/link_edp_panel_control.c | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c index 13104d000b9e0..d4d92da153ece 100644 --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c @@ -662,6 +662,18 @@ bool edp_setup_psr(struct dc_link *link, if (!link) return false; + //Clear PSR cfg + memset(&psr_configuration, 0, sizeof(psr_configuration)); + dm_helpers_dp_write_dpcd( + link->ctx, + link, + DP_PSR_EN_CFG, + &psr_configuration.raw, + sizeof(psr_configuration.raw)); + + if (link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED) + return false; + dc = link->ctx->dc; dmcu = dc->res_pool->dmcu; psr = dc->res_pool->psr; @@ -672,9 +684,6 @@ bool edp_setup_psr(struct dc_link *link, if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst)) return false; - - memset(&psr_configuration, 0, sizeof(psr_configuration)); - psr_configuration.bits.ENABLE = 1; psr_configuration.bits.CRC_VERIFICATION = 1; psr_configuration.bits.FRAME_CAPTURE_INDICATION = @@ -938,6 +947,16 @@ bool edp_setup_replay(struct dc_link *link, const struct dc_stream_state *stream if (!link) return false; + //Clear Replay config + dm_helpers_dp_write_dpcd(link->ctx, link, + DP_SINK_PR_ENABLE_AND_CONFIGURATION, + (uint8_t *)&(replay_config.raw), sizeof(uint8_t)); + + if (!(link->replay_settings.config.replay_supported)) + return false; + + link->replay_settings.config.replay_error_status.raw = 0; + dc = link->ctx->dc; replay = dc->res_pool->replay; -- 2.39.5