All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] June, 21, 2021
@ 2021-06-18 17:35 Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 01/12] drm/amd/display: Multiplane cursor position incorrect when plane rotated Bindu Ramamurthy
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Bindu Ramamurthy @ 2021-06-18 17:35 UTC (permalink / raw)
  To: amd-gfx
  Cc: Eryk.Brol, Sunpeng.Li, Harry.Wentland, Qingqing.Zhuo,
	Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai,
	Bhawanpreet.Lakha, bindu.r

This DC patchset brings improvements in multiple areas. In summary, we
highlight:

* DC 3.2.141
* Firmware release 0.0.71
* Improvements across LTTPR, edp initialization, DML calculations,
  VBIOS for dcn302 and dcn303 etc.

Anthony Koo (1):
  drm/amd/display: [FW Promotion] Release 0.0.71

Aric Cyr (2):
  drm/amd/display: Multiplane cursor position incorrect when plane
    rotated
  drm/amd/display: 3.2.141
  This version brings along following fixes:
	- FW release 0.0.71.
	- get socBB from VBIOS for dcn302 and dcn303.
	- refclk from MICROSECOND_TIME_BASE_DIV HW register.
	- Clear lane settings after LTTPRs have been trained.
	- Clamp VStartup value at DML calculations.

Aurabindo Pillai (1):
  drm/amd/display: get socBB from VBIOS for dcn302 and dcn303

Charlene Liu (1):
  drm/amd/display: get refclk from MICROSECOND_TIME_BASE_DIV HW register

Josip Pavic (1):
  drm/amd/display: do not compare integers of different widths

Martin Tsai (1):
  drm/amd/display: Clear lane settings after LTTPRs have been trained

Nikola Cornij (1):
  drm/amd/display: Clamp VStartup value at DML calculations time

Roman Li (1):
  drm/amd/display: Delay PSR entry

Stylon Wang (1):
  drm/amd/display: Revert "Guard ASSR with internal display flag"

Wesley Chalmers (1):
  drm/amd/display: Fix incorrect variable name

ollogush (1):
  drm/amd/display: Fix edp_bootup_bl_level initialization issue

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  2 +
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h |  3 +
 .../drm/amd/display/dc/bios/bios_parser2.c    |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |  2 +-
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 66 +++++---------
 .../drm/amd/display/dc/core/dc_link_dpcd.c    |  2 +-
 drivers/gpu/drm/amd/display/dc/dc.h           |  2 +-
 .../gpu/drm/amd/display/dc/dce/dce_i2c_hw.c   | 13 ++-
 .../gpu/drm/amd/display/dc/dce/dce_i2c_hw.h   |  3 +
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 15 +++-
 .../amd/display/dc/dcn302/dcn302_resource.c   | 20 +++++
 .../amd/display/dc/dcn303/dcn303_resource.c   | 20 +++++
 .../dc/dml/dcn31/display_mode_vba_31.c        |  4 +
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h   | 90 ++++++++++++++++++-
 15 files changed, 197 insertions(+), 57 deletions(-)

-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 01/12] drm/amd/display: Multiplane cursor position incorrect when plane rotated
  2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
