amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/23] DC Patches June 06, 2022
@ 2022-06-10 20:52 Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 01/23] drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined Hamza Mahfooz
                   ` (23 more replies)
  0 siblings, 24 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

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

* DP fixes
* Reduced frame size in the bouding boxes of a number of ASICs.
* Exiting idle optimizations
* General cleanup
* Power management optimizations
* HF-VSIF support
* VTEM support
* FVA timing improvements

Ahmad Othman (2):
  drm/amd/display: Add support for HF-VSIF
  drm/amd/display: Adding VTEM to dc

Aric Cyr (1):
  drm/amd/display: 3.2.190

Charlene Liu (1):
  drm/amd/display: FVA timing adjustment

Felipe (2):
  drm/amd/display: Firmware assisted MCLK switch and FS
  drm/amd/display: Pass vrr mode to dcn

Hamza Mahfooz (1):
  drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined

Harry VanZyllDeJong (1):
  drm/amd/display: Disables dynamic memory clock switching in games

Ian Chen (1):
  drm/amd/display: DAL ACR, dc part, fix missing dcn30

Joshua Aberback (1):
  drm/amd/display: Blank for uclk OC in dm instead of dc

Lee, Alvin (1):
  drm/amd/display: Add debug option for exiting idle optimizations on
    cursor updates

Martin Leung (1):
  drm/amd/display: Add null check to dc_submit_i2c_oem

Nicholas Kazlauskas (1):
  drm/amd/display: Copy hfvsif_infopacket when stream update

Oliver Logush (1):
  drm/amd/display: Drop unused privacy_mask setters and getters

Qingqing Zhuo (1):
  drm/amd/display: update topology_update_input_v3 struct

Rodrigo Siqueira (4):
  drm/amd/display: Reduce frame size in the bouding box for DCN20
  drm/amd/display: Reduce frame size in the bouding box for DCN301
  drm/amd/display: Reduce frame size in the bouding box for DCN31/316
  drm/amd/display: Reduce frame size in the bouding box for DCN21

Samson Tam (1):
  drm/amd/display: Fix comments

Shah, Dharati (1):
  drm/amd/display: Fix monitor flash issue

Wenjing Liu (1):
  drm/amd/display: lower lane count first when CR done partially fails
    in EQ

hersen wu (1):
  drm/amd/display: dsc validate fail not pass to atomic check

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  6 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |  2 +
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 43 ++++++++----
 .../display/amdgpu_dm/amdgpu_dm_mst_types.h   |  2 +-
 .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c  | 23 ++++---
 .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c  | 11 ++-
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 66 +++++++++---------
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |  8 ++-
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 13 ++--
 .../gpu/drm/amd/display/dc/core/dc_resource.c | 27 +++++++-
 .../gpu/drm/amd/display/dc/core/dc_stream.c   |  5 +-
 drivers/gpu/drm/amd/display/dc/dc.h           | 13 ++--
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |  2 +
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h  |  5 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |  9 ++-
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c |  1 -
 .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c |  1 +
 .../display/dc/dcn10/dcn10_stream_encoder.c   |  8 ++-
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    |  1 -
 .../display/dc/dcn20/dcn20_stream_encoder.c   |  1 +
 .../dc/dcn30/dcn30_dio_stream_encoder.c       |  1 +
 .../drm/amd/display/dc/dcn30/dcn30_hwseq.c    | 28 +++++---
 .../drm/amd/display/dc/dcn30/dcn30_hwseq.h    | 11 ++-
 .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c |  2 +-
 .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c |  1 +
 .../drm/amd/display/dc/dcn30/dcn30_resource.c |  1 +
 .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c  | 67 +++++++++----------
 .../amd/display/dc/dml/dcn301/dcn301_fpu.c    | 30 ++++-----
 .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c  | 64 ++++++++----------
 .../dc/gpio/dcn20/hw_translate_dcn20.c        | 17 +++--
 .../dc/gpio/dcn21/hw_translate_dcn21.c        | 17 +++--
 .../dc/gpio/dcn30/hw_translate_dcn30.c        | 19 +++---
 drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h   |  6 --
 .../amd/display/dc/inc/hw/stream_encoder.h    |  1 +
 .../amd/display/dc/inc/hw_sequencer_private.h |  1 +
 .../amd/display/include/link_service_types.h  |  2 +
 .../amd/display/modules/freesync/freesync.c   |  5 ++
 .../display/modules/hdcp/hdcp2_transition.c   |  2 +-
 .../drm/amd/display/modules/hdcp/hdcp_psp.c   |  4 ++
 .../drm/amd/display/modules/hdcp/hdcp_psp.h   | 11 +++
 .../amd/display/modules/inc/mod_freesync.h    |  3 +
 41 files changed, 326 insertions(+), 214 deletions(-)

-- 
2.36.1


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

* [PATCH 01/23] drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 02/23] drm/amd/display: lower lane count first when CR done partially fails in EQ Hamza Mahfooz
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

Fixes:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c: In function ‘dc_remove_stream_from_ctx’:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:2010:3: error: implicit declaration of function ‘remove_hpo_dp_link_enc_from_ctx’; did you mean ‘add_hpo_dp_link_enc_to_ctx’? [-Werror=implicit-function-declaration]
 2010 |   remove_hpo_dp_link_enc_from_ctx(&new_ctx->res_ctx, del_pipe, del_pipe->stream);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   add_hpo_dp_link_enc_to_ctx

Fixes: b109b1468223 ("drm/amdgpu/display: Protect some functions with CONFIG_DRM_AMD_DC_DCN")
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 7357efb8b439..21d217e84192 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -2007,7 +2007,9 @@ enum dc_status dc_remove_stream_from_ctx(
 			&new_ctx->res_ctx, dc->res_pool,
 			del_pipe->stream_res.hpo_dp_stream_enc,
 			false);
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 		remove_hpo_dp_link_enc_from_ctx(&new_ctx->res_ctx, del_pipe, del_pipe->stream);
+#endif
 	}
 
 	if (del_pipe->stream_res.audio)
-- 
2.36.1


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

* [PATCH 02/23] drm/amd/display: lower lane count first when CR done partially fails in EQ
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 01/23] drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 03/23] drm/amd/display: Fix monitor flash issue Hamza Mahfooz
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	George Shen, Rodrigo.Siqueira, roman.li, Wenjing Liu,
	solomon.chiu, jerry.zuo, Aurabindo.Pillai, hamza.mahfooz,
	wayne.lin, Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Wenjing Liu <wenjing.liu@amd.com>

[why]
According to DP specs, in EQ DONE phase of link training, we
should lower lane count when at least one CR DONE bit is set to 1, while
lower link rate when all CR DONE bits are 0s. However in our code, we will
treat both cases as latter. This is not exactly correct based on the specs
expectation.

[how]
Check lane0 CR DONE bit when it is still set but CR DONE fails,
we treat it as a partial CR DONE failure in EQ DONE phase, we
will follow the same fallback flow as when ED DONE fails in EQ
DONE phase.

Reviewed-by: George Shen <George.Shen@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c    | 13 +++++++------
 .../drm/amd/display/include/link_service_types.h    |  2 ++
 2 files changed, 9 insertions(+), 6 deletions(-)

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 c1207049dbc5..f9c10d044da6 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
@@ -1326,7 +1326,9 @@ static enum link_training_result perform_channel_equalization_sequence(
 
 		/* 5. check CR done*/
 		if (!dp_is_cr_done(lane_count, dpcd_lane_status))
-			return LINK_TRAINING_EQ_FAIL_CR;
+			return dpcd_lane_status[0].bits.CR_DONE_0 ?
+					LINK_TRAINING_EQ_FAIL_CR_PARTIAL :
+					LINK_TRAINING_EQ_FAIL_CR;
 
 		/* 6. check CHEQ done*/
 		if (dp_is_ch_eq_done(lane_count, dpcd_lane_status) &&
@@ -1882,6 +1884,9 @@ static void print_status_message(
 	case LINK_TRAINING_EQ_FAIL_CR:
 		lt_result = "CR failed in EQ";
 		break;
+	case LINK_TRAINING_EQ_FAIL_CR_PARTIAL:
+		lt_result = "CR failed in EQ partially";
+		break;
 	case LINK_TRAINING_EQ_FAIL_EQ:
 		lt_result = "EQ failed";
 		break;
@@ -3612,11 +3617,6 @@ static bool decide_fallback_link_setting(
 		struct dc_link_settings *cur,
 		enum link_training_result training_result)
 {
-	if (!cur)
-		return false;
-	if (!max)
-		return false;
-
 	if (dp_get_link_encoding_format(max) == DP_128b_132b_ENCODING ||
 			link->dc->debug.force_dp2_lt_fallback_method)
 		return decide_fallback_link_setting_max_bw_policy(link, max, cur,
@@ -3646,6 +3646,7 @@ static bool decide_fallback_link_setting(
 		break;
 	}
 	case LINK_TRAINING_EQ_FAIL_EQ:
+	case LINK_TRAINING_EQ_FAIL_CR_PARTIAL:
 	{
 		if (!reached_minimum_lane_count(cur->lane_count)) {
 			cur->lane_count = reduce_lane_count(cur->lane_count);
diff --git a/drivers/gpu/drm/amd/display/include/link_service_types.h b/drivers/gpu/drm/amd/display/include/link_service_types.h
index 447a56286dd0..23f7d7354aaa 100644
--- a/drivers/gpu/drm/amd/display/include/link_service_types.h
+++ b/drivers/gpu/drm/amd/display/include/link_service_types.h
@@ -67,6 +67,8 @@ enum link_training_result {
 	LINK_TRAINING_CR_FAIL_LANE23,
 	/* CR DONE bit is cleared during EQ step */
 	LINK_TRAINING_EQ_FAIL_CR,
+	/* CR DONE bit is cleared but LANE0_CR_DONE is set during EQ step */
+	LINK_TRAINING_EQ_FAIL_CR_PARTIAL,
 	/* other failure during EQ step */
 	LINK_TRAINING_EQ_FAIL_EQ,
 	LINK_TRAINING_LQA_FAIL,
-- 
2.36.1


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

* [PATCH 03/23] drm/amd/display: Fix monitor flash issue
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 01/23] drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 02/23] drm/amd/display: lower lane count first when CR done partially fails in EQ Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 04/23] drm/amd/display: Reduce frame size in the bouding box for DCN20 Hamza Mahfooz
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Hansen Dsouza, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, Shah Dharati, hamza.mahfooz,
	wayne.lin, Shah, Dharati, Bhawanpreet.Lakha, Nicholas Kazlauskas,
	agustin.gutierrez, pavle.kotarac

From: "Shah, Dharati" <Dharati.Shah@amd.com>

[Why & How]
For a some specific monitors, when connected on boot or hot plug,
monitor flash for 1/2 seconds can happen during first HDCP query
operation. Ading some delay in the init sequence for these monitors
fixes the issue, so it is implemented as monitor specific patch.

Co-authored-by: Shah Dharati <dharshah@amd.com>
Reviewed-by: Hansen Dsouza <Hansen.Dsouza@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Shah Dharati <dharshah@amd.com>
---
 drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_transition.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_transition.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_transition.c
index 1f4095b26409..c5f6c11de7e5 100644
--- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_transition.c
+++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_transition.c
@@ -524,7 +524,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_dp_transition(struct mod_hdcp *hdcp,
 			set_watchdog_in_ms(hdcp, 3000, output);
 			set_state_id(hdcp, output, D2_A6_WAIT_FOR_RX_ID_LIST);
 		} else {
-			callback_in_ms(0, output);
+			callback_in_ms(1, output);
 			set_state_id(hdcp, output, D2_SEND_CONTENT_STREAM_TYPE);
 		}
 		break;
-- 
2.36.1


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

* [PATCH 04/23] drm/amd/display: Reduce frame size in the bouding box for DCN20
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (2 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 03/23] drm/amd/display: Fix monitor flash issue Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 05/23] drm/amd/display: Reduce frame size in the bouding box for DCN301 Hamza Mahfooz
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Dmytro Laktyushkin, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, hamza.mahfooz, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

GCC throw warnings for the function dcn20_update_bounding_box due to its
frame size that looks like this:

 error: the frame size of 1936 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

This commit fixes this issue by eliminating an intermediary variable
that creates a large array.

Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
 .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c  | 38 +++++++++----------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
index eeec40f6fd0a..d9cc178f6980 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
@@ -1456,21 +1456,20 @@ void dcn20_calculate_wm(
 void dcn20_update_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st *bb,
 		struct pp_smu_nv_clock_table *max_clocks, unsigned int *uclk_states, unsigned int num_states)
 {
-	struct _vcs_dpi_voltage_scaling_st calculated_states[DC__VOLTAGE_STATES];
-	int i;
 	int num_calculated_states = 0;
 	int min_dcfclk = 0;
+	int i;
 
 	dc_assert_fp_enabled();
 
 	if (num_states == 0)
 		return;
 
-	memset(calculated_states, 0, sizeof(calculated_states));
+	memset(bb->clock_limits, 0, sizeof(bb->clock_limits));
 
-	if (dc->bb_overrides.min_dcfclk_mhz > 0)
+	if (dc->bb_overrides.min_dcfclk_mhz > 0) {
 		min_dcfclk = dc->bb_overrides.min_dcfclk_mhz;
-	else {
+	} else {
 		if (ASICREV_IS_NAVI12_P(dc->ctx->asic_id.hw_internal_rev))
 			min_dcfclk = 310;
 		else
@@ -1481,36 +1480,35 @@ void dcn20_update_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_s
 
 	for (i = 0; i < num_states; i++) {
 		int min_fclk_required_by_uclk;
-		calculated_states[i].state = i;
-		calculated_states[i].dram_speed_mts = uclk_states[i] * 16 / 1000;
+		bb->clock_limits[i].state = i;
+		bb->clock_limits[i].dram_speed_mts = uclk_states[i] * 16 / 1000;
 
 		// FCLK:UCLK ratio is 1.08
 		min_fclk_required_by_uclk = div_u64(((unsigned long long)uclk_states[i]) * 1080,
 			1000000);
 
-		calculated_states[i].fabricclk_mhz = (min_fclk_required_by_uclk < min_dcfclk) ?
+		bb->clock_limits[i].fabricclk_mhz = (min_fclk_required_by_uclk < min_dcfclk) ?
 				min_dcfclk : min_fclk_required_by_uclk;
 
-		calculated_states[i].socclk_mhz = (calculated_states[i].fabricclk_mhz > max_clocks->socClockInKhz / 1000) ?
-				max_clocks->socClockInKhz / 1000 : calculated_states[i].fabricclk_mhz;
+		bb->clock_limits[i].socclk_mhz = (bb->clock_limits[i].fabricclk_mhz > max_clocks->socClockInKhz / 1000) ?
+				max_clocks->socClockInKhz / 1000 : bb->clock_limits[i].fabricclk_mhz;
 
-		calculated_states[i].dcfclk_mhz = (calculated_states[i].fabricclk_mhz > max_clocks->dcfClockInKhz / 1000) ?
-				max_clocks->dcfClockInKhz / 1000 : calculated_states[i].fabricclk_mhz;
+		bb->clock_limits[i].dcfclk_mhz = (bb->clock_limits[i].fabricclk_mhz > max_clocks->dcfClockInKhz / 1000) ?
+				max_clocks->dcfClockInKhz / 1000 : bb->clock_limits[i].fabricclk_mhz;
 
-		calculated_states[i].dispclk_mhz = max_clocks->displayClockInKhz / 1000;
-		calculated_states[i].dppclk_mhz = max_clocks->displayClockInKhz / 1000;
-		calculated_states[i].dscclk_mhz = max_clocks->displayClockInKhz / (1000 * 3);
+		bb->clock_limits[i].dispclk_mhz = max_clocks->displayClockInKhz / 1000;
+		bb->clock_limits[i].dppclk_mhz = max_clocks->displayClockInKhz / 1000;
+		bb->clock_limits[i].dscclk_mhz = max_clocks->displayClockInKhz / (1000 * 3);
 
-		calculated_states[i].phyclk_mhz = max_clocks->phyClockInKhz / 1000;
+		bb->clock_limits[i].phyclk_mhz = max_clocks->phyClockInKhz / 1000;
 
 		num_calculated_states++;
 	}
 
-	calculated_states[num_calculated_states - 1].socclk_mhz = max_clocks->socClockInKhz / 1000;
-	calculated_states[num_calculated_states - 1].fabricclk_mhz = max_clocks->socClockInKhz / 1000;
-	calculated_states[num_calculated_states - 1].dcfclk_mhz = max_clocks->dcfClockInKhz / 1000;
+	bb->clock_limits[num_calculated_states - 1].socclk_mhz = max_clocks->socClockInKhz / 1000;
+	bb->clock_limits[num_calculated_states - 1].fabricclk_mhz = max_clocks->socClockInKhz / 1000;
+	bb->clock_limits[num_calculated_states - 1].dcfclk_mhz = max_clocks->dcfClockInKhz / 1000;
 
-	memcpy(bb->clock_limits, calculated_states, sizeof(bb->clock_limits));
 	bb->num_states = num_calculated_states;
 
 	// Duplicate the last state, DML always an extra state identical to max state to work
-- 
2.36.1


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

* [PATCH 05/23] drm/amd/display: Reduce frame size in the bouding box for DCN301
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (3 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 04/23] drm/amd/display: Reduce frame size in the bouding box for DCN20 Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 06/23] drm/amd/display: Reduce frame size in the bouding box for DCN31/316 Hamza Mahfooz
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Dmytro Laktyushkin, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, hamza.mahfooz, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

GCC throw warnings for the function dcn301_fpu_update_bw_bounding_box
due to its frame size that looks like this:

 error: the frame size of 1936 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

For fixing this issue I dropped an intermadiate variable.

Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
 .../amd/display/dc/dml/dcn301/dcn301_fpu.c    | 30 ++++++++-----------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c
index 0a7a33864973..62cf283d9f41 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c
@@ -249,7 +249,6 @@ void dcn301_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
 {
 	struct dcn301_resource_pool *pool = TO_DCN301_RES_POOL(dc->res_pool);
 	struct clk_limit_table *clk_table = &bw_params->clk_table;
-	struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES];
 	unsigned int i, closest_clk_lvl;
 	int j;
 
@@ -271,24 +270,21 @@ void dcn301_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
 				}
 			}
 
-			clock_limits[i].state = i;
-			clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
-			clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
-			clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
-			clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2;
-
-			clock_limits[i].dispclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
-			clock_limits[i].dppclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
-			clock_limits[i].dram_bw_per_chan_gbps = dcn3_01_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
-			clock_limits[i].dscclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
-			clock_limits[i].dtbclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
-			clock_limits[i].phyclk_d18_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
-			clock_limits[i].phyclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
+			dcn3_01_soc.clock_limits[i].state = i;
+			dcn3_01_soc.clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
+			dcn3_01_soc.clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
+			dcn3_01_soc.clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
+			dcn3_01_soc.clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2;
+
+			dcn3_01_soc.clock_limits[i].dispclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
+			dcn3_01_soc.clock_limits[i].dppclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
+			dcn3_01_soc.clock_limits[i].dram_bw_per_chan_gbps = dcn3_01_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
+			dcn3_01_soc.clock_limits[i].dscclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
+			dcn3_01_soc.clock_limits[i].dtbclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
+			dcn3_01_soc.clock_limits[i].phyclk_d18_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
+			dcn3_01_soc.clock_limits[i].phyclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
 		}
 
-		for (i = 0; i < clk_table->num_entries; i++)
-			dcn3_01_soc.clock_limits[i] = clock_limits[i];
-
 		if (clk_table->num_entries) {
 			dcn3_01_soc.num_states = clk_table->num_entries;
 			/* duplicate last level */
-- 
2.36.1


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

* [PATCH 06/23] drm/amd/display: Reduce frame size in the bouding box for DCN31/316
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (4 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 05/23] drm/amd/display: Reduce frame size in the bouding box for DCN301 Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 07/23] drm/amd/display: Reduce frame size in the bouding box for DCN21 Hamza Mahfooz
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Dmytro Laktyushkin, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, hamza.mahfooz, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

GCC throw warnings for the function dcn31_update_bw_bounding_box and
dcn316_update_bw_bounding_box due to its frame size that looks like
this:

 error: the frame size of 1936 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

For fixing this issue I dropped an intermadiate variable.

Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
 .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c  | 64 +++++++++----------
 1 file changed, 29 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
index 1b02f0ebe957..858c5cd141b8 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
@@ -575,7 +575,6 @@ void dcn31_calculate_wm_and_dlg_fp(
 void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params)
 {
 	struct clk_limit_table *clk_table = &bw_params->clk_table;
-	struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES];
 	unsigned int i, closest_clk_lvl;
 	int j;
 
@@ -608,29 +607,27 @@ void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params
 				}
 			}
 
-			clock_limits[i].state = i;
+			dcn3_1_soc.clock_limits[i].state = i;
 
 			/* Clocks dependent on voltage level. */
-			clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
-			clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
-			clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
-			clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2 * clk_table->entries[i].wck_ratio;
+			dcn3_1_soc.clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
+			dcn3_1_soc.clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
+			dcn3_1_soc.clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
+			dcn3_1_soc.clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2 * clk_table->entries[i].wck_ratio;
 
 			/* Clocks independent of voltage level. */
-			clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz :
+			dcn3_1_soc.clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz :
 				dcn3_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
 
-			clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz :
+			dcn3_1_soc.clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz :
 				dcn3_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
 
-			clock_limits[i].dram_bw_per_chan_gbps = dcn3_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
-			clock_limits[i].dscclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
-			clock_limits[i].dtbclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
-			clock_limits[i].phyclk_d18_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
-			clock_limits[i].phyclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
+			dcn3_1_soc.clock_limits[i].dram_bw_per_chan_gbps = dcn3_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
+			dcn3_1_soc.clock_limits[i].dscclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
+			dcn3_1_soc.clock_limits[i].dtbclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
+			dcn3_1_soc.clock_limits[i].phyclk_d18_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
+			dcn3_1_soc.clock_limits[i].phyclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
 		}
-		for (i = 0; i < clk_table->num_entries; i++)
-			dcn3_1_soc.clock_limits[i] = clock_limits[i];
 		if (clk_table->num_entries) {
 			dcn3_1_soc.num_states = clk_table->num_entries;
 		}
@@ -702,7 +699,6 @@ void dcn315_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
 void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params)
 {
 	struct clk_limit_table *clk_table = &bw_params->clk_table;
-	struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES];
 	unsigned int i, closest_clk_lvl;
 	int max_dispclk_mhz = 0, max_dppclk_mhz = 0;
 	int j;
@@ -740,34 +736,32 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
 				closest_clk_lvl = dcn3_16_soc.num_states - 1;
 			}
 
-			clock_limits[i].state = i;
+			dcn3_16_soc.clock_limits[i].state = i;
 
 			/* Clocks dependent on voltage level. */
-			clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
-			if (clk_table->num_entries == 1 &&
-				clock_limits[i].dcfclk_mhz < dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz) {
-				/*SMU fix not released yet*/
-				clock_limits[i].dcfclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz;
-			}
-			clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
-			clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
-			clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2 * clk_table->entries[i].wck_ratio;
+			dcn3_16_soc.clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
+			// if (clk_table->num_entries == 1 &&
+			// 	clock_limits[i].dcfclk_mhz < dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz) {
+			// 	/*SMU fix not released yet*/
+			// 	clock_limits[i].dcfclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz;
+			// }
+			dcn3_16_soc.clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
+			dcn3_16_soc.clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz;
+			dcn3_16_soc.clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2 * clk_table->entries[i].wck_ratio;
 
 			/* Clocks independent of voltage level. */
-			clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz :
+			dcn3_16_soc.clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz :
 				dcn3_16_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
 
-			clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz :
+			dcn3_16_soc.clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz :
 				dcn3_16_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
 
-			clock_limits[i].dram_bw_per_chan_gbps = dcn3_16_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
-			clock_limits[i].dscclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
-			clock_limits[i].dtbclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
-			clock_limits[i].phyclk_d18_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
-			clock_limits[i].phyclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
+			dcn3_16_soc.clock_limits[i].dram_bw_per_chan_gbps = dcn3_16_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
+			dcn3_16_soc.clock_limits[i].dscclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
+			dcn3_16_soc.clock_limits[i].dtbclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
+			dcn3_16_soc.clock_limits[i].phyclk_d18_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
+			dcn3_16_soc.clock_limits[i].phyclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
 		}
-		for (i = 0; i < clk_table->num_entries; i++)
-			dcn3_16_soc.clock_limits[i] = clock_limits[i];
 		if (clk_table->num_entries) {
 			dcn3_16_soc.num_states = clk_table->num_entries;
 		}
-- 
2.36.1


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

* [PATCH 07/23] drm/amd/display: Reduce frame size in the bouding box for DCN21
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (5 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 06/23] drm/amd/display: Reduce frame size in the bouding box for DCN31/316 Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 08/23] drm/amd/display: dsc validate fail not pass to atomic check Hamza Mahfooz
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Dmytro Laktyushkin, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, hamza.mahfooz, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

GCC throw warnings for the function dcn21_update_bw_bounding_box and
dcn316_update_bw_bounding_box due to its frame size that looks like
this:

 error: the frame size of 1936 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

For fixing this issue I dropped an intermadiate variable.

Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
 .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c  | 29 +++++++++----------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
index d9cc178f6980..c2fec0d85da4 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
@@ -2004,7 +2004,6 @@ void dcn21_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params
 {
 	struct dcn21_resource_pool *pool = TO_DCN21_RES_POOL(dc->res_pool);
 	struct clk_limit_table *clk_table = &bw_params->clk_table;
-	struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES];
 	unsigned int i, closest_clk_lvl = 0, k = 0;
 	int j;
 
@@ -2017,7 +2016,7 @@ void dcn21_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params
 	ASSERT(clk_table->num_entries);
 	/* Copy dcn2_1_soc.clock_limits to clock_limits to avoid copying over null states later */
 	for (i = 0; i < dcn2_1_soc.num_states + 1; i++) {
-		clock_limits[i] = dcn2_1_soc.clock_limits[i];
+		dcn2_1_soc.clock_limits[i] = dcn2_1_soc.clock_limits[i];
 	}
 
 	for (i = 0; i < clk_table->num_entries; i++) {
@@ -2033,24 +2032,22 @@ void dcn21_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params
 		if (i == 1)
 			k++;
 
-		clock_limits[k].state = k;
-		clock_limits[k].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
-		clock_limits[k].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
-		clock_limits[k].socclk_mhz = clk_table->entries[i].socclk_mhz;
-		clock_limits[k].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2;
+		dcn2_1_soc.clock_limits[k].state = k;
+		dcn2_1_soc.clock_limits[k].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz;
+		dcn2_1_soc.clock_limits[k].fabricclk_mhz = clk_table->entries[i].fclk_mhz;
+		dcn2_1_soc.clock_limits[k].socclk_mhz = clk_table->entries[i].socclk_mhz;
+		dcn2_1_soc.clock_limits[k].dram_speed_mts = clk_table->entries[i].memclk_mhz * 2;
 
-		clock_limits[k].dispclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
-		clock_limits[k].dppclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
-		clock_limits[k].dram_bw_per_chan_gbps = dcn2_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
-		clock_limits[k].dscclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
-		clock_limits[k].dtbclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
-		clock_limits[k].phyclk_d18_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
-		clock_limits[k].phyclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
+		dcn2_1_soc.clock_limits[k].dispclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz;
+		dcn2_1_soc.clock_limits[k].dppclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz;
+		dcn2_1_soc.clock_limits[k].dram_bw_per_chan_gbps = dcn2_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps;
+		dcn2_1_soc.clock_limits[k].dscclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz;
+		dcn2_1_soc.clock_limits[k].dtbclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz;
+		dcn2_1_soc.clock_limits[k].phyclk_d18_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz;
+		dcn2_1_soc.clock_limits[k].phyclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz;
 
 		k++;
 	}
-	for (i = 0; i < clk_table->num_entries + 1; i++)
-		dcn2_1_soc.clock_limits[i] = clock_limits[i];
 	if (clk_table->num_entries) {
 		dcn2_1_soc.num_states = clk_table->num_entries + 1;
 		/* fill in min DF PState */
-- 
2.36.1


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

* [PATCH 08/23] drm/amd/display: dsc validate fail not pass to atomic check
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (6 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 07/23] drm/amd/display: Reduce frame size in the bouding box for DCN21 Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 09/23] drm/amd/display: Add debug option for exiting idle optimizations on cursor updates Hamza Mahfooz
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hersen wu, hamza.mahfooz, Wayne Lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: hersen wu <hersenxs.wu@amd.com>

[Why] when 4k@144hz dp connect to dp1.4 dsc mst hub, requested
bandwidth exceeds caps of dsc hub. but dsc bw valid functions,
increase_dsc_bpp, try_disable_dsc, pre_validate_dsc,
compute_mst_dsc_configs_for_state, do not return false to
atomic check. this cause user mode initiate mode set to kernel,
then cause kernel assert, system hang.

[How] dsc bandwidth valid functions return pass or fail to atomic
check.

Reviewed-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: hersen wu <hersenxs.wu@amd.com>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  6 ++-
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 43 +++++++++++++------
 .../display/amdgpu_dm/amdgpu_dm_mst_types.h   |  2 +-
 3 files changed, 35 insertions(+), 16 deletions(-)

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 06da4f2ed7ad..b048e40f23bf 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -11209,7 +11209,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
 				}
 			}
 		}
-		pre_validate_dsc(state, &dm_state, vars);
+		if (!pre_validate_dsc(state, &dm_state, vars)) {
+			ret = -EINVAL;
+			goto fail;
+		}
 	}
 #endif
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
@@ -11455,6 +11458,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
 #if defined(CONFIG_DRM_AMD_DC_DCN)
 		if (!compute_mst_dsc_configs_for_state(state, dm_state->context, vars)) {
 			DRM_DEBUG_DRIVER("compute_mst_dsc_configs_for_state() failed\n");
+			ret = -EINVAL;
 			goto fail;
 		}
 
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 78df51b8693e..bdfe5a9a08dd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -670,7 +670,7 @@ static int bpp_x16_from_pbn(struct dsc_mst_fairness_params param, int pbn)
 	return dsc_config.bits_per_pixel;
 }
 
-static void increase_dsc_bpp(struct drm_atomic_state *state,
+static bool increase_dsc_bpp(struct drm_atomic_state *state,
 			     struct dc_link *dc_link,
 			     struct dsc_mst_fairness_params *params,
 			     struct dsc_mst_fairness_vars *vars,
@@ -730,7 +730,7 @@ static void increase_dsc_bpp(struct drm_atomic_state *state,
 							  params[next_index].port,
 							  vars[next_index].pbn,
 							  pbn_per_timeslot) < 0)
-				return;
+				return false;
 			if (!drm_dp_mst_atomic_check(state)) {
 				vars[next_index].bpp_x16 = bpp_x16_from_pbn(params[next_index], vars[next_index].pbn);
 			} else {
@@ -740,7 +740,7 @@ static void increase_dsc_bpp(struct drm_atomic_state *state,
 								  params[next_index].port,
 								  vars[next_index].pbn,
 								  pbn_per_timeslot) < 0)
-					return;
+					return false;
 			}
 		} else {
 			vars[next_index].pbn += initial_slack[next_index];
@@ -749,7 +749,7 @@ static void increase_dsc_bpp(struct drm_atomic_state *state,
 							  params[next_index].port,
 							  vars[next_index].pbn,
 							  pbn_per_timeslot) < 0)
-				return;
+				return false;
 			if (!drm_dp_mst_atomic_check(state)) {
 				vars[next_index].bpp_x16 = params[next_index].bw_range.max_target_bpp_x16;
 			} else {
@@ -759,16 +759,17 @@ static void increase_dsc_bpp(struct drm_atomic_state *state,
 								  params[next_index].port,
 								  vars[next_index].pbn,
 								  pbn_per_timeslot) < 0)
-					return;
+					return false;
 			}
 		}
 
 		bpp_increased[next_index] = true;
 		remaining_to_increase--;
 	}
+	return true;
 }
 
-static void try_disable_dsc(struct drm_atomic_state *state,
+static bool try_disable_dsc(struct drm_atomic_state *state,
 			    struct dc_link *dc_link,
 			    struct dsc_mst_fairness_params *params,
 			    struct dsc_mst_fairness_vars *vars,
@@ -816,7 +817,7 @@ static void try_disable_dsc(struct drm_atomic_state *state,
 						  params[next_index].port,
 						  vars[next_index].pbn,
 						  dm_mst_get_pbn_divider(dc_link)) < 0)
-			return;
+			return false;
 
 		if (!drm_dp_mst_atomic_check(state)) {
 			vars[next_index].dsc_enabled = false;
@@ -828,12 +829,13 @@ static void try_disable_dsc(struct drm_atomic_state *state,
 							  params[next_index].port,
 							  vars[next_index].pbn,
 							  dm_mst_get_pbn_divider(dc_link)) < 0)
-				return;
+				return false;
 		}
 
 		tried[next_index] = true;
 		remaining_to_try--;
 	}
+	return true;
 }
 
 static bool compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,
@@ -949,9 +951,11 @@ static bool compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,
 		return false;
 
 	/* Optimize degree of compression */
-	increase_dsc_bpp(state, dc_link, params, vars, count, k);
+	if (!increase_dsc_bpp(state, dc_link, params, vars, count, k))
+		return false;
 
-	try_disable_dsc(state, dc_link, params, vars, count, k);
+	if (!try_disable_dsc(state, dc_link, params, vars, count, k))
+		return false;
 
 	set_dsc_configs_from_fairness_vars(params, vars, count, k);
 
@@ -1223,21 +1227,22 @@ static bool is_dsc_precompute_needed(struct drm_atomic_state *state)
 	return ret;
 }
 
-void pre_validate_dsc(struct drm_atomic_state *state,
+bool pre_validate_dsc(struct drm_atomic_state *state,
 		      struct dm_atomic_state **dm_state_ptr,
 		      struct dsc_mst_fairness_vars *vars)
 {
 	int i;
 	struct dm_atomic_state *dm_state;
 	struct dc_state *local_dc_state = NULL;
+	int ret = 0;
 
 	if (!is_dsc_precompute_needed(state)) {
 		DRM_INFO_ONCE("DSC precompute is not needed.\n");
-		return;
+		return true;
 	}
 	if (dm_atomic_get_state(state, dm_state_ptr)) {
 		DRM_INFO_ONCE("dm_atomic_get_state() failed\n");
-		return;
+		return false;
 	}
 	dm_state = *dm_state_ptr;
 
@@ -1249,7 +1254,7 @@ void pre_validate_dsc(struct drm_atomic_state *state,
 
 	local_dc_state = kmemdup(dm_state->context, sizeof(struct dc_state), GFP_KERNEL);
 	if (!local_dc_state)
-		return;
+		return false;
 
 	for (i = 0; i < local_dc_state->stream_count; i++) {
 		struct dc_stream_state *stream = dm_state->context->streams[i];
@@ -1275,11 +1280,19 @@ void pre_validate_dsc(struct drm_atomic_state *state,
 								&state->crtcs[ind].new_state->mode,
 								dm_new_conn_state,
 								dm_old_crtc_state->stream);
+			if (local_dc_state->streams[i] == NULL) {
+				ret = -EINVAL;
+				break;
+			}
 		}
 	}
 
+	if (ret != 0)
+		goto clean_exit;
+
 	if (!pre_compute_mst_dsc_configs_for_state(state, local_dc_state, vars)) {
 		DRM_INFO_ONCE("pre_compute_mst_dsc_configs_for_state() failed\n");
+		ret = -EINVAL;
 		goto clean_exit;
 	}
 
@@ -1309,5 +1322,7 @@ void pre_validate_dsc(struct drm_atomic_state *state,
 	}
 
 	kfree(local_dc_state);
+
+	return (ret == 0);
 }
 #endif
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h
index 85628ad59e6c..2e13027d9b88 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h
@@ -59,7 +59,7 @@ bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
 
 bool needs_dsc_aux_workaround(struct dc_link *link);
 
-void pre_validate_dsc(struct drm_atomic_state *state,
+bool pre_validate_dsc(struct drm_atomic_state *state,
 		      struct dm_atomic_state **dm_state_ptr,
 		      struct dsc_mst_fairness_vars *vars);
 
-- 
2.36.1


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

* [PATCH 09/23] drm/amd/display: Add debug option for exiting idle optimizations on cursor updates
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (7 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 08/23] drm/amd/display: dsc validate fail not pass to atomic check Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 10/23] drm/amd/display: update topology_update_input_v3 struct Hamza Mahfooz
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, Samson Tam, Lee, Alvin, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, hamza.mahfooz, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: "Lee, Alvin" <Alvin.Lee2@amd.com>

[Description]
- Have option to exit idle opt on cursor updates
for debug and optimizations purposes

Reviewed-by: Samson Tam <Samson.Tam@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 5 +++--
 drivers/gpu/drm/amd/display/dc/dc.h             | 1 +
 2 files changed, 4 insertions(+), 2 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 de8b214132a2..167bb3310877 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -389,7 +389,7 @@ bool dc_stream_set_cursor_position(
 	struct dc_stream_state *stream,
 	const struct dc_cursor_position *position)
 {
-	struct dc  *dc;
+	struct dc  *dc = stream->ctx->dc;
 	bool reset_idle_optimizations = false;
 
 	if (NULL == stream) {
@@ -406,7 +406,8 @@ bool dc_stream_set_cursor_position(
 	dc_z10_restore(dc);
 
 	/* disable idle optimizations if enabling cursor */
-	if (dc->idle_optimizations_allowed && !stream->cursor_position.enable && position->enable) {
+	if (dc->idle_optimizations_allowed && (!stream->cursor_position.enable || dc->debug.exit_idle_opt_for_cursor_updates)
+			&& position->enable) {
 		dc_allow_idle_optimizations(dc, false);
 		reset_idle_optimizations = true;
 	}
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 76db013aac6e..7191fc48c2e7 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -748,6 +748,7 @@ struct dc_debug_options {
 	uint8_t psr_power_use_phy_fsm;
 	enum dml_hostvm_override_opts dml_hostvm_override;
 	bool use_legacy_soc_bb_mechanism;
+	bool exit_idle_opt_for_cursor_updates;
 };
 
 struct gpu_info_soc_bounding_box_v1_0;
-- 
2.36.1


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

* [PATCH 10/23] drm/amd/display: update topology_update_input_v3 struct
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (8 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 09/23] drm/amd/display: Add debug option for exiting idle optimizations on cursor updates Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 11/23] drm/amd/display: 3.2.190 Hamza Mahfooz
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Qingqing Zhuo <qingqing.zhuo@amd.com>

[Why]
DIO parameters were missing in topology_update_intput_v3 struct.

[How]
Add DIO parameters in v3 struct and update in functions perspectively.

Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |  2 ++
 drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c   |  4 ++++
 drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h   | 11 +++++++++++
 3 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
index bf0d50277f8f..c76b628e6791 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
@@ -476,6 +476,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
 	link->ddc_line = aconnector->dc_link->ddc_hw_inst + 1;
 	display->stream_enc_idx = config->stream_enc_idx;
 	link->link_enc_idx = config->link_enc_idx;
+	link->dio_output_id = config->dio_output_idx;
 	link->phy_idx = config->phy_idx;
 	if (sink)
 		link_is_hdcp14 = dc_link_is_hdcp14(aconnector->dc_link, sink->sink_signal);
@@ -483,6 +484,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
 	link->dp.rev = aconnector->dc_link->dpcd_caps.dpcd_rev.raw;
 	link->dp.assr_enabled = config->assr_enabled;
 	link->dp.mst_enabled = config->mst_enabled;
+	link->dp.usb4_enabled = config->usb4_enabled;
 	display->adjust.disable = MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION;
 	link->adjust.auth_delay = 3;
 	link->adjust.hdcp1.disable = 0;
diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c
index be61975f1470..ee67a35c2a8e 100644
--- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c
+++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c
@@ -202,6 +202,10 @@ static enum mod_hdcp_status add_display_to_topology_v3(
 	dtm_cmd->dtm_status = TA_DTM_STATUS__GENERIC_FAILURE;
 	dtm_cmd->dtm_in_message.topology_update_v3.phy_id = link->phy_idx;
 	dtm_cmd->dtm_in_message.topology_update_v3.link_hdcp_cap = link->hdcp_supported_informational;
+	dtm_cmd->dtm_in_message.topology_update_v3.dio_output_type = link->dp.usb4_enabled ?
+			TA_DTM_DIO_OUTPUT_TYPE__DPIA :
+			TA_DTM_DIO_OUTPUT_TYPE__DIRECT;
+	dtm_cmd->dtm_in_message.topology_update_v3.dio_output_id = link->dio_output_id;
 
 	psp_dtm_invoke(psp, dtm_cmd->cmd_id);
 	mutex_unlock(&psp->dtm_context.mutex);
diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h
index 2937b4b61461..5b71bc96b98c 100644
--- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h
+++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h
@@ -94,6 +94,15 @@ enum ta_dtm_encoder_type {
 	TA_DTM_ENCODER_TYPE__DIG        = 0x10
 };
 
+/* @enum ta_dtm_dio_output_type
+ * This enum defines software value for dio_output_type
+ */
+typedef enum {
+    TA_DTM_DIO_OUTPUT_TYPE__INVALID,
+    TA_DTM_DIO_OUTPUT_TYPE__DIRECT,
+    TA_DTM_DIO_OUTPUT_TYPE__DPIA
+} ta_dtm_dio_output_type;
+
 struct ta_dtm_topology_update_input_v3 {
 	/* display handle is unique across the driver and is used to identify a display */
 	/* for all security interfaces which reference displays such as HDCP */
@@ -111,6 +120,8 @@ struct ta_dtm_topology_update_input_v3 {
 	enum ta_dtm_encoder_type encoder_type;
 	uint32_t phy_id;
 	uint32_t link_hdcp_cap;
+	ta_dtm_dio_output_type dio_output_type;
+	uint32_t dio_output_id;
 };
 
 struct ta_dtm_topology_assr_enable {
-- 
2.36.1


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

* [PATCH 11/23] drm/amd/display: 3.2.190
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (9 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 10/23] drm/amd/display: update topology_update_input_v3 struct Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 12/23] drm/amd/display: Drop unused privacy_mask setters and getters Hamza Mahfooz
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Aric Cyr, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

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

This version brings along the following:
- DP fixes
- Reduced frame size in the bouding boxes of a number of ASICs.
- Exiting idle optimizations on mouse updates

Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 7191fc48c2e7..0549fa2c572a 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -47,7 +47,7 @@ struct aux_payload;
 struct set_config_cmd_payload;
 struct dmub_notification;
 
-#define DC_VER "3.2.189"
+#define DC_VER "3.2.190"
 
 #define MAX_SURFACES 3
 #define MAX_PLANES 6
-- 
2.36.1


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

* [PATCH 12/23] drm/amd/display: Drop unused privacy_mask setters and getters
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (10 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 11/23] drm/amd/display: 3.2.190 Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 13/23] drm/amd/display: Fix comments Hamza Mahfooz
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Charlene Liu, Oliver Logush, Sunpeng.Li,
	Harry.Wentland, qingqing.zhuo, Rodrigo.Siqueira, roman.li,
	Alan Liu, solomon.chiu, jerry.zuo, Aurabindo.Pillai,
	hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha, agustin.gutierrez,
	pavle.kotarac

From: Oliver Logush <oliver.logush@amd.com>

[Why and How]
dwbc_funcs.set/get_privacy_mask isn't being used anymore, drop it

Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Oliver Logush <oliver.logush@amd.com>
---
 drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h
index fd6572ba3fb2..b982be64c792 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h
@@ -219,12 +219,6 @@ struct dwbc_funcs {
 		struct dwbc *dwbc,
 		const struct dc_transfer_func *in_transfer_func_dwb_ogam);
 
-	void (*get_privacy_mask)(
-		struct dwbc *dwbc, uint32_t *mask_id);
-
-	void (*set_privacy_mask)(
-		struct dwbc *dwbc, uint32_t mask_id);
-
 	//TODO: merge with output_transfer_func?
 	bool (*dwb_ogam_set_input_transfer_func)(
 		struct dwbc *dwbc,
-- 
2.36.1


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

* [PATCH 13/23] drm/amd/display: Fix comments
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (11 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 12/23] drm/amd/display: Drop unused privacy_mask setters and getters Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 14/23] drm/amd/display: DAL ACR, dc part, fix missing dcn30 Hamza Mahfooz
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, Samson Tam, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Samson Tam <Samson.Tam@amd.com>

[Why & how]
Fix format and typo of comments.

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Samson Tam <Samson.Tam@amd.com>
---
 .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c  |  1 -
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |  8 ++++++--
 .../dc/gpio/dcn20/hw_translate_dcn20.c        | 17 ++++++++++-------
 .../dc/gpio/dcn21/hw_translate_dcn21.c        | 17 ++++++++++-------
 .../dc/gpio/dcn30/hw_translate_dcn30.c        | 19 +++++++++++--------
 5 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
index cac80ba69072..fb82e9f9738e 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
@@ -436,7 +436,6 @@ void dcn2_read_clocks_from_hw_dentist(struct clk_mgr *clk_mgr_base)
 		clk_mgr_base->clks.dppclk_khz = (DENTIST_DIVIDER_RANGE_SCALE_FACTOR
 				* clk_mgr->base.dentist_vco_freq_khz) / dpp_divider;
 	}
-
 }
 
 void dcn2_get_clock(struct clk_mgr *clk_mgr,
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 7884530cc02b..199868925fe4 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1379,7 +1379,9 @@ bool dc_link_get_hpd_state(struct dc_link *dc_link)
 static enum hpd_source_id get_hpd_line(struct dc_link *link)
 {
 	struct gpio *hpd;
-	enum hpd_source_id hpd_id = HPD_SOURCEID_UNKNOWN;
+	enum hpd_source_id hpd_id;
+
+	hpd_id = HPD_SOURCEID_UNKNOWN;
 
 	hpd = get_hpd_gpio(link->ctx->dc_bios, link->link_id,
 			   link->ctx->gpio_service);
@@ -1418,7 +1420,9 @@ static enum hpd_source_id get_hpd_line(struct dc_link *link)
 static enum channel_id get_ddc_line(struct dc_link *link)
 {
 	struct ddc *ddc;
-	enum channel_id channel = CHANNEL_ID_UNKNOWN;
+	enum channel_id channel;
+
+	channel = CHANNEL_ID_UNKNOWN;
 
 	ddc = dal_ddc_service_get_ddc_pin(link->ddc);
 
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_translate_dcn20.c b/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_translate_dcn20.c
index 52ba62b3b5e4..3005ee7751a0 100644
--- a/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_translate_dcn20.c
+++ b/drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_translate_dcn20.c
@@ -150,7 +150,8 @@ static bool offset_to_id(
 	/* DDC */
 	/* we don't care about the GPIO_ID for DDC
 	 * in DdcHandle it will use GPIO_ID_DDC_DATA/GPIO_ID_DDC_CLOCK
-	 * directly in the create method */
+	 * directly in the create method
+	 */
 	case REG(DC_GPIO_DDC1_A):
 		*en = GPIO_DDC_LINE_DDC1;
 		return true;
@@ -173,14 +174,16 @@ static bool offset_to_id(
 		*en = GPIO_DDC_LINE_DDC_VGA;
 		return true;
 
-//	case REG(DC_GPIO_I2CPAD_A): not exit
-//	case REG(DC_GPIO_PWRSEQ_A):
-//	case REG(DC_GPIO_PAD_STRENGTH_1):
-//	case REG(DC_GPIO_PAD_STRENGTH_2):
-//	case REG(DC_GPIO_DEBUG):
+/*
+ *	case REG(DC_GPIO_I2CPAD_A): not exit
+ *	case REG(DC_GPIO_PWRSEQ_A):
+ *	case REG(DC_GPIO_PAD_STRENGTH_1):
+ *	case REG(DC_GPIO_PAD_STRENGTH_2):
+ *	case REG(DC_GPIO_DEBUG):
+ */
 	/* UNEXPECTED */
 	default:
-//	case REG(DC_GPIO_SYNCA_A): not exist
+/*	case REG(DC_GPIO_SYNCA_A): not exist */
 		ASSERT_CRITICAL(false);
 		return false;
 	}
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/dcn21/hw_translate_dcn21.c b/drivers/gpu/drm/amd/display/dc/gpio/dcn21/hw_translate_dcn21.c
index 291966efe63d..d734e3a134d1 100644
--- a/drivers/gpu/drm/amd/display/dc/gpio/dcn21/hw_translate_dcn21.c
+++ b/drivers/gpu/drm/amd/display/dc/gpio/dcn21/hw_translate_dcn21.c
@@ -153,7 +153,8 @@ static bool offset_to_id(
 	/* DDC */
 	/* we don't care about the GPIO_ID for DDC
 	 * in DdcHandle it will use GPIO_ID_DDC_DATA/GPIO_ID_DDC_CLOCK
-	 * directly in the create method */
+	 * directly in the create method
+	 */
 	case REG(DC_GPIO_DDC1_A):
 		*en = GPIO_DDC_LINE_DDC1;
 		return true;
@@ -173,14 +174,16 @@ static bool offset_to_id(
 		*en = GPIO_DDC_LINE_DDC_VGA;
 		return true;
 
-//	case REG(DC_GPIO_I2CPAD_A): not exit
-//	case REG(DC_GPIO_PWRSEQ_A):
-//	case REG(DC_GPIO_PAD_STRENGTH_1):
-//	case REG(DC_GPIO_PAD_STRENGTH_2):
-//	case REG(DC_GPIO_DEBUG):
+/*
+ *	case REG(DC_GPIO_I2CPAD_A): not exit
+ *	case REG(DC_GPIO_PWRSEQ_A):
+ *	case REG(DC_GPIO_PAD_STRENGTH_1):
+ *	case REG(DC_GPIO_PAD_STRENGTH_2):
+ *	case REG(DC_GPIO_DEBUG):
+ */
 	/* UNEXPECTED */
 	default:
-//	case REG(DC_GPIO_SYNCA_A): not exist
+/*	case REG(DC_GPIO_SYNCA_A): not exista */
 #ifdef PALLADIUM_SUPPORTED
 		*id = GPIO_ID_HPD;
 		*en = GPIO_DDC_LINE_DDC1;
diff --git a/drivers/gpu/drm/amd/display/dc/gpio/dcn30/hw_translate_dcn30.c b/drivers/gpu/drm/amd/display/dc/gpio/dcn30/hw_translate_dcn30.c
index 3169c567475f..49d6250037a9 100644
--- a/drivers/gpu/drm/amd/display/dc/gpio/dcn30/hw_translate_dcn30.c
+++ b/drivers/gpu/drm/amd/display/dc/gpio/dcn30/hw_translate_dcn30.c
@@ -155,7 +155,8 @@ static bool offset_to_id(
 	/* DDC */
 	/* we don't care about the GPIO_ID for DDC
 	 * in DdcHandle it will use GPIO_ID_DDC_DATA/GPIO_ID_DDC_CLOCK
-	 * directly in the create method */
+	 * directly in the create method
+	 */
 	case REG(DC_GPIO_DDC1_A):
 		*en = GPIO_DDC_LINE_DDC1;
 		return true;
@@ -178,14 +179,16 @@ static bool offset_to_id(
 		*en = GPIO_DDC_LINE_DDC_VGA;
 		return true;
 
-//	case REG(DC_GPIO_I2CPAD_A): not exit
-//	case REG(DC_GPIO_PWRSEQ_A):
-//	case REG(DC_GPIO_PAD_STRENGTH_1):
-//	case REG(DC_GPIO_PAD_STRENGTH_2):
-//	case REG(DC_GPIO_DEBUG):
+/*
+ *	case REG(DC_GPIO_I2CPAD_A): not exit
+ *	case REG(DC_GPIO_PWRSEQ_A):
+ *	case REG(DC_GPIO_PAD_STRENGTH_1):
+ *	case REG(DC_GPIO_PAD_STRENGTH_2):
+ *	case REG(DC_GPIO_DEBUG):
+ */
 	/* UNEXPECTED */
 	default:
-//	case REG(DC_GPIO_SYNCA_A): not exist
+/*	case REG(DC_GPIO_SYNCA_A): not exist */
 		ASSERT_CRITICAL(false);
 		return false;
 	}
@@ -369,7 +372,7 @@ static const struct hw_translate_funcs funcs = {
 };
 
 /*
- * dal_hw_translate_dcn10_init
+ * dal_hw_translate_dcn30_init
  *
  * @brief
  * Initialize Hw translate function pointers.
-- 
2.36.1


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

* [PATCH 14/23] drm/amd/display: DAL ACR, dc part, fix missing dcn30
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (12 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 13/23] drm/amd/display: Fix comments Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 15/23] drm/amd/display: Firmware assisted MCLK switch and FS Hamza Mahfooz
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Ian Chen, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, Alan Liu, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Ian Chen <ian.chen@amd.com>

[Why]
- missing in dcn30 function
- Fix a divide by 0 when ACR trigger

[How]
- Add IS_SMU_TIMEOUT() to dcn30_smu_send_msg_with_param
- Add zero check in dcn20_update_clocks_update_dentist

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Ian Chen <ian.chen@amd.com>
---
 .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c  | 22 +++++++++++++------
 .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c  | 11 +++++++++-
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
index fb82e9f9738e..0d30d1d9d67e 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
@@ -126,16 +126,24 @@ void dcn20_update_clocks_update_dpp_dto(struct clk_mgr_internal *clk_mgr,
 
 void dcn20_update_clocks_update_dentist(struct clk_mgr_internal *clk_mgr, struct dc_state *context)
 {
-	int dpp_divider = DENTIST_DIVIDER_RANGE_SCALE_FACTOR
-			* clk_mgr->base.dentist_vco_freq_khz / clk_mgr->base.clks.dppclk_khz;
-	int disp_divider = DENTIST_DIVIDER_RANGE_SCALE_FACTOR
-			* clk_mgr->base.dentist_vco_freq_khz / clk_mgr->base.clks.dispclk_khz;
-
-	uint32_t dppclk_wdivider = dentist_get_did_from_divider(dpp_divider);
-	uint32_t dispclk_wdivider = dentist_get_did_from_divider(disp_divider);
+	int dpp_divider = 0;
+	int disp_divider = 0;
+	uint32_t dppclk_wdivider = 0;
+	uint32_t dispclk_wdivider = 0;
 	uint32_t current_dispclk_wdivider;
 	uint32_t i;
 
+	if (clk_mgr->base.clks.dppclk_khz == 0 || clk_mgr->base.clks.dispclk_khz == 0)
+		return;
+
+	dpp_divider = DENTIST_DIVIDER_RANGE_SCALE_FACTOR
+		* clk_mgr->base.dentist_vco_freq_khz / clk_mgr->base.clks.dppclk_khz;
+	disp_divider = DENTIST_DIVIDER_RANGE_SCALE_FACTOR
+		* clk_mgr->base.dentist_vco_freq_khz / clk_mgr->base.clks.dispclk_khz;
+
+	dppclk_wdivider = dentist_get_did_from_divider(dpp_divider);
+	dispclk_wdivider = dentist_get_did_from_divider(disp_divider);
+
 	REG_GET(DENTIST_DISPCLK_CNTL,
 			DENTIST_DISPCLK_WDIVIDER, &current_dispclk_wdivider);
 
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c
index bfc960579760..1fbf1c105dc1 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c
@@ -28,6 +28,8 @@
 
 #include "clk_mgr_internal.h"
 #include "reg_helper.h"
+#include "dm_helpers.h"
+
 #include "dalsmc.h"
 #include "dcn30_smu11_driver_if.h"
 
@@ -74,6 +76,7 @@ static uint32_t dcn30_smu_wait_for_response(struct clk_mgr_internal *clk_mgr, un
 
 static bool dcn30_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, uint32_t msg_id, uint32_t param_in, uint32_t *param_out)
 {
+	uint32_t result;
 	/* Wait for response register to be ready */
 	dcn30_smu_wait_for_response(clk_mgr, 10, 200000);
 
@@ -86,8 +89,14 @@ static bool dcn30_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, uint
 	/* Trigger the message transaction by writing the message ID */
 	REG_WRITE(DAL_MSG_REG, msg_id);
 
+	result = dcn30_smu_wait_for_response(clk_mgr, 10, 200000);
+
+	if (IS_SMU_TIMEOUT(result)) {
+		dm_helpers_smu_timeout(CTX, msg_id, param_in, 10 * 200000);
+	}
+
 	/* Wait for response */
-	if (dcn30_smu_wait_for_response(clk_mgr, 10, 200000) == DALSMC_Result_OK) {
+	if (result == DALSMC_Result_OK) {
 		if (param_out)
 			*param_out = REG_READ(DAL_ARG_REG);
 
-- 
2.36.1


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

* [PATCH 15/23] drm/amd/display: Firmware assisted MCLK switch and FS
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (13 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 14/23] drm/amd/display: DAL ACR, dc part, fix missing dcn30 Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 16/23] drm/amd/display: Add support for HF-VSIF Hamza Mahfooz
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Felipe Clark, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, Alan Liu,
	solomon.chiu, jerry.zuo, Aurabindo.Pillai, hamza.mahfooz,
	wayne.lin, Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Felipe <Felipe.Clark@amd.com>

[WHY]
Memory clock switching has great potential for power savings.

[HOW]
The driver code was modified to notify the DMCUB firmware that it should
stretch the vertical blank of frames when a memory clock switch is about
to start so that no blackouts happen on the screen due to unavailability
of the frame buffer.
The driver logic to determine when such firmware assisted strategy can
be initiated is also implemented and consists on checking prerequisites
of the feature.

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Felipe Clark <felipe.clark@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c      |  8 ++++--
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |  2 ++
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h  |  5 +++-
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |  3 +-
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c |  1 -
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    |  1 -
 .../drm/amd/display/dc/dcn30/dcn30_hwseq.c    | 28 +++++++++++--------
 .../drm/amd/display/dc/dcn30/dcn30_hwseq.h    | 11 ++++++--
 .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c |  2 +-
 .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c |  1 +
 .../drm/amd/display/dc/dcn30/dcn30_resource.c |  1 +
 .../amd/display/dc/inc/hw_sequencer_private.h |  1 +
 .../amd/display/modules/freesync/freesync.c   |  5 ++++
 .../amd/display/modules/inc/mod_freesync.h    |  4 +++
 14 files changed, 51 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 645ec5bc3a7d..cfa6c2d1fc69 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -397,7 +397,6 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
 		struct dc_crtc_timing_adjust *adjust)
 {
 	int i;
-	bool ret = false;
 
 	stream->adjust.v_total_max = adjust->v_total_max;
 	stream->adjust.v_total_mid = adjust->v_total_mid;
@@ -412,10 +411,10 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
 					1,
 					*adjust);
 
-			ret = true;
+			return true;
 		}
 	}
-	return ret;
+	return false;
 }
 
 /**
@@ -2650,6 +2649,9 @@ static void copy_stream_update_to_stream(struct dc *dc,
 	if (update->vrr_infopacket)
 		stream->vrr_infopacket = *update->vrr_infopacket;
 
+	if (update->allow_freesync)
+		stream->allow_freesync = *update->allow_freesync;
+
 	if (update->crtc_timing_adjust)
 		stream->adjust = *update->crtc_timing_adjust;
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index 11597bca966a..548c91ad1b82 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -27,6 +27,8 @@
 #include "dc_dmub_srv.h"
 #include "../dmub/dmub_srv.h"
 #include "dm_helpers.h"
+#include "dc_hw_types.h"
+#include "core_types.h"
 
 #define CTX dc_dmub_srv->ctx
 #define DC_LOGGER CTX->logger
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
index 50e44b53f14c..52758ff1e405 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
@@ -31,6 +31,10 @@
 
 struct dmub_srv;
 struct dc;
+struct pipe_ctx;
+struct dc_crtc_timing_adjust;
+struct dc_crtc_timing;
+struct dc_state;
 
 struct dc_reg_helper_state {
 	bool gather_in_progress;
@@ -69,7 +73,6 @@ bool dc_dmub_srv_get_dmub_outbox0_msg(const struct dc *dc, struct dmcub_trace_bu
 void dc_dmub_trace_event_control(struct dc *dc, bool enable);
 
 void dc_dmub_srv_query_caps_cmd(struct dmub_srv *dmub);
-
 void dc_dmub_srv_clear_inbox0_ack(struct dc_dmub_srv *dmub_srv);
 void dc_dmub_srv_wait_for_inbox0_ack(struct dc_dmub_srv *dmub_srv);
 void dc_dmub_srv_send_inbox0_cmd(struct dc_dmub_srv *dmub_srv, union dmub_inbox0_data_register data);
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index f8f66790d09b..68cf06a5a3e3 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -205,6 +205,7 @@ struct dc_stream_state {
 	bool use_vsc_sdp_for_colorimetry;
 	bool ignore_msa_timing_param;
 
+	bool allow_freesync;
 	bool freesync_on_desktop;
 
 	bool converter_disable_audio;
@@ -295,9 +296,9 @@ struct dc_stream_update {
 	struct dc_info_packet *vrr_infopacket;
 	struct dc_info_packet *vsc_infopacket;
 	struct dc_info_packet *vsp_infopacket;
-
 	bool *dpms_off;
 	bool integer_scaling_update;
+	bool *allow_freesync;
 
 	struct colorspace_transform *gamut_remap;
 	enum dc_color_space *output_color_space;
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 573d5be9e302..fff724e94eed 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
@@ -2613,7 +2613,6 @@ void dcn10_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
 	dc->hwss.update_visual_confirm_color(dc, pipe_ctx, &blnd_cfg.black_color, mpcc_id);
 
 	ASSERT(new_mpcc != NULL);
-
 	hubp->opp_id = pipe_ctx->stream_res.opp->inst;
 	hubp->mpcc_id = mpcc_id;
 }
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index facd4e01b7ac..76f8b40b2165 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -2446,7 +2446,6 @@ void dcn20_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)
 			NULL,
 			hubp->inst,
 			mpcc_id);
-
 	dc->hwss.update_visual_confirm_color(dc, pipe_ctx, &blnd_cfg.black_color, mpcc_id);
 
 	ASSERT(new_mpcc != NULL);
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
index ecdc7c781217..08b8893ff145 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
@@ -48,6 +48,8 @@
 #include "dc_dmub_srv.h"
 #include "link_hwss.h"
 #include "dpcd_defs.h"
+#include "../dcn20/dcn20_hwseq.h"
+#include "dcn30_resource.h"
 #include "inc/dc_link_dp.h"
 #include "inc/link_dpcd.h"
 
@@ -344,17 +346,6 @@ void dcn30_enable_writeback(
 	dwb->funcs->enable(dwb, &wb_info->dwb_params);
 }
 
-void dcn30_prepare_bandwidth(struct dc *dc,
- 	struct dc_state *context)
-{
-	if (dc->clk_mgr->dc_mode_softmax_enabled)
-		if (dc->clk_mgr->clks.dramclk_khz <= dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000 &&
-				context->bw_ctx.bw.dcn.clk.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000)
-			dc->clk_mgr->funcs->set_max_memclk(dc->clk_mgr, dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries - 1].memclk_mhz);
-
- 	dcn20_prepare_bandwidth(dc, context);
-}
-
 void dcn30_disable_writeback(
 		struct dc *dc,
 		unsigned int dwb_pipe_inst)
@@ -647,6 +638,9 @@ void dcn30_init_hw(struct dc *dc)
 	if (dc->res_pool->hubbub->funcs->init_crb)
 		dc->res_pool->hubbub->funcs->init_crb(dc->res_pool->hubbub);
 
+	// Get DMCUB capabilities
+	dc_dmub_srv_query_caps_cmd(dc->ctx->dmub_srv->dmub);
+	dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr;
 }
 
 void dcn30_set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
@@ -962,3 +956,15 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc,
 	pipe_ctx->stream_res.opp->funcs->opp_set_disp_pattern_generator(pipe_ctx->stream_res.opp, test_pattern,
 			color_space, color_depth, solid_color, width, height, offset);
 }
+
+void dcn30_prepare_bandwidth(struct dc *dc,
+ 	struct dc_state *context)
+{
+	if (dc->clk_mgr->dc_mode_softmax_enabled)
+		if (dc->clk_mgr->clks.dramclk_khz <= dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000 &&
+				context->bw_ctx.bw.dcn.clk.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000)
+			dc->clk_mgr->funcs->set_max_memclk(dc->clk_mgr, dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries - 1].memclk_mhz);
+
+ 	dcn20_prepare_bandwidth(dc, context);
+}
+
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.h b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.h
index 73e7b690e82c..a24a8e33a3d2 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.h
@@ -47,9 +47,6 @@ void dcn30_disable_writeback(
 		struct dc *dc,
 		unsigned int dwb_pipe_inst);
 
-void dcn30_prepare_bandwidth(struct dc *dc,
- 	struct dc_state *context);
-
 bool dcn30_mmhubbub_warmup(
 	struct dc *dc,
 	unsigned int num_dwb,
@@ -83,4 +80,12 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc,
 		const struct tg_color *solid_color,
 		int width, int height, int offset);
 
+void dcn30_set_hubp_blank(const struct dc *dc,
+		struct pipe_ctx *pipe_ctx,
+		bool blank_enable);
+
+void dcn30_prepare_bandwidth(struct dc *dc,
+	struct dc_state *context);
+
+
 #endif /* __DC_HWSS_DCN30_H__ */
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c
index bb347319de83..4c06e6e1ba4a 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c
@@ -59,7 +59,7 @@ static const struct hw_sequencer_funcs dcn30_funcs = {
 	.pipe_control_lock = dcn20_pipe_control_lock,
 	.interdependent_update_lock = dcn10_lock_all_pipes,
 	.cursor_lock = dcn10_cursor_lock,
-	.prepare_bandwidth = dcn20_prepare_bandwidth,
+	.prepare_bandwidth = dcn30_prepare_bandwidth,
 	.optimize_bandwidth = dcn20_optimize_bandwidth,
 	.update_bandwidth = dcn20_update_bandwidth,
 	.set_drr = dcn10_set_drr,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c
index b604fb26f288..9a440ae8f865 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c
@@ -27,6 +27,7 @@
 #include "dcn30_optc.h"
 #include "dc.h"
 #include "dcn_calc_math.h"
+#include "dc_dmub_srv.h"
 
 #include "dml/dcn30/dcn30_fpu.h"
 
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
index 1c1a67c4cec1..4cf9a6cff46e 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
@@ -89,6 +89,7 @@
 #include "vm_helper.h"
 #include "dcn20/dcn20_vmid.h"
 #include "amdgpu_socbb.h"
+#include "dc_dmub_srv.h"
 
 #define DC_LOGGER_INIT(logger)
 
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h
index 62a62e4fc4a8..ded45f8f4b82 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h
@@ -68,6 +68,7 @@ struct dce_hwseq;
 struct timing_generator;
 struct tg_color;
 struct output_pixel_processor;
+struct mpcc_blnd_cfg;
 
 struct hwseq_private_funcs {
 
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 03fa63d56fa6..aa121d45d9b8 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -1374,6 +1374,11 @@ unsigned long long mod_freesync_calc_field_rate_from_timing(
 	return field_rate_in_uhz;
 }
 
+bool mod_freesync_get_freesync_enabled(struct mod_vrr_params *pVrr, struct dc_stream_state *const pStream)
+{
+	return (pVrr->state != VRR_STATE_UNSUPPORTED) && (pVrr->state != VRR_STATE_DISABLED);
+}
+
 bool mod_freesync_is_valid_range(uint32_t min_refresh_cap_in_uhz,
 		uint32_t max_refresh_cap_in_uhz,
 		uint32_t nominal_field_rate_in_uhz)
diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h b/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h
index cf6bc9446244..62e326dd29a8 100644
--- a/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h
+++ b/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h
@@ -194,4 +194,8 @@ unsigned int mod_freesync_calc_v_total_from_refresh(
 		const struct dc_stream_state *stream,
 		unsigned int refresh_in_uhz);
 
+// Returns true when FreeSync is supported and enabled (even if it is inactive)
+bool mod_freesync_get_freesync_enabled(struct mod_vrr_params *pVrr,
+		struct dc_stream_state *const pStream);
+
 #endif
-- 
2.36.1


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

* [PATCH 16/23] drm/amd/display: Add support for HF-VSIF
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (14 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 15/23] drm/amd/display: Firmware assisted MCLK switch and FS Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 17/23] drm/amd/display: Copy hfvsif_infopacket when stream update Hamza Mahfooz
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, Ahmad Othman, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, hamza.mahfooz, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Ahmad Othman <ahmad.othman@amd.com>

[Why]
- Currently there is no support for HF-VSIF
- The current support of VSIF is limited to H14b infoframe

[How]
- refactor VSIF
- Added new builder for HF-VSIF
- Added the HF-VSIF packet to DisplayTarget
- Updates DC to apply HF-VSIF updates when updating streams

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Ahmad Othman <ahmad.othman@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c              |  3 ++-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c     | 11 +++++++++++
 drivers/gpu/drm/amd/display/dc/dc_stream.h            |  2 ++
 .../drm/amd/display/dc/dcn10/dcn10_stream_encoder.c   |  8 +++++---
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index cfa6c2d1fc69..7d71fd61c0a5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -2732,7 +2732,8 @@ static void commit_planes_do_stream_update(struct dc *dc,
 			if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) ||
 					stream_update->vrr_infopacket ||
 					stream_update->vsc_infopacket ||
-					stream_update->vsp_infopacket) {
+					stream_update->vsp_infopacket ||
+					stream_update->hfvsif_infopacket) {
 				resource_build_info_frame(pipe_ctx);
 				dc->hwss.update_info_frame(pipe_ctx);
 
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 21d217e84192..5749db88b7c3 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -2806,6 +2806,15 @@ static void set_vsc_info_packet(
 
 	*info_packet = stream->vsc_infopacket;
 }
+static void set_hfvs_info_packet(
+		struct dc_info_packet *info_packet,
+		struct dc_stream_state *stream)
+{
+	if (!stream->hfvsif_infopacket.valid)
+		return;
+
+	*info_packet = stream->hfvsif_infopacket;
+}
 
 void dc_resource_state_destruct(struct dc_state *context)
 {
@@ -2886,6 +2895,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
 	info->spd.valid = false;
 	info->hdrsmd.valid = false;
 	info->vsc.valid = false;
+	info->hfvsif.valid = false;
 
 	signal = pipe_ctx->stream->signal;
 
@@ -2894,6 +2904,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
 		set_avi_info_frame(&info->avi, pipe_ctx);
 
 		set_vendor_info_packet(&info->vendor, pipe_ctx->stream);
+		set_hfvs_info_packet(&info->hfvsif, pipe_ctx->stream);
 
 		set_spd_info_packet(&info->spd, pipe_ctx->stream);
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index 68cf06a5a3e3..376dddf54ec1 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -180,6 +180,7 @@ struct dc_stream_state {
 	struct dc_info_packet vrr_infopacket;
 	struct dc_info_packet vsc_infopacket;
 	struct dc_info_packet vsp_infopacket;
+	struct dc_info_packet hfvsif_infopacket;
 	uint8_t dsc_packed_pps[128];
 	struct rect src; /* composition area */
 	struct rect dst; /* stream addressable area */
@@ -296,6 +297,7 @@ struct dc_stream_update {
 	struct dc_info_packet *vrr_infopacket;
 	struct dc_info_packet *vsc_infopacket;
 	struct dc_info_packet *vsp_infopacket;
+	struct dc_info_packet *hfvsif_infopacket;
 	bool *dpms_off;
 	bool integer_scaling_update;
 	bool *allow_freesync;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
index 7608187751c8..92f474e6a96b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
@@ -675,11 +675,13 @@ static void enc1_stream_encoder_update_hdmi_info_packets(
 	/* for bring up, disable dp double  TODO */
 	REG_UPDATE(HDMI_DB_CONTROL, HDMI_DB_DISABLE, 1);
 
+	/*Always add mandatory packets first followed by optional ones*/
 	enc1_update_hdmi_info_packet(enc1, 0, &info_frame->avi);
-	enc1_update_hdmi_info_packet(enc1, 1, &info_frame->vendor);
+	enc1_update_hdmi_info_packet(enc1, 1, &info_frame->hfvsif);
 	enc1_update_hdmi_info_packet(enc1, 2, &info_frame->gamut);
-	enc1_update_hdmi_info_packet(enc1, 3, &info_frame->spd);
-	enc1_update_hdmi_info_packet(enc1, 4, &info_frame->hdrsmd);
+	enc1_update_hdmi_info_packet(enc1, 3, &info_frame->vendor);
+	enc1_update_hdmi_info_packet(enc1, 4, &info_frame->spd);
+	enc1_update_hdmi_info_packet(enc1, 5, &info_frame->hdrsmd);
 }
 
 static void enc1_stream_encoder_stop_hdmi_info_packets(
-- 
2.36.1


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

* [PATCH 17/23] drm/amd/display: Copy hfvsif_infopacket when stream update
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (15 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 16/23] drm/amd/display: Add support for HF-VSIF Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 18/23] drm/amd/display: Adding VTEM to dc Hamza Mahfooz
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha,
	Nicholas Kazlauskas, agustin.gutierrez, pavle.kotarac

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

[Why & How]
Miss to copy hfvsif_infopacket when copying stream updates.
Check and copy it.

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 7d71fd61c0a5..400b37e393b7 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -2658,6 +2658,9 @@ static void copy_stream_update_to_stream(struct dc *dc,
 	if (update->dpms_off)
 		stream->dpms_off = *update->dpms_off;
 
+	if (update->hfvsif_infopacket)
+		stream->hfvsif_infopacket = *update->hfvsif_infopacket;
+
 	if (update->vsc_infopacket)
 		stream->vsc_infopacket = *update->vsc_infopacket;
 
-- 
2.36.1


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

* [PATCH 18/23] drm/amd/display: Adding VTEM to dc
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (16 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 17/23] drm/amd/display: Copy hfvsif_infopacket when stream update Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 19/23] drm/amd/display: Pass vrr mode to dcn Hamza Mahfooz
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, Ahmad Othman, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, hamza.mahfooz, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Ahmad Othman <ahmad.othman@amd.com>

[Why]
Video Timing Extended Metadata packet (VTEM) is required for features
like VRR and FVA

[How]
Adding support for VTEM transmission to stream encoders in DCN20 and DCN30
as part of FVA support

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Ahmad Othman <ahmad.othman@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  6 +++++-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 14 +++++++++++++-
 drivers/gpu/drm/amd/display/dc/dc_stream.h         |  2 ++
 .../amd/display/dc/dcn20/dcn20_stream_encoder.c    |  1 +
 .../display/dc/dcn30/dcn30_dio_stream_encoder.c    |  1 +
 .../gpu/drm/amd/display/dc/inc/hw/stream_encoder.h |  1 +
 6 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 400b37e393b7..7c2b65226131 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -2661,6 +2661,9 @@ static void copy_stream_update_to_stream(struct dc *dc,
 	if (update->hfvsif_infopacket)
 		stream->hfvsif_infopacket = *update->hfvsif_infopacket;
 
+	if (update->vtem_infopacket)
+		stream->vtem_infopacket = *update->vtem_infopacket;
+
 	if (update->vsc_infopacket)
 		stream->vsc_infopacket = *update->vsc_infopacket;
 
@@ -2736,7 +2739,8 @@ static void commit_planes_do_stream_update(struct dc *dc,
 					stream_update->vrr_infopacket ||
 					stream_update->vsc_infopacket ||
 					stream_update->vsp_infopacket ||
-					stream_update->hfvsif_infopacket) {
+					stream_update->hfvsif_infopacket ||
+					stream_update->vtem_infopacket) {
 				resource_build_info_frame(pipe_ctx);
 				dc->hwss.update_info_frame(pipe_ctx);
 
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 5749db88b7c3..60b780385bbd 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -2816,6 +2816,17 @@ static void set_hfvs_info_packet(
 	*info_packet = stream->hfvsif_infopacket;
 }
 
+
+static void set_vtem_info_packet(
+		struct dc_info_packet *info_packet,
+		struct dc_stream_state *stream)
+{
+	if (!stream->vtem_infopacket.valid)
+		return;
+
+	*info_packet = stream->vtem_infopacket;
+}
+
 void dc_resource_state_destruct(struct dc_state *context)
 {
 	int i, j;
@@ -2896,7 +2907,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
 	info->hdrsmd.valid = false;
 	info->vsc.valid = false;
 	info->hfvsif.valid = false;
-
+	info->vtem.valid = false;
 	signal = pipe_ctx->stream->signal;
 
 	/* HDMi and DP have different info packets*/
@@ -2905,6 +2916,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
 
 		set_vendor_info_packet(&info->vendor, pipe_ctx->stream);
 		set_hfvs_info_packet(&info->hfvsif, pipe_ctx->stream);
+		set_vtem_info_packet(&info->vtem, pipe_ctx->stream);
 
 		set_spd_info_packet(&info->spd, pipe_ctx->stream);
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index 376dddf54ec1..c76fac3c153d 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -181,6 +181,7 @@ struct dc_stream_state {
 	struct dc_info_packet vsc_infopacket;
 	struct dc_info_packet vsp_infopacket;
 	struct dc_info_packet hfvsif_infopacket;
+	struct dc_info_packet vtem_infopacket;
 	uint8_t dsc_packed_pps[128];
 	struct rect src; /* composition area */
 	struct rect dst; /* stream addressable area */
@@ -298,6 +299,7 @@ struct dc_stream_update {
 	struct dc_info_packet *vsc_infopacket;
 	struct dc_info_packet *vsp_infopacket;
 	struct dc_info_packet *hfvsif_infopacket;
+	struct dc_info_packet *vtem_infopacket;
 	bool *dpms_off;
 	bool integer_scaling_update;
 	bool *allow_freesync;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c
index aab25ca8343a..e8f5c01688ec 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c
@@ -159,6 +159,7 @@ static void enc2_stream_encoder_update_hdmi_info_packets(
 	enc2_update_hdmi_info_packet(enc1, 3, &info_frame->vendor);
 	enc2_update_hdmi_info_packet(enc1, 4, &info_frame->spd);
 	enc2_update_hdmi_info_packet(enc1, 5, &info_frame->hdrsmd);
+	enc2_update_hdmi_info_packet(enc1, 6, &info_frame->vtem);
 }
 
 static void enc2_stream_encoder_stop_hdmi_info_packets(
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c
index 1a26ce87c16e..25e5c3bc1be9 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c
@@ -212,6 +212,7 @@ void enc3_stream_encoder_update_hdmi_info_packets(
 	enc3_update_hdmi_info_packet(enc1, 1, &info_frame->vendor);
 	enc3_update_hdmi_info_packet(enc1, 3, &info_frame->spd);
 	enc3_update_hdmi_info_packet(enc1, 4, &info_frame->hdrsmd);
+	enc3_update_hdmi_info_packet(enc1, 6, &info_frame->vtem);
 }
 
 void enc3_stream_encoder_stop_hdmi_info_packets(
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h b/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h
index e5fe0f6adc86..e04a51a57c93 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h
@@ -77,6 +77,7 @@ struct encoder_info_frame {
 	struct dc_info_packet gamut;
 	struct dc_info_packet vendor;
 	struct dc_info_packet hfvsif;
+	struct dc_info_packet vtem;
 	/* source product description */
 	struct dc_info_packet spd;
 	/* video stream configuration */
-- 
2.36.1


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

* [PATCH 19/23] drm/amd/display: Pass vrr mode to dcn
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (17 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 18/23] drm/amd/display: Adding VTEM to dc Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games Hamza Mahfooz
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Felipe, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, Alan Liu, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Felipe <Felipe.Clark@amd.com>

[WHY]
New features will require knowing the vrr mode for their enablement.

[HOW]
Pass the state via a member of dc_stream.

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Felipe Clark <Felipe.Clark@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc_stream.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index c76fac3c153d..ae9382ce82d3 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -208,6 +208,7 @@ struct dc_stream_state {
 	bool ignore_msa_timing_param;
 
 	bool allow_freesync;
+	bool vrr_active_variable;
 	bool freesync_on_desktop;
 
 	bool converter_disable_audio;
-- 
2.36.1


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

* [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (18 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 19/23] drm/amd/display: Pass vrr mode to dcn Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-13 10:41   ` Michel Dänzer
  2022-06-10 20:52 ` [PATCH 21/23] drm/amd/display: FVA timing adjustment Hamza Mahfooz
                   ` (3 subsequent siblings)
  23 siblings, 1 reply; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, solomon.chiu, jerry.zuo,
	Aurabindo.Pillai, hamza.mahfooz, Harry VanZyllDeJong, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Harry VanZyllDeJong <harry.vanzylldejong@amd.com>

