All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Zhang <dingchen.zhang@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: stylon.wang@amd.com, Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
	qingqing.zhuo@amd.com, Rodrigo.Siqueira@amd.com,
	roman.li@amd.com, solomon.chiu@amd.com, jerry.zuo@amd.com,
	Aurabindo.Pillai@amd.com, wayne.lin@amd.com,
	Bhawanpreet.Lakha@amd.com, agustin.gutierrez@amd.com,
	pavle.kotarac@amd.com
Subject: [PATCH 06/17] drm/amd/display: program PSR2 DPCD Configuration
Date: Thu, 5 May 2022 10:23:12 -0400	[thread overview]
Message-ID: <20220505142323.2566949-7-dingchen.zhang@amd.com> (raw)
In-Reply-To: <20220505142323.2566949-1-dingchen.zhang@amd.com>

[Why]
To support PSR2 Source DPCD configuration

[How]
Update the PSR2 Source DPCD settings while the PSR2 enabled

Signed-off-by: David Zhang <dingchen.zhang@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 23 ++++++++++++++++++-
 .../drm/amd/display/dc/inc/hw/link_encoder.h  | 13 ++++++++++-
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 3d13ee32a3db..b1811eb7609f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -3181,6 +3181,7 @@ bool dc_link_setup_psr(struct dc_link *link,
 	unsigned int panel_inst;
 	/* updateSinkPsrDpcdConfig*/
 	union dpcd_psr_configuration psr_configuration;
+	union dpcd_alpm_configuration alpm_configuration;
 
 	psr_context->controllerId = CONTROLLER_ID_UNDEFINED;
 
@@ -3206,7 +3207,7 @@ bool dc_link_setup_psr(struct dc_link *link,
 			psr_config->psr_frame_capture_indication_req;
 
 	/* Check for PSR v2*/
-	if (psr_config->psr_version == 0x2) {
+	if (link->psr_settings.psr_version == DC_PSR_VERSION_SU_1) {
 		/* For PSR v2 selective update.
 		 * Indicates whether sink should start capturing
 		 * immediately following active scan line,
@@ -3217,6 +3218,14 @@ bool dc_link_setup_psr(struct dc_link *link,
 		 * IRQ_HPD when CRC mismatch is detected.
 		 */
 		psr_configuration.bits.IRQ_HPD_WITH_CRC_ERROR    = 1;
+		/* For PSR v2, set the bit when the Source device will
+		 * be enabling PSR2 operation.
+		 */
+		psr_configuration.bits.ENABLE_PSR2    = 1;
+		/* For PSR v2, the Sink device must be able to receive
+		 * SU region updates early in the frame time.
+		 */
+		psr_configuration.bits.EARLY_TRANSPORT_ENABLE    = 1;
 	}
 
 	dm_helpers_dp_write_dpcd(
@@ -3226,6 +3235,18 @@ bool dc_link_setup_psr(struct dc_link *link,
 		&psr_configuration.raw,
 		sizeof(psr_configuration.raw));
 
+	if (link->psr_settings.psr_version == DC_PSR_VERSION_SU_1) {
+		memset(&alpm_configuration, 0, sizeof(alpm_configuration));
+
+		alpm_configuration.bits.ENABLE = 1;
+		dm_helpers_dp_write_dpcd(
+			link->ctx,
+			link,
+			DP_RECEIVER_ALPM_CONFIG,
+			&alpm_configuration.raw,
+			sizeof(alpm_configuration.raw));
+	}
+
 	psr_context->channel = link->ddc->ddc_pin->hw_info.ddc_channel;
 	psr_context->transmitterId = link->link_enc->transmitter;
 	psr_context->engineId = link->link_enc->preferred_engine;
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h b/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
index 2013a70603ae..66132f3cac42 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
@@ -85,7 +85,18 @@ union dpcd_psr_configuration {
 		unsigned char LINE_CAPTURE_INDICATION   : 1;
 		/* For eDP 1.4, PSR v2*/
 		unsigned char IRQ_HPD_WITH_CRC_ERROR    : 1;
-		unsigned char RESERVED                  : 2;
+		unsigned char ENABLE_PSR2               : 1;
+		/* For eDP 1.5, PSR v2 w/ early transport */
+		unsigned char EARLY_TRANSPORT_ENABLE    : 1;
+	} bits;
+	unsigned char raw;
+};
+
+union dpcd_alpm_configuration {
+	struct {
+		unsigned char ENABLE                    : 1;
+		unsigned char IRQ_HPD_ENABLE            : 1;
+		unsigned char RESERVED                  : 6;
 	} bits;
 	unsigned char raw;
 };
-- 
2.25.1


  parent reply	other threads:[~2022-05-05 14:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 14:23 [PATCH 00/17] enable PSR-SU MPO for amdpgu David Zhang
2022-05-05 14:23 ` [PATCH 01/17] drm/amd/display: align dmub cmd header to latest dmub FW to support PSR-SU David Zhang
2022-05-05 14:23 ` [PATCH 02/17] drm/amd/display: feed PSR-SU as psr version to dmub FW David Zhang
2022-05-05 14:23 ` [PATCH 03/17] drm/amd/display: combine dirty rectangles in DMUB FW David Zhang
2022-05-09  8:12   ` VURDIGERENATARAJ, CHANDAN
2022-05-09 13:41     ` Zhang, Dingchen (David)
2022-05-05 14:23 ` [PATCH 04/17] drm/amd/display: update GSP1 generic info packet for PSRSU David Zhang
2022-05-05 14:23 ` [PATCH 05/17] drm/amd/display: revise Start/End SDP data David Zhang
2022-05-09  8:26   ` VURDIGERENATARAJ, CHANDAN
2022-05-09 14:02     ` Zhang, Dingchen (David)
2022-05-05 14:23 ` David Zhang [this message]
2022-05-05 14:23 ` [PATCH 07/17] drm/amd/display: Passing Y-granularity to dmub fw David Zhang
2022-05-05 14:23 ` [PATCH 08/17] drm/amd/display: Set default value of line_capture_indication David Zhang
2022-05-05 14:23 ` [PATCH 09/17] drm/amd/display: add vline time in micro sec to PSR context David Zhang
2022-05-05 14:23 ` [PATCH 10/17] drm/amd/display: fix system hang when PSR exits David Zhang
2022-05-05 14:23 ` [PATCH 11/17] drm/amd/display: Set PSR level to enable ALPM by default David Zhang
2022-05-05 14:23 ` [PATCH 12/17] drm/amd/display: use HW lock mgr for PSR-SU David Zhang
2022-05-05 14:23 ` [PATCH 13/17] drm/amd/display: PSRSU+DSC WA for specific TCON David Zhang
2022-05-05 14:23 ` [PATCH 14/17] drm/amd/display: add shared helpers to update psr config fields to power module David Zhang
2022-05-09  8:42   ` VURDIGERENATARAJ, CHANDAN
2022-05-09 14:09     ` Zhang, Dingchen (David)
2022-05-05 14:23 ` [PATCH 15/17] drm/amd/display: calculate psr config settings in runtime in DM David Zhang
2022-05-05 14:23 ` [PATCH 16/17] drm/amd/display: update cursor position to DMUB FW David Zhang
2022-05-05 14:23 ` [PATCH 17/17] drm/amd/display: Implement MPO PSR SU David Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220505142323.2566949-7-dingchen.zhang@amd.com \
    --to=dingchen.zhang@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=agustin.gutierrez@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=jerry.zuo@amd.com \
    --cc=pavle.kotarac@amd.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=solomon.chiu@amd.com \
    --cc=stylon.wang@amd.com \
    --cc=wayne.lin@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.