@ 2021-06-18 17:35 ` Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 02/12] drm/amd/display: Clamp VStartup value at DML calculations time Bindu Ramamurthy
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Bindu Ramamurthy @ 2021-06-18 17:35 UTC (permalink / raw)
  To: amd-gfx
  Cc: Aric Cyr, Eryk.Brol, Sunpeng.Li, Harry.Wentland, Qingqing.Zhuo,
	Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai, Jun Lei,
	Bhawanpreet.Lakha, bindu.r

From: Aric Cyr <aric.cyr@amd.com>

[Why]
When video plane is rotate the cursor position is incorrect and not
matching the desktop location.

[How]
When a plane is rotated 90 or 270 degrees, the src_rect.width and height
should be swapped when determining the scaling factor compared to the
dst_rect.

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
---
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index 5d54900f7b61..c545eddabdcc 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -3245,10 +3245,17 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx)
 	 * about the actual size being incorrect, that's a limitation of
 	 * the hardware.
 	 */
-	x_pos = (x_pos - x_plane) * pipe_ctx->plane_state->src_rect.width /
-			pipe_ctx->plane_state->dst_rect.width;
-	y_pos = (y_pos - y_plane) * pipe_ctx->plane_state->src_rect.height /
-			pipe_ctx->plane_state->dst_rect.height;
+	if (param.rotation == ROTATION_ANGLE_90 || param.rotation == ROTATION_ANGLE_270) {
+		x_pos = (x_pos - x_plane) * pipe_ctx->plane_state->src_rect.height /
+				pipe_ctx->plane_state->dst_rect.width;
+		y_pos = (y_pos - y_plane) * pipe_ctx->plane_state->src_rect.width /
+				pipe_ctx->plane_state->dst_rect.height;
+	} else {
+		x_pos = (x_pos - x_plane) * pipe_ctx->plane_state->src_rect.width /
+				pipe_ctx->plane_state->dst_rect.width;
+		y_pos = (y_pos - y_plane) * pipe_ctx->plane_state->src_rect.height /
+				pipe_ctx->plane_state->dst_rect.height;
+	}
 
 	/**
 	 * If the cursor's source viewport is clipped then we need to
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 02/12] drm/amd/display: Clamp VStartup value at DML calculations time
  2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 01/12] drm/amd/display: Multiplane cursor position incorrect when plane rotated Bindu Ramamurthy
@ 2021-06-18 17:35 ` Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 03/12] drm/amd/display: Clear lane settings after LTTPRs have been trained Bindu Ramamurthy
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Bindu Ramamurthy @ 2021-06-18 17:35 UTC (permalink / raw)
  To: amd-gfx
  Cc: Dmytro Laktyushkin, Eryk.Brol, Sunpeng.Li, Harry.Wentland,
	Qingqing.Zhuo, Rodrigo.Siqueira, Nikola Cornij, Anson.Jacob,
	Aurabindo.Pillai, Bhawanpreet.Lakha, bindu.r

From: Nikola Cornij <nikola.cornij@amd.com>

[why]
Some timings with a large VBlank cause the value to overflow the
register related, while also producing other wrong values in DML output.

[how]
Clamp VStartup at the DCN3.1 maximum value

Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
---
 .../gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
index 06fac59a3d40..718d5a99dada 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
@@ -2668,6 +2668,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
 												(double) v->WritebackDelay[v->VoltageLevel][k]
 														/ (v->HTotal[k] / v->PixelClock[k]),
 												1));
+		if (v->MaxVStartupLines[k] > 1023)
+			v->MaxVStartupLines[k] = 1023;
 
 #ifdef __DML_VBA_DEBUG__
 		dml_print("DML::%s: k=%d MaxVStartupLines = %d\n", __func__, k, v->MaxVStartupLines[k]);
@@ -5064,6 +5066,8 @@ void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
 																/ (v->HTotal[k]
 																		/ v->PixelClock[k]),
 														1.0));
+				if (v->MaximumVStartup[i][j][k] > 1023)
+					v->MaximumVStartup[i][j][k] = 1023;
 				v->MaxMaxVStartup[i][j] = dml_max(v->MaxMaxVStartup[i][j], v->MaximumVStartup[i][j][k]);
 			}
 		}
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 03/12] drm/amd/display: Clear lane settings after LTTPRs have been trained
  2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 01/12] drm/amd/display: Multiplane cursor position incorrect when plane rotated Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 02/12] drm/amd/display: Clamp VStartup value at DML calculations time Bindu Ramamurthy