[WHY]
Game performace may be affected if dynamic memory clock switching
is enabled while playing games.

[HOW]
Propagate the vrr active state to dirty bit so that on mode set it
disables dynamic memory clock switching.

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Harry VanZyllDeJong <harry.vanzylldejong@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c                | 3 +++
 drivers/gpu/drm/amd/display/dc/dc_stream.h              | 1 +
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 2 +-
 drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h  | 3 +--
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 7c2b65226131..49339c5c7230 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -2652,6 +2652,9 @@ static void copy_stream_update_to_stream(struct dc *dc,
 	if (update->allow_freesync)
 		stream->allow_freesync = *update->allow_freesync;
 
+	if (update->vrr_active_variable)
+		stream->vrr_active_variable = *update->vrr_active_variable;
+
 	if (update->crtc_timing_adjust)
 		stream->adjust = *update->crtc_timing_adjust;
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index ae9382ce82d3..5a894c19b0ea 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -304,6 +304,7 @@ struct dc_stream_update {
 	bool *dpms_off;
 	bool integer_scaling_update;
 	bool *allow_freesync;
+	bool *vrr_active_variable;
 
 	struct colorspace_transform *gamut_remap;
 	enum dc_color_space *output_color_space;
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index aa121d45d9b8..0686223034de 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -1374,7 +1374,7 @@ unsigned long long mod_freesync_calc_field_rate_from_timing(
 	return field_rate_in_uhz;
 }
 
-bool mod_freesync_get_freesync_enabled(struct mod_vrr_params *pVrr, struct dc_stream_state *const pStream)
+bool mod_freesync_get_freesync_enabled(struct mod_vrr_params *pVrr)
 {
 	return (pVrr->state != VRR_STATE_UNSUPPORTED) && (pVrr->state != VRR_STATE_DISABLED);
 }
diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h b/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h
index 62e326dd29a8..afe1f6cce528 100644
--- a/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h
+++ b/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h
@@ -195,7 +195,6 @@ unsigned int mod_freesync_calc_v_total_from_refresh(
 		unsigned int refresh_in_uhz);
 
 // Returns true when FreeSync is supported and enabled (even if it is inactive)
-bool mod_freesync_get_freesync_enabled(struct mod_vrr_params *pVrr,
-		struct dc_stream_state *const pStream);
+bool mod_freesync_get_freesync_enabled(struct mod_vrr_params *pVrr);
 
 #endif
-- 
2.36.1


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

* [PATCH 21/23] drm/amd/display: FVA timing adjustment
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (19 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 22/23] drm/amd/display: Add null check to dc_submit_i2c_oem Hamza Mahfooz
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Charlene Liu, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, Alan Liu,
	solomon.chiu, jerry.zuo, Aurabindo.Pillai, hamza.mahfooz,
	wayne.lin, Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

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

[why]
need to add timing adjustment for fva.

[how]
add hook to optc and hwseq.

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
index b1671b00ce40..e1a9a45b03b6 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
@@ -165,6 +165,7 @@ void optc1_program_timing(
 	optc1->vupdate_width = vupdate_width;
 	patched_crtc_timing = *dc_crtc_timing;
 	apply_front_porch_workaround(&patched_crtc_timing);
+	optc1->orginal_patched_timing = patched_crtc_timing;
 
 	/* Load horizontal timing */
 
-- 
2.36.1


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

* [PATCH 22/23] drm/amd/display: Add null check to dc_submit_i2c_oem
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (20 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 21/23] drm/amd/display: FVA timing adjustment Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-10 20:52 ` [PATCH 23/23] drm/amd/display: Blank for uclk OC in dm instead of dc Hamza Mahfooz
  2022-06-13 13:15 ` [PATCH 00/23] DC Patches June 06, 2022 Wheeler, Daniel
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Martin Leung, Rodrigo.Siqueira, roman.li, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, hamza.mahfooz, wayne.lin,
	Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Martin Leung <martin.leung@amd.com>

[why]
dc_submit_i2c_oem could be called with ddc null

[how]
add null check and fail the call instead

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Martin Leung <martin.leung@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 49339c5c7230..258322c39e9a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3477,10 +3477,13 @@ bool dc_submit_i2c_oem(
 		struct i2c_command *cmd)
 {
 	struct ddc_service *ddc = dc->res_pool->oem_device;
-	return dce_i2c_submit_command(
-		dc->res_pool,
-		ddc->ddc_pin,
-		cmd);
+	if (ddc)
+		return dce_i2c_submit_command(
+			dc->res_pool,
+			ddc->ddc_pin,
+			cmd);
+
+	return false;
 }
 
 static bool link_add_remote_sink_helper(struct dc_link *dc_link, struct dc_sink *sink)
-- 
2.36.1


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

* [PATCH 23/23] drm/amd/display: Blank for uclk OC in dm instead of dc
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (21 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 22/23] drm/amd/display: Add null check to dc_submit_i2c_oem Hamza Mahfooz
@ 2022-06-10 20:52 ` Hamza Mahfooz
  2022-06-13 13:15 ` [PATCH 00/23] DC Patches June 06, 2022 Wheeler, Daniel
  23 siblings, 0 replies; 33+ messages in thread
From: Hamza Mahfooz @ 2022-06-10 20:52 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Joshua Aberback, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, Alan Liu,
	solomon.chiu, jerry.zuo, Aurabindo.Pillai, hamza.mahfooz,
	wayne.lin, Bhawanpreet.Lakha, agustin.gutierrez, pavle.kotarac

From: Joshua Aberback <joshua.aberback@amd.com>

[Why]
All displays need to be blanked during the uclk OC interface so that we can
guarantee pstate switching support. If the display config doesn't support
pstate switching, only using core_link_disable_stream will not enable it
as the front-end is untouched. We need to go through the full plane removal
sequence to properly program the pipe to allow pstate switching.

[How]
 - guard clk_mgr functions with non-NULL checks

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 34 +++++++++---------------
 drivers/gpu/drm/amd/display/dc/dc.h      | 10 ++-----
 2 files changed, 14 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 258322c39e9a..48a14a5bda56 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3666,37 +3666,27 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow)
 		dc->idle_optimizations_allowed = allow;
 }
 
-/*
- * blank all streams, and set min and max memory clock to
- * lowest and highest DPM level, respectively
- */
+/* set min and max memory clock to lowest and highest DPM level, respectively */
 void dc_unlock_memory_clock_frequency(struct dc *dc)
 {
-	unsigned int i;
-
-	for (i = 0; i < MAX_PIPES; i++)
-		if (dc->current_state->res_ctx.pipe_ctx[i].plane_state)
-			core_link_disable_stream(&dc->current_state->res_ctx.pipe_ctx[i]);
+	if (dc->clk_mgr->funcs->set_hard_min_memclk)
+		dc->clk_mgr->funcs->set_hard_min_memclk(dc->clk_mgr, false);
 
-	dc->clk_mgr->funcs->set_hard_min_memclk(dc->clk_mgr, false);
-	dc->clk_mgr->funcs->set_hard_max_memclk(dc->clk_mgr);
+	if (dc->clk_mgr->funcs->set_hard_max_memclk)
+		dc->clk_mgr->funcs->set_hard_max_memclk(dc->clk_mgr);
 }
 
-/*
- * set min memory clock to the min required for current mode,
- * max to maxDPM, and unblank streams
- */
+/* set min memory clock to the min required for current mode, max to maxDPM */
 void dc_lock_memory_clock_frequency(struct dc *dc)
 {
-	unsigned int i;
+	if (dc->clk_mgr->funcs->get_memclk_states_from_smu)
+		dc->clk_mgr->funcs->get_memclk_states_from_smu(dc->clk_mgr);
 
-	dc->clk_mgr->funcs->get_memclk_states_from_smu(dc->clk_mgr);
-	dc->clk_mgr->funcs->set_hard_min_memclk(dc->clk_mgr, true);
-	dc->clk_mgr->funcs->set_hard_max_memclk(dc->clk_mgr);
+	if (dc->clk_mgr->funcs->set_hard_min_memclk)
+		dc->clk_mgr->funcs->set_hard_min_memclk(dc->clk_mgr, true);
 
-	for (i = 0; i < MAX_PIPES; i++)
-		if (dc->current_state->res_ctx.pipe_ctx[i].plane_state)
-			core_link_enable_stream(dc->current_state, &dc->current_state->res_ctx.pipe_ctx[i]);
+	if (dc->clk_mgr->funcs->set_hard_max_memclk)
+		dc->clk_mgr->funcs->set_hard_max_memclk(dc->clk_mgr);
 }
 
 static void blank_and_force_memclk(struct dc *dc, bool apply, unsigned int memclk_mhz)
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 0549fa2c572a..ba57e03d3d9e 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -1437,16 +1437,10 @@ bool dc_is_plane_eligible_for_idle_optimizations(struct dc *dc, struct dc_plane_
 
 void dc_allow_idle_optimizations(struct dc *dc, bool allow);
 
-/*
- * blank all streams, and set min and max memory clock to
- * lowest and highest DPM level, respectively
- */
+/* set min and max memory clock to lowest and highest DPM level, respectively */
 void dc_unlock_memory_clock_frequency(struct dc *dc);
 
-/*
- * set min memory clock to the min required for current mode,
- * max to maxDPM, and unblank streams
- */
+/* set min memory clock to the min required for current mode, max to maxDPM */
 void dc_lock_memory_clock_frequency(struct dc *dc);
 
 /* set soft max for memclk, to be used for AC/DC switching clock limitations */
-- 
2.36.1


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

* Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-10 20:52 ` [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games Hamza Mahfooz
@ 2022-06-13 10:41   ` Michel Dänzer
  2022-06-13 12:41     ` VURDIGERENATARAJ, CHANDAN
  0 siblings, 1 reply; 33+ messages in thread
From: Michel Dänzer @ 2022-06-13 10:41 UTC (permalink / raw)
  To: Hamza Mahfooz, amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Bhawanpreet.Lakha,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, solomon.chiu,
	jerry.zuo, Aurabindo.Pillai, Harry VanZyllDeJong, wayne.lin,
	Harry.Wentland, agustin.gutierrez, pavle.kotarac

On 2022-06-10 22:52, Hamza Mahfooz wrote:
> From: Harry VanZyllDeJong <harry.vanzylldejong@amd.com>
> 
> [WHY]
> Game performace may be affected if dynamic memory clock switching
> is enabled while playing games.
> 
> [HOW]
> Propagate the vrr active state to dirty bit so that on mode set it
> disables dynamic memory clock switching.

So dynamic memory clock switching will be disabled whenever VRR is enabled?

Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer

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

* RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-13 10:41   ` Michel Dänzer
@ 2022-06-13 12:41     ` VURDIGERENATARAJ, CHANDAN
  2022-06-13 13:32       ` Vanzylldejong, Harry
  0 siblings, 1 reply; 33+ messages in thread
From: VURDIGERENATARAJ, CHANDAN @ 2022-06-13 12:41 UTC (permalink / raw)
  To: Michel Dänzer, Mahfooz, Hamza, amd-gfx
  Cc: Wang, Chao-kai (Stylon), Liu, HaoPing (Alan), Li, Sun peng (Leo),
	Wentland, Harry, Zhuo, Qingqing (Lillian),
	Siqueira, Rodrigo, Li,  Roman, Chiu, Solomon, Zuo, Jerry, Pillai,
	Aurabindo, Vanzylldejong, Harry, Lin, Wayne, Lakha,  Bhawanpreet,
	Gutierrez, Agustin, Kotarac, Pavle

Hi,

Can you please elaborate on why dynamic memory clock switching can affect Game performance?

BR,
Chandan V N


>On 2022-06-10 22:52, Hamza Mahfooz wrote:
>> From: Harry VanZyllDeJong <harry.vanzylldejong@amd.com>
>> 
>> [WHY]
>> Game performace may be affected if dynamic memory clock switching is 
>> enabled while playing games.
>> 
>> [HOW]
>> Propagate the vrr active state to dirty bit so that on mode set it 
>> disables dynamic memory clock switching.
>
>So dynamic memory clock switching will be disabled whenever VRR is enabled?
>
>Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
>
>
-- 
Earthling Michel Dänzer            |                  https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&amp;data=05%7C01%7Cchandan.vurdigerenataraj%40amd.com%7C005764271a144b5832c408da4d293dee%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637907136793233201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=NSiOtjfwkelxkZMRFLzFs1mFPvosOFZnqrcNvRb9J6E%3D&amp;reserved=0
Libre software enthusiast          |         Mesa and Xwayland developer

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

* RE: [PATCH 00/23] DC Patches June 06, 2022
  2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
                   ` (22 preceding siblings ...)
  2022-06-10 20:52 ` [PATCH 23/23] drm/amd/display: Blank for uclk OC in dm instead of dc Hamza Mahfooz
@ 2022-06-13 13:15 ` Wheeler, Daniel
  23 siblings, 0 replies; 33+ messages in thread
From: Wheeler, Daniel @ 2022-06-13 13:15 UTC (permalink / raw)
  To: Mahfooz, Hamza, amd-gfx
  Cc: Wang, Chao-kai (Stylon), Li, Sun peng (Leo),
	Lakha, Bhawanpreet, Zhuo,  Qingqing (Lillian),
	Siqueira, Rodrigo, Li, Roman, Chiu, Solomon, Zuo, Jerry, Pillai,
	Aurabindo, Mahfooz, Hamza, Lin,  Wayne, Wentland, Harry,
	Gutierrez, Agustin, Kotarac, Pavle

[Public]

Hi all,
 
This week this patchset was tested on the following systems:
 
HP Envy 360, with Ryzen 5 4500U
Lenovo Thinkpad T14s Gen2, with AMD Ryzen 5 5650U 
Sapphire Pulse RX5700XT 
Reference AMD RX6800
Engineering board with Ryzen 9 5900H
 
These systems were tested on the following display types: 
eDP, (1080p 60hz [4500U, 5650U, 5900H])
VGA and DVI (1680x1050 60HZ [DP to VGA/DVI, USB-C to DVI/VGA])
DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz [Includes USB-C to DP/HDMI adapters])
 
MST tested with Startech MST14DP123DP and 2x 4k 60Hz displays
DSC tested with Cable Matters 101075 (DP to 3x DP), and 201375 (USB-C to 3x DP) with 3x 4k60 displays
 
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
Changing display configurations and settings
Benchmark testing
Feature testing (Freesync, etc.)
 
Automated testing includes (but is not limited to):
Script testing (scripts to automate some of the manual checks)
IGT testing
 
The patchset consists of the amd-staging-drm-next branch (Head commit - e426d449d8ce177c6dad562a1093332c738a56b3 -> drm/amd/amdgpu: Fix alignment issue) with new patches added on top of it. This branch is used for both Ubuntu and Chrome OS testing (ChromeOS on a bi-weekly basis).

 
Tested on Ubuntu 22.04 and Chrome OS
 
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
amd.com

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Hamza Mahfooz
Sent: June 10, 2022 4:52 PM
To: amd-gfx@lists.freedesktop.org
Cc: Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Zhuo, Qingqing (Lillian) <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Li, Roman <Roman.Li@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Mahfooz, Hamza <Hamza.Mahfooz@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Gutierrez, Agustin <Agustin.Gutierrez@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com>
Subject: [PATCH 00/23] DC Patches June 06, 2022

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

* DP fixes
* Reduced frame size in the bouding boxes of a number of ASICs.
* Exiting idle optimizations
* General cleanup
* Power management optimizations
* HF-VSIF support
* VTEM support
* FVA timing improvements

Ahmad Othman (2):
  drm/amd/display: Add support for HF-VSIF
  drm/amd/display: Adding VTEM to dc

Aric Cyr (1):
  drm/amd/display: 3.2.190

Charlene Liu (1):
  drm/amd/display: FVA timing adjustment

Felipe (2):
  drm/amd/display: Firmware assisted MCLK switch and FS
  drm/amd/display: Pass vrr mode to dcn

Hamza Mahfooz (1):
  drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined

Harry VanZyllDeJong (1):
  drm/amd/display: Disables dynamic memory clock switching in games

Ian Chen (1):
  drm/amd/display: DAL ACR, dc part, fix missing dcn30

Joshua Aberback (1):
  drm/amd/display: Blank for uclk OC in dm instead of dc

Lee, Alvin (1):
  drm/amd/display: Add debug option for exiting idle optimizations on
    cursor updates

Martin Leung (1):
  drm/amd/display: Add null check to dc_submit_i2c_oem

Nicholas Kazlauskas (1):
  drm/amd/display: Copy hfvsif_infopacket when stream update

Oliver Logush (1):
  drm/amd/display: Drop unused privacy_mask setters and getters

Qingqing Zhuo (1):
  drm/amd/display: update topology_update_input_v3 struct

Rodrigo Siqueira (4):
  drm/amd/display: Reduce frame size in the bouding box for DCN20
  drm/amd/display: Reduce frame size in the bouding box for DCN301
  drm/amd/display: Reduce frame size in the bouding box for DCN31/316
  drm/amd/display: Reduce frame size in the bouding box for DCN21

Samson Tam (1):
  drm/amd/display: Fix comments

Shah, Dharati (1):
  drm/amd/display: Fix monitor flash issue

Wenjing Liu (1):
  drm/amd/display: lower lane count first when CR done partially fails
    in EQ

hersen wu (1):
  drm/amd/display: dsc validate fail not pass to atomic check

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  6 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |  2 +
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 43 ++++++++----
 .../display/amdgpu_dm/amdgpu_dm_mst_types.h   |  2 +-
 .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c  | 23 ++++---  .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c  | 11 ++-
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 66 +++++++++---------
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |  8 ++-  .../gpu/drm/amd/display/dc/core/dc_link_dp.c  | 13 ++--  .../gpu/drm/amd/display/dc/core/dc_resource.c | 27 +++++++-
 .../gpu/drm/amd/display/dc/core/dc_stream.c   |  5 +-
 drivers/gpu/drm/amd/display/dc/dc.h           | 13 ++--
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |  2 +  drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h  |  5 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |  9 ++-
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c |  1 -  .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c |  1 +
 .../display/dc/dcn10/dcn10_stream_encoder.c   |  8 ++-
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    |  1 -
 .../display/dc/dcn20/dcn20_stream_encoder.c   |  1 +
 .../dc/dcn30/dcn30_dio_stream_encoder.c       |  1 +
 .../drm/amd/display/dc/dcn30/dcn30_hwseq.c    | 28 +++++---
 .../drm/amd/display/dc/dcn30/dcn30_hwseq.h    | 11 ++-
 .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c |  2 +-  .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c |  1 +  .../drm/amd/display/dc/dcn30/dcn30_resource.c |  1 +  .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c  | 67 +++++++++----------
 .../amd/display/dc/dml/dcn301/dcn301_fpu.c    | 30 ++++-----
 .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c  | 64 ++++++++----------
 .../dc/gpio/dcn20/hw_translate_dcn20.c        | 17 +++--
 .../dc/gpio/dcn21/hw_translate_dcn21.c        | 17 +++--
 .../dc/gpio/dcn30/hw_translate_dcn30.c        | 19 +++---
 drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h   |  6 --
 .../amd/display/dc/inc/hw/stream_encoder.h    |  1 +
 .../amd/display/dc/inc/hw_sequencer_private.h |  1 +  .../amd/display/include/link_service_types.h  |  2 +
 .../amd/display/modules/freesync/freesync.c   |  5 ++
 .../display/modules/hdcp/hdcp2_transition.c   |  2 +-
 .../drm/amd/display/modules/hdcp/hdcp_psp.c   |  4 ++
 .../drm/amd/display/modules/hdcp/hdcp_psp.h   | 11 +++
 .../amd/display/modules/inc/mod_freesync.h    |  3 +
 41 files changed, 326 insertions(+), 214 deletions(-)

--
2.36.1

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

* RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-13 12:41     ` VURDIGERENATARAJ, CHANDAN
@ 2022-06-13 13:32       ` Vanzylldejong, Harry
  2022-06-13 14:34         ` Alex Deucher
  0 siblings, 1 reply; 33+ messages in thread
From: Vanzylldejong, Harry @ 2022-06-13 13:32 UTC (permalink / raw)
  To: VURDIGERENATARAJ, CHANDAN, Michel Dänzer, Mahfooz, Hamza, amd-gfx
  Cc: Wang, Chao-kai (Stylon), Liu, HaoPing (Alan), Li, Sun peng (Leo),
	Wentland, Harry, Zhuo, Qingqing (Lillian),
	Siqueira, Rodrigo, Li,  Roman, Chiu, Solomon, Zuo, Jerry, Pillai,
	Aurabindo, Lin, Wayne, Lakha,  Bhawanpreet, Gutierrez, Agustin,
	Kotarac, Pavle

[AMD Official Use Only - General]

Hi Chandan,

When using Firmware Assisted Memory clock Switching (FAMS), when the memory clock is switched the frame rate is dropped for at least 1 frame,
sometimes 2-3 frames to make the V-Blank long enough to handle the period where the GDDR6 memory is unavailable when the memory clock switches.
This drop may be noticeable by gamers, especially if the memory clock wants to change it's clock rate several times a second,
which is what we observed just on the desktop.
To guarantee best game performance, we disable FAMS during game play.

Harry


-----Original Message-----
From: VURDIGERENATARAJ, CHANDAN <CHANDAN.VURDIGERENATARAJ@amd.com>
Sent: June 13, 2022 8:42 AM
To: Michel Dänzer <michel.daenzer@mailbox.org>; Mahfooz, Hamza <Hamza.Mahfooz@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Liu, HaoPing (Alan) <HaoPing.Liu@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Zhuo, Qingqing (Lillian) <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Li, Roman <Roman.Li@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Vanzylldejong, Harry <Harry.Vanzylldejong@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Gutierrez, Agustin <Agustin.Gutierrez@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com>
Subject: RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games

Hi,

Can you please elaborate on why dynamic memory clock switching can affect Game performance?

BR,
Chandan V N


>On 2022-06-10 22:52, Hamza Mahfooz wrote:
>> From: Harry VanZyllDeJong <harry.vanzylldejong@amd.com>
>>
>> [WHY]
>> Game performace may be affected if dynamic memory clock switching is
>> enabled while playing games.
>>
>> [HOW]
>> Propagate the vrr active state to dirty bit so that on mode set it
>> disables dynamic memory clock switching.
>
>So dynamic memory clock switching will be disabled whenever VRR is enabled?
>
>Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
>
>
--
Earthling Michel Dänzer            |                  https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&amp;data=05%7C01%7Cchandan.vurdigerenataraj%40amd.com%7C005764271a144b5832c408da4d293dee%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637907136793233201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=NSiOtjfwkelxkZMRFLzFs1mFPvosOFZnqrcNvRb9J6E%3D&amp;reserved=0
Libre software enthusiast          |         Mesa and Xwayland developer

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

* Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-13 13:32       ` Vanzylldejong, Harry
@ 2022-06-13 14:34         ` Alex Deucher
  2022-06-13 14:52           ` Vanzylldejong, Harry
  0 siblings, 1 reply; 33+ messages in thread
From: Alex Deucher @ 2022-06-13 14:34 UTC (permalink / raw)
  To: Vanzylldejong, Harry
  Cc: Wang, Chao-kai (Stylon), Liu, HaoPing (Alan),
	Michel Dänzer, Li, Sun peng (Leo),
	Lakha, Bhawanpreet, Zhuo, Qingqing (Lillian),
	Siqueira, Rodrigo, Li, Roman, amd-gfx, Chiu, Solomon, Zuo, Jerry,
	Pillai, Aurabindo, Mahfooz, Hamza, Lin, Wayne, Wentland, Harry,
	Gutierrez, Agustin, Kotarac, Pavle

It should be noted that FAMS is an additional feature to enable mclk
switching in more marginal cases than would normally be possible.

Alex

On Mon, Jun 13, 2022 at 9:32 AM Vanzylldejong, Harry
<Harry.Vanzylldejong@amd.com> wrote:
>
> [AMD Official Use Only - General]
>
> Hi Chandan,
>
> When using Firmware Assisted Memory clock Switching (FAMS), when the memory clock is switched the frame rate is dropped for at least 1 frame,
> sometimes 2-3 frames to make the V-Blank long enough to handle the period where the GDDR6 memory is unavailable when the memory clock switches.
> This drop may be noticeable by gamers, especially if the memory clock wants to change it's clock rate several times a second,
> which is what we observed just on the desktop.
> To guarantee best game performance, we disable FAMS during game play.
>
> Harry
>
>
> -----Original Message-----
> From: VURDIGERENATARAJ, CHANDAN <CHANDAN.VURDIGERENATARAJ@amd.com>
> Sent: June 13, 2022 8:42 AM
> To: Michel Dänzer <michel.daenzer@mailbox.org>; Mahfooz, Hamza <Hamza.Mahfooz@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Liu, HaoPing (Alan) <HaoPing.Liu@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Zhuo, Qingqing (Lillian) <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Li, Roman <Roman.Li@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Vanzylldejong, Harry <Harry.Vanzylldejong@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Gutierrez, Agustin <Agustin.Gutierrez@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com>
> Subject: RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
>
> Hi,
>
> Can you please elaborate on why dynamic memory clock switching can affect Game performance?
>
> BR,
> Chandan V N
>
>
> >On 2022-06-10 22:52, Hamza Mahfooz wrote:
> >> From: Harry VanZyllDeJong <harry.vanzylldejong@amd.com>
> >>
> >> [WHY]
> >> Game performace may be affected if dynamic memory clock switching is
> >> enabled while playing games.
> >>
> >> [HOW]
> >> Propagate the vrr active state to dirty bit so that on mode set it
> >> disables dynamic memory clock switching.
> >
> >So dynamic memory clock switching will be disabled whenever VRR is enabled?
> >
> >Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
> >
> >
> --
> Earthling Michel Dänzer            |                  https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&amp;data=05%7C01%7Cchandan.vurdigerenataraj%40amd.com%7C005764271a144b5832c408da4d293dee%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637907136793233201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=NSiOtjfwkelxkZMRFLzFs1mFPvosOFZnqrcNvRb9J6E%3D&amp;reserved=0
> Libre software enthusiast          |         Mesa and Xwayland developer

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

* RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-13 14:34         ` Alex Deucher
@ 2022-06-13 14:52           ` Vanzylldejong, Harry
  2022-06-13 17:55             ` Harry Wentland
  0 siblings, 1 reply; 33+ messages in thread
From: Vanzylldejong, Harry @ 2022-06-13 14:52 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Wang, Chao-kai (Stylon), Liu, HaoPing (Alan),
	Michel Dänzer, Li, Sun peng (Leo),
	Lakha, Bhawanpreet, Zhuo, Qingqing (Lillian),
	Siqueira, Rodrigo, Li, Roman, amd-gfx, Chiu, Solomon, Zuo, Jerry,
	Pillai, Aurabindo, Mahfooz,  Hamza, Lin, Wayne, Clark, Felipe,
	Wentland, Harry, Gutierrez, Agustin, Kotarac, Pavle

[AMD Official Use Only - General]

+@Clark, Felipe

-----Original Message-----
From: Alex Deucher <alexdeucher@gmail.com>
Sent: June 13, 2022 10:34 AM
To: Vanzylldejong, Harry <Harry.Vanzylldejong@amd.com>
Cc: VURDIGERENATARAJ, CHANDAN <CHANDAN.VURDIGERENATARAJ@amd.com>; Michel Dänzer <michel.daenzer@mailbox.org>; Mahfooz, Hamza <Hamza.Mahfooz@amd.com>; amd-gfx@lists.freedesktop.org; Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Liu, HaoPing (Alan) <HaoPing.Liu@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Zhuo, Qingqing (Lillian) <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Li, Roman <Roman.Li@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Gutierrez, Agustin <Agustin.Gutierrez@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com>
Subject: Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games

It should be noted that FAMS is an additional feature to enable mclk switching in more marginal cases than would normally be possible.

Alex

On Mon, Jun 13, 2022 at 9:32 AM Vanzylldejong, Harry <Harry.Vanzylldejong@amd.com> wrote:
>
> [AMD Official Use Only - General]
>
> Hi Chandan,
>
> When using Firmware Assisted Memory clock Switching (FAMS), when the
> memory clock is switched the frame rate is dropped for at least 1 frame, sometimes 2-3 frames to make the V-Blank long enough to handle the period where the GDDR6 memory is unavailable when the memory clock switches.
> This drop may be noticeable by gamers, especially if the memory clock
> wants to change it's clock rate several times a second, which is what we observed just on the desktop.
> To guarantee best game performance, we disable FAMS during game play.
>
> Harry
>
>
> -----Original Message-----
> From: VURDIGERENATARAJ, CHANDAN <CHANDAN.VURDIGERENATARAJ@amd.com>
> Sent: June 13, 2022 8:42 AM
> To: Michel Dänzer <michel.daenzer@mailbox.org>; Mahfooz, Hamza
> <Hamza.Mahfooz@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Liu, HaoPing (Alan)
> <HaoPing.Liu@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Lakha,
> Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Zhuo, Qingqing (Lillian)
> <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>;
> Li, Roman <Roman.Li@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>;
> Zuo, Jerry <Jerry.Zuo@amd.com>; Pillai, Aurabindo
> <Aurabindo.Pillai@amd.com>; Vanzylldejong, Harry
> <Harry.Vanzylldejong@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>;
> Wentland, Harry <Harry.Wentland@amd.com>; Gutierrez, Agustin
> <Agustin.Gutierrez@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com>
> Subject: RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory
> clock switching in games
>
> Hi,
>
> Can you please elaborate on why dynamic memory clock switching can affect Game performance?
>
> BR,
> Chandan V N
>
>
> >On 2022-06-10 22:52, Hamza Mahfooz wrote:
> >> From: Harry VanZyllDeJong <harry.vanzylldejong@amd.com>
> >>
> >> [WHY]
> >> Game performace may be affected if dynamic memory clock switching
> >> is enabled while playing games.
> >>
> >> [HOW]
> >> Propagate the vrr active state to dirty bit so that on mode set it
> >> disables dynamic memory clock switching.
> >
> >So dynamic memory clock switching will be disabled whenever VRR is enabled?
> >
> >Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
> >
> >
> --
> Earthling Michel Dänzer            |                  https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&amp;data=05%7C01%7CHarry.Vanzylldejong%40amd.com%7Cf91798912ad54c6e4ab808da4d49d34e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637907276721240575%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=N9TpPbl5KEIYAR5hhPKeiT0VZQ31SYxa2XottQrStfU%3D&amp;reserved=0
> Libre software enthusiast          |         Mesa and Xwayland developer

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

* Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-13 14:52           ` Vanzylldejong, Harry
@ 2022-06-13 17:55             ` Harry Wentland
  2022-06-14  8:57               ` Michel Dänzer
  0 siblings, 1 reply; 33+ messages in thread
From: Harry Wentland @ 2022-06-13 17:55 UTC (permalink / raw)
  To: Vanzylldejong, Harry, Alex Deucher
  Cc: Wang, Chao-kai (Stylon), Liu, HaoPing (Alan),
	Michel Dänzer, Li, Sun peng (Leo),
	Clark, Felipe, Zhuo, Qingqing (Lillian),
	Siqueira, Rodrigo, Li, Roman, amd-gfx, Chiu, Solomon, Zuo, Jerry,
	Pillai, Aurabindo, Mahfooz, Hamza, Lin, Wayne, Lakha,
	Bhawanpreet, Gutierrez, Agustin, Kotarac, Pavle

This seems to be a case of a Windows-centric commit description that doesn't
completely make sense for Linux.

The code-change doesn't currently affect any behavior on Linux. It just lays
the groundwork in DC to allow an implementation to do a memory-clock switching
decision based around VRR support.

In short, this won't be a problem for us at this point.

Might be better to change the subject line and commit description to reflect that:

"drm/amd/display: Add vrr_active_variable to dc_stream_update

[Why]
The display driver on some OSes need to track it in order to perform memory clock
switching decisions."

... or something like the above.

Harry


On 2022-06-13 10:52, Vanzylldejong, Harry wrote:
> [AMD Official Use Only - General]
> 
> +@Clark, Felipe
> 
> -----Original Message-----
> From: Alex Deucher <alexdeucher@gmail.com>
> Sent: June 13, 2022 10:34 AM
> To: Vanzylldejong, Harry <Harry.Vanzylldejong@amd.com>
> Cc: VURDIGERENATARAJ, CHANDAN <CHANDAN.VURDIGERENATARAJ@amd.com>; Michel Dänzer <michel.daenzer@mailbox.org>; Mahfooz, Hamza <Hamza.Mahfooz@amd.com>; amd-gfx@lists.freedesktop.org; Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Liu, HaoPing (Alan) <HaoPing.Liu@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Zhuo, Qingqing (Lillian) <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Li, Roman <Roman.Li@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Gutierrez, Agustin <Agustin.Gutierrez@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com>
> Subject: Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
> 
> It should be noted that FAMS is an additional feature to enable mclk switching in more marginal cases than would normally be possible.
> 
> Alex
> 
> On Mon, Jun 13, 2022 at 9:32 AM Vanzylldejong, Harry <Harry.Vanzylldejong@amd.com> wrote:
>>
>> [AMD Official Use Only - General]
>>
>> Hi Chandan,
>>
>> When using Firmware Assisted Memory clock Switching (FAMS), when the
>> memory clock is switched the frame rate is dropped for at least 1 frame, sometimes 2-3 frames to make the V-Blank long enough to handle the period where the GDDR6 memory is unavailable when the memory clock switches.
>> This drop may be noticeable by gamers, especially if the memory clock
>> wants to change it's clock rate several times a second, which is what we observed just on the desktop.
>> To guarantee best game performance, we disable FAMS during game play.
>>
>> Harry
>>
>>
>> -----Original Message-----
>> From: VURDIGERENATARAJ, CHANDAN <CHANDAN.VURDIGERENATARAJ@amd.com>
>> Sent: June 13, 2022 8:42 AM
>> To: Michel Dänzer <michel.daenzer@mailbox.org>; Mahfooz, Hamza
>> <Hamza.Mahfooz@amd.com>; amd-gfx@lists.freedesktop.org
>> Cc: Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Liu, HaoPing (Alan)
>> <HaoPing.Liu@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Lakha,
>> Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Zhuo, Qingqing (Lillian)
>> <Qingqing.Zhuo@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>;
>> Li, Roman <Roman.Li@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>;
>> Zuo, Jerry <Jerry.Zuo@amd.com>; Pillai, Aurabindo
>> <Aurabindo.Pillai@amd.com>; Vanzylldejong, Harry
>> <Harry.Vanzylldejong@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>;
>> Wentland, Harry <Harry.Wentland@amd.com>; Gutierrez, Agustin
>> <Agustin.Gutierrez@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com>
>> Subject: RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory
>> clock switching in games
>>
>> Hi,
>>
>> Can you please elaborate on why dynamic memory clock switching can affect Game performance?
>>
>> BR,
>> Chandan V N
>>
>>
>>> On 2022-06-10 22:52, Hamza Mahfooz wrote:
>>>> From: Harry VanZyllDeJong <harry.vanzylldejong@amd.com>
>>>>
>>>> [WHY]
>>>> Game performace may be affected if dynamic memory clock switching
>>>> is enabled while playing games.
>>>>
>>>> [HOW]
>>>> Propagate the vrr active state to dirty bit so that on mode set it
>>>> disables dynamic memory clock switching.
>>>
>>> So dynamic memory clock switching will be disabled whenever VRR is enabled?
>>>
>>> Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
>>>
>>>
>> --
>> Earthling Michel Dänzer            |                  https://redhat.com/>>> Libre software enthusiast          |         Mesa and Xwayland developer


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

* Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-13 17:55             ` Harry Wentland
@ 2022-06-14  8:57               ` Michel Dänzer
  2022-06-14 13:07                 ` Harry Wentland
  0 siblings, 1 reply; 33+ messages in thread
From: Michel Dänzer @ 2022-06-14  8:57 UTC (permalink / raw)
  To: Harry Wentland, Vanzylldejong, Harry, Alex Deucher
  Cc: Wang, Chao-kai (Stylon), Liu, HaoPing (Alan),
	Clark, Felipe, Li, Sun peng (Leo), Zhuo, Qingqing (Lillian),
	Siqueira, Rodrigo, Li, Roman, amd-gfx, Chiu, Solomon, Zuo, Jerry,
	Pillai, Aurabindo, Mahfooz, Hamza, Lin, Wayne, Lakha,
	Bhawanpreet, Gutierrez, Agustin, Kotarac, Pavle

On 2022-06-13 19:55, Harry Wentland wrote:
> This seems to be a case of a Windows-centric commit description that doesn't
> completely make sense for Linux.
> 
> The code-change doesn't currently affect any behavior on Linux. It just lays
> the groundwork in DC to allow an implementation to do a memory-clock switching
> decision based around VRR support.
> 
> In short, this won't be a problem for us at this point.

Thanks for the clarification.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer

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

* Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
  2022-06-14  8:57               ` Michel Dänzer
@ 2022-06-14 13:07                 ` Harry Wentland
  0 siblings, 0 replies; 33+ messages in thread
From: Harry Wentland @ 2022-06-14 13:07 UTC (permalink / raw)
  To: Michel Dänzer, Vanzylldejong, Harry, Alex Deucher
  Cc: Wang, Chao-kai (Stylon), Liu, HaoPing (Alan),
	Clark, Felipe, Li, Sun peng (Leo), Zhuo, Qingqing (Lillian),
	Siqueira, Rodrigo, Li, Roman, amd-gfx, Chiu, Solomon, Zuo, Jerry,
	Pillai, Aurabindo, Mahfooz, Hamza, Lin, Wayne, Lakha,
	Bhawanpreet, Gutierrez, Agustin, Kotarac, Pavle



On 2022-06-14 04:57, Michel Dänzer wrote:
> On 2022-06-13 19:55, Harry Wentland wrote:
>> This seems to be a case of a Windows-centric commit description that doesn't
>> completely make sense for Linux.
>>
>> The code-change doesn't currently affect any behavior on Linux. It just lays
>> the groundwork in DC to allow an implementation to do a memory-clock switching
>> decision based around VRR support.
>>
>> In short, this won't be a problem for us at this point.
> 
> Thanks for the clarification.
> 

No problem. Thanks for your review and for voicing your concern when something
doesn't look right.

Harry

> 


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

end of thread, other threads:[~2022-06-14 13:08 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 20:52 [PATCH 00/23] DC Patches June 06, 2022 Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 01/23] drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 02/23] drm/amd/display: lower lane count first when CR done partially fails in EQ Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 03/23] drm/amd/display: Fix monitor flash issue Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 04/23] drm/amd/display: Reduce frame size in the bouding box for DCN20 Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 05/23] drm/amd/display: Reduce frame size in the bouding box for DCN301 Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 06/23] drm/amd/display: Reduce frame size in the bouding box for DCN31/316 Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 07/23] drm/amd/display: Reduce frame size in the bouding box for DCN21 Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 08/23] drm/amd/display: dsc validate fail not pass to atomic check Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 09/23] drm/amd/display: Add debug option for exiting idle optimizations on cursor updates Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 10/23] drm/amd/display: update topology_update_input_v3 struct Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 11/23] drm/amd/display: 3.2.190 Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 12/23] drm/amd/display: Drop unused privacy_mask setters and getters Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 13/23] drm/amd/display: Fix comments Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 14/23] drm/amd/display: DAL ACR, dc part, fix missing dcn30 Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 15/23] drm/amd/display: Firmware assisted MCLK switch and FS Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 16/23] drm/amd/display: Add support for HF-VSIF Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 17/23] drm/amd/display: Copy hfvsif_infopacket when stream update Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 18/23] drm/amd/display: Adding VTEM to dc Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 19/23] drm/amd/display: Pass vrr mode to dcn Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games Hamza Mahfooz
2022-06-13 10:41   ` Michel Dänzer
2022-06-13 12:41     ` VURDIGERENATARAJ, CHANDAN
2022-06-13 13:32       ` Vanzylldejong, Harry
2022-06-13 14:34         ` Alex Deucher
2022-06-13 14:52           ` Vanzylldejong, Harry
2022-06-13 17:55             ` Harry Wentland
2022-06-14  8:57               ` Michel Dänzer
2022-06-14 13:07                 ` Harry Wentland
2022-06-10 20:52 ` [PATCH 21/23] drm/amd/display: FVA timing adjustment Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 22/23] drm/amd/display: Add null check to dc_submit_i2c_oem Hamza Mahfooz
2022-06-10 20:52 ` [PATCH 23/23] drm/amd/display: Blank for uclk OC in dm instead of dc Hamza Mahfooz
2022-06-13 13:15 ` [PATCH 00/23] DC Patches June 06, 2022 Wheeler, Daniel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).