@ 2021-06-18 17:35 ` Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 04/12] drm/amd/display: Fix incorrect variable name Bindu Ramamurthy
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Bindu Ramamurthy @ 2021-06-18 17:35 UTC (permalink / raw)
  To: amd-gfx
  Cc: Martin Tsai, Eryk.Brol, Sunpeng.Li, Harry.Wentland,
	Qingqing.Zhuo, Rodrigo.Siqueira, Wenjing Liu, Anson.Jacob,
	Aurabindo.Pillai, Bhawanpreet.Lakha, bindu.r

From: Martin Tsai <martin.tsai@amd.com>

[Why]
The voltage swing has to start from the minimum level when transmit TPS1 over
Main-Link in clock recovery sequence.
The lane settings from current design will inherit the existing VS/PE values
that could be adjusted by Repeater X, and to use the adjusted voltage swing level
in Repeater X-1 or DPRX could violate DP specs.

[How]
To reset VS from lane settings after LTTPRs have been trained to meet the requirement.

Signed-off-by: Martin Tsai <martin.tsai@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 5ecbe525b676..4326ac577756 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -1664,6 +1664,7 @@ static enum link_training_result dp_perform_8b_10b_link_training(
 
 	uint8_t repeater_cnt;
 	uint8_t repeater_id;
+	uint8_t lane = 0;
 
 	if (link->ctx->dc->work_arounds.lt_early_cr_pattern)
 		start_clock_recovery_pattern_early(link, lt_settings, DPRX);
@@ -1694,6 +1695,9 @@ static enum link_training_result dp_perform_8b_10b_link_training(
 
 			repeater_training_done(link, repeater_id);
 		}
+
+		for (lane = 0; lane < (uint8_t)lt_settings->link_settings.lane_count; lane++)
+			lt_settings->lane_settings[lane].VOLTAGE_SWING = VOLTAGE_SWING_LEVEL0;
 	}
 
 	if (status == LINK_TRAINING_SUCCESS) {
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 04/12] drm/amd/display: Fix incorrect variable name
  2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
                   ` (2 preceding siblings ...)
  2021-06-18 17:35 ` [PATCH 03/12] drm/amd/display: Clear lane settings after LTTPRs have been trained Bindu Ramamurthy
@ 2021-06-18 17:35 ` Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 05/12] drm/amd/display: get socBB from VBIOS for dcn302 and dcn303 Bindu Ramamurthy
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Bindu Ramamurthy @ 2021-06-18 17:35 UTC (permalink / raw)
  To: amd-gfx
  Cc: Ashley Thomas, Wesley Chalmers, Eryk.Brol, Sunpeng.Li,
	Harry.Wentland, Qingqing.Zhuo, Rodrigo.Siqueira, Anson.Jacob,
	Aurabindo.Pillai, Bhawanpreet.Lakha, bindu.r

From: Wesley Chalmers <Wesley.Chalmers@amd.com>

[WHY]
extended_end_address can only be calculated from the extended_address and
extended_size

Signed-off-by: Wesley Chalmers <Wesley.Chalmers@amd.com>
Reviewed-by: Ashley Thomas <Ashley.Thomas2@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c
index 27ec1e6e9c43..fe234760a0f5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dpcd.c
@@ -152,7 +152,7 @@ static void dpcd_reduce_address_range(
 		const uint32_t reduced_size)
 {
 	const uint32_t reduced_end_address = END_ADDRESS(reduced_address, reduced_size);
-	const uint32_t extended_end_address = END_ADDRESS(reduced_address, extended_size);
+	const uint32_t extended_end_address = END_ADDRESS(extended_address, extended_size);
 	const uint32_t offset = reduced_address - extended_address;
 
 	if (extended_end_address == reduced_end_address && extended_address == reduced_address)
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 05/12] drm/amd/display: get socBB from VBIOS for dcn302 and dcn303
  2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
                   ` (3 preceding siblings ...)
  2021-06-18 17:35 ` [PATCH 04/12] drm/amd/display: Fix incorrect variable name Bindu Ramamurthy
@ 2021-06-18 17:35 ` Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 06/12] drm/amd/display: Delay PSR entry Bindu Ramamurthy
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Bindu Ramamurthy @ 2021-06-18 17:35 UTC (permalink / raw)
  To: amd-gfx
  Cc: Eryk.Brol, Sunpeng.Li, Harry.Wentland, Qingqing.Zhuo,
	Rodrigo.Siqueira, Anson.Jacob, Aurabindo Pillai, Alex Deucher,
	Bhawanpreet.Lakha, bindu.r

From: Aurabindo Pillai <aurabindo.pillai@amd.com>

[why]
Some SOC BB paramters may vary per SKU, and it does
not make sense for driver to hardcode these values.
This change was added for dcn30 and dcn301, but not
for dcn302 and dcn303

[how]
Parse the values from VBIOS if available, and use
them if valid
Fixes: "drm/amd/display: get socBB from VBIOS"

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
---
 .../amd/display/dc/dcn302/dcn302_resource.c   | 20 +++++++++++++++++++
 .../amd/display/dc/dcn303/dcn303_resource.c   | 20 +++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
index 628b227f0a13..16a75ba0ca82 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
@@ -1102,6 +1102,26 @@ static bool init_soc_bounding_box(struct dc *dc,  struct resource_pool *pool)
 	loaded_ip->max_num_dpp = pool->pipe_count;
 	loaded_ip->clamp_min_dcfclk = dc->config.clamp_min_dcfclk;
 	dcn20_patch_bounding_box(dc, loaded_bb);
+
+	if (dc->ctx->dc_bios->funcs->get_soc_bb_info) {
+		struct bp_soc_bb_info bb_info = { 0 };
+
+		if (dc->ctx->dc_bios->funcs->get_soc_bb_info(
+			    dc->ctx->dc_bios, &bb_info) == BP_RESULT_OK) {
+			if (bb_info.dram_clock_change_latency_100ns > 0)
+				dcn3_02_soc.dram_clock_change_latency_us =
+					bb_info.dram_clock_change_latency_100ns * 10;
+
+			if (bb_info.dram_sr_enter_exit_latency_100ns > 0)
+				dcn3_02_soc.sr_enter_plus_exit_time_us =
+					bb_info.dram_sr_enter_exit_latency_100ns * 10;
+
+			if (bb_info.dram_sr_exit_latency_100ns > 0)
+				dcn3_02_soc.sr_exit_time_us =
+					bb_info.dram_sr_exit_latency_100ns * 10;
+		}
+	}
+
 	return true;
 }
 
diff --git a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
index 88b609c32b0a..34b89464ae02 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
@@ -1028,6 +1028,26 @@ static bool init_soc_bounding_box(struct dc *dc,  struct resource_pool *pool)
 	loaded_ip->max_num_dpp = pool->pipe_count;
 	loaded_ip->clamp_min_dcfclk = dc->config.clamp_min_dcfclk;
 	dcn20_patch_bounding_box(dc, loaded_bb);
+
+	if (dc->ctx->dc_bios->funcs->get_soc_bb_info) {
+		struct bp_soc_bb_info bb_info = { 0 };
+
+		if (dc->ctx->dc_bios->funcs->get_soc_bb_info(
+			    dc->ctx->dc_bios, &bb_info) == BP_RESULT_OK) {
+			if (bb_info.dram_clock_change_latency_100ns > 0)
+				dcn3_03_soc.dram_clock_change_latency_us =
+					bb_info.dram_clock_change_latency_100ns * 10;
+
+			if (bb_info.dram_sr_enter_exit_latency_100ns > 0)
+				dcn3_03_soc.sr_enter_plus_exit_time_us =
+					bb_info.dram_sr_enter_exit_latency_100ns * 10;
+
+			if (bb_info.dram_sr_exit_latency_100ns > 0)
+				dcn3_03_soc.sr_exit_time_us =
+					bb_info.dram_sr_exit_latency_100ns * 10;
+		}
+	}
+
 	return true;
 }
 
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 06/12] drm/amd/display: Delay PSR entry
  2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
                   ` (4 preceding siblings ...)
  2021-06-18 17:35 ` [PATCH 05/12] drm/amd/display: get socBB from VBIOS for dcn302 and dcn303 Bindu Ramamurthy
@ 2021-06-18 17:35 ` Bindu Ramamurthy
  2021-06-18 17:35 ` [PATCH 07/12] drm/amd/display: get refclk from MICROSECOND_TIME_BASE_DIV HW register Bindu Ramamurthy
  2021-06-18 18:39 ` [PATCH 00/12] June, 21, 2021 Wheeler, Daniel
  7 siblings, 0 replies; 9+ messages in thread
From: Bindu Ramamurthy @ 2021-06-18 17:35 UTC (permalink / raw)
  To: amd-gfx
  Cc: Eryk.Brol, Sunpeng.Li, Harry.Wentland, Qingqing.Zhuo,
	Rodrigo.Siqueira, Roman Li, Anson.Jacob, Aurabindo.Pillai,
	Hersen Wu, Bhawanpreet.Lakha, bindu.r

From: Roman Li <roman.li@amd.com>

[Why]
After panel power up, if PSR entry attempted too early,
PSR state may get stuck in transition.
This could happen if the panel is not ready
to respond to the SDP PSR entry message.
In this case dmub f/w is unable to abort PSR entry
since abortion is not permitted after the SDP has been sent.

[How]
Skip 5 pageflips before PSR enable.

Signed-off-by: Roman Li <roman.li@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c     | 10 +++++++++-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h     |  2 ++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h |  3 +++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index c3fbe35f07b9..0b21d011802e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5967,6 +5967,8 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
 				stream->use_vsc_sdp_for_colorimetry = true;
 		}
 		mod_build_vsc_infopacket(stream, &stream->vsc_infopacket);
+		aconnector->psr_skip_count = AMDGPU_DM_PSR_ENTRY_DELAY;
+
 	}
 finish:
 	dc_sink_release(sink);
@@ -8814,7 +8816,13 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 		else if ((acrtc_state->update_type == UPDATE_TYPE_FAST) &&
 				acrtc_state->stream->link->psr_settings.psr_feature_enabled &&
 				!acrtc_state->stream->link->psr_settings.psr_allow_active) {
-			amdgpu_dm_psr_enable(acrtc_state->stream);
+			struct amdgpu_dm_connector *aconn = (struct amdgpu_dm_connector *)
+					acrtc_state->stream->dm_stream_context;
+
+			if (aconn->psr_skip_count > 0)
+				aconn->psr_skip_count--;
+			else
+				amdgpu_dm_psr_enable(acrtc_state->stream);
 		}
 
 		mutex_unlock(&dm->dc_lock);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index 64cf5afbde6a..57996c364940 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -509,6 +509,8 @@ struct amdgpu_dm_connector {
 	struct dsc_preferred_settings dsc_settings;
 	/* Cached display modes */
 	struct drm_display_mode freesync_vid_base;
+
+	int psr_skip_count;
 };
 
 #define to_amdgpu_dm_connector(x) container_of(x, struct amdgpu_dm_connector, base)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h
index 57bbb80421e8..6806b3c9c84b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h
@@ -28,6 +28,9 @@
 
 #include "amdgpu.h"
 
+/* the number of pageflips before enabling psr */
+#define AMDGPU_DM_PSR_ENTRY_DELAY 5
+
 void amdgpu_dm_set_psr_caps(struct dc_link *link);
 bool amdgpu_dm_psr_enable(struct dc_stream_state *stream);
 bool amdgpu_dm_link_setup_psr(struct dc_stream_state *stream);
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 07/12] drm/amd/display: get refclk from MICROSECOND_TIME_BASE_DIV HW register
  2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
                   ` (5 preceding siblings ...)
  2021-06-18 17:35 ` [PATCH 06/12] drm/amd/display: Delay PSR entry Bindu Ramamurthy
@ 2021-06-18 17:35 ` Bindu Ramamurthy
  2021-06-18 18:39 ` [PATCH 00/12] June, 21, 2021 Wheeler, Daniel
  7 siblings, 0 replies; 9+ messages in thread
From: Bindu Ramamurthy @ 2021-06-18 17:35 UTC (permalink / raw)
  To: amd-gfx
  Cc: Charlene Liu, Chris Park, Eryk.Brol, Sunpeng.Li, Harry.Wentland,
	Qingqing.Zhuo, Rodrigo.Siqueira, Anson.Jacob, Aurabindo.Pillai,
	Bhawanpreet.Lakha, Nicholas Kazlauskas, bindu.r

From: Charlene Liu <Charlene.Liu@amd.com>

[why]
recent VBIOS dce_infotable reference clock change caused a I2c regression.
instead of relying on vbios, let's get it from HW directly.

Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Reviewed-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c | 13 ++++++++++---
 drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.h |  3 +++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c b/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
index a524f471e0d7..6d1b01c267b7 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
@@ -264,18 +264,25 @@ static void set_speed(
 	struct dce_i2c_hw *dce_i2c_hw,
 	uint32_t speed)
 {
-	uint32_t xtal_ref_div = 0;
+	uint32_t xtal_ref_div = 0, ref_base_div = 0;
 	uint32_t prescale = 0;
+	uint32_t i2c_ref_clock = 0;
 
 	if (speed == 0)
 		return;
 
-	REG_GET(MICROSECOND_TIME_BASE_DIV, XTAL_REF_DIV, &xtal_ref_div);
+	REG_GET_2(MICROSECOND_TIME_BASE_DIV, MICROSECOND_TIME_BASE_DIV, &ref_base_div,
+		XTAL_REF_DIV, &xtal_ref_div);
 
 	if (xtal_ref_div == 0)
 		xtal_ref_div = 2;
 
-	prescale = ((dce_i2c_hw->reference_frequency * 2) / xtal_ref_div) / speed;
+	if (ref_base_div == 0)
+		i2c_ref_clock = (dce_i2c_hw->reference_frequency * 2);
+	else
+		i2c_ref_clock = ref_base_div * 1000;
+
+	prescale = (i2c_ref_clock / xtal_ref_div) / speed;
 
 	if (dce_i2c_hw->masks->DC_I2C_DDC1_START_STOP_TIMING_CNTL)
 		REG_UPDATE_N(SPEED, 3,
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.h b/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.h
index 2309f2bb162c..3f45ecd189a2 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.h
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.h
@@ -139,6 +139,7 @@ enum {
 	I2C_SF(DC_I2C_DATA, DC_I2C_INDEX, mask_sh),\
 	I2C_SF(DC_I2C_DATA, DC_I2C_INDEX_WRITE, mask_sh),\
 	I2C_SF(MICROSECOND_TIME_BASE_DIV, XTAL_REF_DIV, mask_sh),\
+	I2C_SF(MICROSECOND_TIME_BASE_DIV, MICROSECOND_TIME_BASE_DIV, mask_sh),\
 	I2C_SF(DC_I2C_ARBITRATION, DC_I2C_REG_RW_CNTL_STATUS, mask_sh)
 
 #define I2C_COMMON_MASK_SH_LIST_DCE110(mask_sh)\
@@ -182,6 +183,7 @@ struct dce_i2c_shift {
 	uint8_t DC_I2C_INDEX;
 	uint8_t DC_I2C_INDEX_WRITE;
 	uint8_t XTAL_REF_DIV;
+	uint8_t MICROSECOND_TIME_BASE_DIV;
 	uint8_t DC_I2C_DDC1_SEND_RESET_LENGTH;
 	uint8_t DC_I2C_REG_RW_CNTL_STATUS;
 	uint8_t I2C_LIGHT_SLEEP_FORCE;
@@ -225,6 +227,7 @@ struct dce_i2c_mask {
 	uint32_t DC_I2C_INDEX;
 	uint32_t DC_I2C_INDEX_WRITE;
 	uint32_t XTAL_REF_DIV;
+	uint32_t MICROSECOND_TIME_BASE_DIV;
 	uint32_t DC_I2C_DDC1_SEND_RESET_LENGTH;
 	uint32_t DC_I2C_REG_RW_CNTL_STATUS;
 	uint32_t I2C_LIGHT_SLEEP_FORCE;
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH 00/12] June, 21, 2021
  2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
                   ` (6 preceding siblings ...)
  2021-06-18 17:35 ` [PATCH 07/12] drm/amd/display: get refclk from MICROSECOND_TIME_BASE_DIV HW register Bindu Ramamurthy
@ 2021-06-18 18:39 ` Wheeler, Daniel
  7 siblings, 0 replies; 9+ messages in thread
From: Wheeler, Daniel @ 2021-06-18 18:39 UTC (permalink / raw)
  To: R, Bindu, amd-gfx
  Cc: Brol, Eryk, Li, Sun peng (Leo),
	Lakha, Bhawanpreet, Zhuo,  Qingqing, Siqueira, Rodrigo, Jacob,
	Anson, Pillai, Aurabindo, Wentland, Harry, R, Bindu

[Public]

Hi all,
 
This week this patchset was tested on the following systems:
 
HP Envy 360, with Ryzen 5 4500U, with the following display types: eDP 1080p 60hz, 4k 60hz  (via USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI), 1680*1050 60hz (via USB-C to DP and then DP to DVI/VGA)
 
AMD Ryzen 9 5900H, with the following display types: eDP 1080p 60hz, 4k 60hz  (via USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI), 1680*1050 60hz (via USB-C to DP and then DP to DVI/VGA)
 
Sapphire Pulse RX5700XT with the following display types:
4k 60hz  (via DP/HDMI), 1440p 144hz (via DP/HDMI), 1680*1050 60hz (via DP to DVI/VGA)
 
Reference AMD RX6800 with the following display types:
4k 60hz  (via DP/HDMI and USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI and USB-C to DP/HDMI), 1680*1050 60hz (via DP to DVI/VGA)
 
Included testing using a Startech DP 1.4 MST hub at 2x 4k 60hz, and 3x 1080p 60hz on all systems.
 
 
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
 
 
Thank you,
 
Dan Wheeler
Technologist  |  AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook |  Twitter |  amd.com  

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Bindu Ramamurthy
Sent: June 18, 2021 1:35 PM
To: amd-gfx@lists.freedesktop.org
Cc: Brol, Eryk <Eryk.Brol@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Zhuo, Qingqing <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Jacob, Anson <Anson.Jacob@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; R, Bindu <Bindu.R@amd.com>
Subject: [PATCH 00/12] June, 21, 2021

This DC patchset brings improvements in multiple areas. In summary, we
highlight:

* DC 3.2.141
* Firmware release 0.0.71
* Improvements across LTTPR, edp initialization, DML calculations,
  VBIOS for dcn302 and dcn303 etc.

Anthony Koo (1):
  drm/amd/display: [FW Promotion] Release 0.0.71

Aric Cyr (2):
  drm/amd/display: Multiplane cursor position incorrect when plane
    rotated
  drm/amd/display: 3.2.141
  This version brings along following fixes:
	- FW release 0.0.71.
	- get socBB from VBIOS for dcn302 and dcn303.
	- refclk from MICROSECOND_TIME_BASE_DIV HW register.
	- Clear lane settings after LTTPRs have been trained.
	- Clamp VStartup value at DML calculations.

Aurabindo Pillai (1):
  drm/amd/display: get socBB from VBIOS for dcn302 and dcn303

Charlene Liu (1):
  drm/amd/display: get refclk from MICROSECOND_TIME_BASE_DIV HW register

Josip Pavic (1):
  drm/amd/display: do not compare integers of different widths

Martin Tsai (1):
  drm/amd/display: Clear lane settings after LTTPRs have been trained

Nikola Cornij (1):
  drm/amd/display: Clamp VStartup value at DML calculations time

Roman Li (1):
  drm/amd/display: Delay PSR entry

Stylon Wang (1):
  drm/amd/display: Revert "Guard ASSR with internal display flag"

Wesley Chalmers (1):
  drm/amd/display: Fix incorrect variable name

ollogush (1):
  drm/amd/display: Fix edp_bootup_bl_level initialization issue

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++-  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  2 +  .../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h |  3 +
 .../drm/amd/display/dc/bios/bios_parser2.c    |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |  2 +-  .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 66 +++++---------
 .../drm/amd/display/dc/core/dc_link_dpcd.c    |  2 +-
 drivers/gpu/drm/amd/display/dc/dc.h           |  2 +-
 .../gpu/drm/amd/display/dc/dce/dce_i2c_hw.c   | 13 ++-
 .../gpu/drm/amd/display/dc/dce/dce_i2c_hw.h   |  3 +
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 15 +++-
 .../amd/display/dc/dcn302/dcn302_resource.c   | 20 +++++
 .../amd/display/dc/dcn303/dcn303_resource.c   | 20 +++++
 .../dc/dml/dcn31/display_mode_vba_31.c        |  4 +
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h   | 90 ++++++++++++++++++-
 15 files changed, 197 insertions(+), 57 deletions(-)

--
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cdaniel.wheeler%40amd.com%7Ca309462e10d641ec36f308d9327f79a4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637596345349689067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=qX9J3g2j%2B%2FzJ8ZTp8Z7cY57N49S2S3KI5NRw7RMYXkM%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-06-18 18:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 17:35 [PATCH 00/12] June, 21, 2021 Bindu Ramamurthy
2021-06-18 17:35 ` [PATCH 01/12] drm/amd/display: Multiplane cursor position incorrect when plane rotated Bindu Ramamurthy
2021-06-18 17:35 ` [PATCH 02/12] drm/amd/display: Clamp VStartup value at DML calculations time Bindu Ramamurthy
2021-06-18 17:35 ` [PATCH 03/12] drm/amd/display: Clear lane settings after LTTPRs have been trained Bindu Ramamurthy
2021-06-18 17:35 ` [PATCH 04/12] drm/amd/display: Fix incorrect variable name Bindu Ramamurthy
2021-06-18 17:35 ` [PATCH 05/12] drm/amd/display: get socBB from VBIOS for dcn302 and dcn303 Bindu Ramamurthy
2021-06-18 17:35 ` [PATCH 06/12] drm/amd/display: Delay PSR entry Bindu Ramamurthy
2021-06-18 17:35 ` [PATCH 07/12] drm/amd/display: get refclk from MICROSECOND_TIME_BASE_DIV HW register Bindu Ramamurthy
2021-06-18 18:39 ` [PATCH 00/12] June, 21, 2021 Wheeler, Daniel

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.