Skip to contentSkip to conversation

DC Patches Mar 20th, 2023

PATCH In review Qingqing Zhuo 3 participants 23 messages Mar 18, 2023 – Mar 21, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover DC Patches Mar 20th, 2023

This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Power down eDP if eDP not present
- Set MPC_SPLIT_DYNAMIC for DCN10 and DCN301
- Initialize link_srv in virtual env
- Code cleanup and alignment

Cc Daniel Wheeler <[email protected]>

---

Alex Deucher (2):
Revert "drm/amdgpu/display: change pipe policy for DCN 2.0" drm/amdgpu/smu11: enable TEMP_DEPENDENT_VMIN for navi1x

Alex Hung (1):
drm/amd/display: remove outdated 8bpc comments

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

Charlene Liu (3):
drm/amd/display: update dio for two pixel per container case drm/amd/display: Add CRC and DMUB test support drm/amd/display: add missing code change init pix_per_cycle

Hersen Wu (3):
drm/amd/display: align commit_planes_for_stream to latest dc code drm/amd/display: fix wrong index used in dccg32_set_dpstreamclk drm/amd/display: Set dcn32 caps.seamless_odm

Martin Leung (1):
drm/amd/display: initialize link_srv in virtual env

Mustapha Ghaddar (1):
drm/amd/display: Add function pointer for validate bw usb4

Paul Hsieh (1):
drm/amd/display: power down eDP if eDP not present

Rodrigo Siqueira (3):
drm/amd/display: Add const to a function drm/amd/display: Set MPC_SPLIT_DYNAMIC for DCN10 drm/amd/display: Set MPC_SPLIT_DYNAMIC for DCN301

Saaem Rizvi (1):
drm/amd/display: Implement workaround for writing to
OTG_PIXEL_RATE_DIV register

Wesley Chalmers (1):
drm/amd/display: Make DCN32 3dlut function available to future DCNs

Zhikai Zhai (1):
drm/amd/display: skip wait vblank

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  1 -
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 27 +++--------------
 .../drm/amd/display/dc/core/dc_link_exports.c |  8 +++--
 drivers/gpu/drm/amd/display/dc/dc.h           | 18 ++++++++++--
 .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 29 +++++++++++++++++++
 .../drm/amd/display/dc/dcn10/dcn10_resource.c |  4 +--
 .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h |  3 +-
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    |  4 +--
 .../drm/amd/display/dc/dcn20/dcn20_resource.c |  2 +-
 .../amd/display/dc/dcn301/dcn301_resource.c   |  2 +-
 .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 25 ++++++++++++++--
 .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.h |  3 +-
 .../dc/dcn32/dcn32_dio_stream_encoder.c       |  6 ++++
 .../drm/amd/display/dc/dcn32/dcn32_hwseq.c    |  4 +--
 .../drm/amd/display/dc/dcn32/dcn32_hwseq.h    |  3 ++
 .../drm/amd/display/dc/dcn32/dcn32_resource.c |  1 +
 .../drm/amd/display/dc/dcn32/dcn32_resource.h |  3 +-
 drivers/gpu/drm/amd/display/dc/inc/link.h     |  3 ++
 .../drm/amd/display/dc/link/link_detection.c  |  5 ++++
 .../drm/amd/display/dc/link/link_factory.c    |  1 +
 .../drm/amd/display/dc/link/link_validation.c | 18 ++++++++++++
 .../drm/amd/display/dc/link/link_validation.h |  4 +++
 .../dc/link/protocols/link_dp_dpia_bw.c       |  9 ++----
 .../dc/link/protocols/link_dp_dpia_bw.h       |  7 ++++-
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h   |  2 ++
 .../gpu/drm/amd/display/include/dal_asic_id.h |  1 +
 .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c   |  3 +-
 27 files changed, 144 insertions(+), 52 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/19 drm/amd/display: Implement workaround for writing to OTG_PIXEL_RATE_DIV register

From: Saaem Rizvi <[email protected]>

[Why and How]
Current implementation requires FPGA builds to take a different code path from DCN32 to write to OTG_PIXEL_RATE_DIV. Now that we have a workaround to write to OTG_PIXEL_RATE_DIV register without blanking display on hotplug on DCN32, we can allow the code paths for FPGA to be exactly the same allowing for more consistent testing.

---
 .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h |  3 ++-
 .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 22 +++++++++++++++++++
 .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.h |  3 ++-
 .../drm/amd/display/dc/dcn32/dcn32_hwseq.c    |  2 +-
 .../drm/amd/display/dc/dcn32/dcn32_resource.h |  3 ++-
 5 files changed, 29 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h +2 -1
index 915a20461c77..893c0809cd4e 100644
@@ -230,7 +230,8 @@
 	type DTBCLK_P2_SRC_SEL;\
 	type DTBCLK_P2_EN;\
 	type DTBCLK_P3_SRC_SEL;\
-	type DTBCLK_P3_EN;
+	type DTBCLK_P3_EN;\
+	type DENTIST_DISPCLK_CHG_DONE;
 
 struct dccg_shift {
 	DCCG_REG_FIELD_LIST(uint8_t)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +22 -0
index e4472c6be6c3..5dbef498580b 100644
@@ -42,6 +42,20 @@
 #define DC_LOGGER \
 	dccg->ctx->logger
 
+/* This function is a workaround for writing to OTG_PIXEL_RATE_DIV
+ * without the probability of causing a DIG FIFO error.
+ */
+static void dccg32_wait_for_dentist_change_done(
+	struct dccg *dccg)
+{
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+
+	uint32_t dentist_dispclk_value = REG_READ(DENTIST_DISPCLK_CNTL);
+
+	REG_WRITE(DENTIST_DISPCLK_CNTL, dentist_dispclk_value);
+	REG_WAIT(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_CHG_DONE, 1, 50, 2000);
+}
+
 static void dccg32_get_pixel_rate_div(
 		struct dccg *dccg,
 		uint32_t otg_inst,
@@ -110,21 +124,29 @@ static void dccg32_set_pixel_rate_div(
 		REG_UPDATE_2(OTG_PIXEL_RATE_DIV,
 				OTG0_PIXEL_RATE_DIVK1, k1,
 				OTG0_PIXEL_RATE_DIVK2, k2);
+
+		dccg32_wait_for_dentist_change_done(dccg);
 		break;
 	case 1:
 		REG_UPDATE_2(OTG_PIXEL_RATE_DIV,
 				OTG1_PIXEL_RATE_DIVK1, k1,
 				OTG1_PIXEL_RATE_DIVK2, k2);
+
+		dccg32_wait_for_dentist_change_done(dccg);
 		break;
 	case 2:
 		REG_UPDATE_2(OTG_PIXEL_RATE_DIV,
 				OTG2_PIXEL_RATE_DIVK1, k1,
 				OTG2_PIXEL_RATE_DIVK2, k2);
+
+		dccg32_wait_for_dentist_change_done(dccg);
 		break;
 	case 3:
 		REG_UPDATE_2(OTG_PIXEL_RATE_DIV,
 				OTG3_PIXEL_RATE_DIVK1, k1,
 				OTG3_PIXEL_RATE_DIVK2, k2);
+
+		dccg32_wait_for_dentist_change_done(dccg);
 		break;
 	default:
 		BREAK_TO_DEBUGGER();
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.h +2 -1
index 271c163e4844..8071ab98d708 100644
@@ -111,7 +111,8 @@
 	DCCG_SF(DTBCLK_P_CNTL, DTBCLK_P3_SRC_SEL, mask_sh),\
 	DCCG_SF(DTBCLK_P_CNTL, DTBCLK_P3_EN, mask_sh),\
 	DCCG_SF(DCCG_AUDIO_DTO_SOURCE, DCCG_AUDIO_DTO_SEL, mask_sh),\
-	DCCG_SF(DCCG_AUDIO_DTO_SOURCE, DCCG_AUDIO_DTO0_SOURCE_SEL, mask_sh)
+	DCCG_SF(DCCG_AUDIO_DTO_SOURCE, DCCG_AUDIO_DTO0_SOURCE_SEL, mask_sh),\
+	DCCG_SF(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_CHG_DONE, mask_sh)
 
 
 struct dccg *dccg32_create(
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -1
index f9073b722b36..5016b1313f3d 100644
@@ -1111,7 +1111,7 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsign
 			*k2_div = PIXEL_RATE_DIV_BY_2;
 		else
 			*k2_div = PIXEL_RATE_DIV_BY_4;
-	} else if (dc_is_dp_signal(stream->signal)) {
+	} else if (dc_is_dp_signal(stream->signal) || dc_is_virtual_signal(stream->signal)) {
 		if (two_pix_per_container) {
 			*k1_div = PIXEL_RATE_DIV_BY_1;
 			*k2_div = PIXEL_RATE_DIV_BY_2;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h +2 -1
index aca928edc4e3..10a3350376e4 100644
@@ -1276,7 +1276,8 @@ double dcn32_determine_max_vratio_prefetch(struct dc *dc, struct dc_state *conte
       DCCG_SRII(PHASE, DTBCLK_DTO, 0), DCCG_SRII(PHASE, DTBCLK_DTO, 1),        \
       DCCG_SRII(PHASE, DTBCLK_DTO, 2), DCCG_SRII(PHASE, DTBCLK_DTO, 3),        \
       SR(DCCG_AUDIO_DTBCLK_DTO_MODULO), SR(DCCG_AUDIO_DTBCLK_DTO_PHASE),       \
-      SR(OTG_PIXEL_RATE_DIV), SR(DTBCLK_P_CNTL), SR(DCCG_AUDIO_DTO_SOURCE)     \
+      SR(OTG_PIXEL_RATE_DIV), SR(DTBCLK_P_CNTL),                               \
+      SR(DCCG_AUDIO_DTO_SOURCE), SR(DENTIST_DISPCLK_CNTL)                      \
   )
 
 /* VMID */
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/19 drm/amd/display: remove outdated 8bpc comments

In reply to Qingqing Zhuo

From: Alex Hung <[email protected]>

[Why]
The commit ad9adba9d1cf ("drm/amd/display: Don't restrict bpc to 8 bpc") removes the historical 8bpc dependency and sets max_bpc to 16.

[How]
The comment that states "8bpc for non-edp" needs to be removed as well.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
index ae0a223b90a1..724c565ae688 100644
@@ -7283,7 +7283,6 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
 	if (!aconnector->mst_root)
 		drm_connector_attach_max_bpc_property(&aconnector->base, 8, 16);
 
-	/* This defaults to the max in the range, but we want 8bpc for non-edp. */
 	aconnector->base.state->max_bpc = 16;
 	aconnector->base.state->max_requested_bpc = aconnector->base.state->max_bpc;
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/19 drm/amd/display: Make DCN32 3dlut function available to future DCNs

In reply to Qingqing Zhuo

From: Wesley Chalmers <[email protected]>

[Why & How]
Make DCN32 3dlut function non-static and thus available for future DCNs.

---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -1
index 5016b1313f3d..42255c22605d 100644
@@ -414,7 +414,7 @@ void dcn32_subvp_pipe_control_lock(struct dc *dc,
 }
 
 
-static bool dcn32_set_mpc_shaper_3dlut(
+bool dcn32_set_mpc_shaper_3dlut(
 	struct pipe_ctx *pipe_ctx, const struct dc_stream_state *stream)
 {
 	struct dpp *dpp_base = pipe_ctx->plane_res.dpp;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +3 -0
index 84c1f36c3fa6..2a5376eb9d66 100644
@@ -54,6 +54,9 @@ bool dcn32_set_input_transfer_func(struct dc *dc,
 				struct pipe_ctx *pipe_ctx,
 				const struct dc_plane_state *plane_state);
 
+bool dcn32_set_mpc_shaper_3dlut(
+	struct pipe_ctx *pipe_ctx, const struct dc_stream_state *stream);
+
 bool dcn32_set_output_transfer_func(struct dc *dc,
 				struct pipe_ctx *pipe_ctx,
 				const struct dc_stream_state *stream);
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/19 drm/amd/display: Add const to a function

In reply to Qingqing Zhuo

From: Rodrigo Siqueira <[email protected]>

When calling the dc_link_bw_kbps_from_raw_frl_link_rate_data from amdgpu_dm, GCC highlighted the following issue:

In function ‘get_conv_frl_bw’:
error: passing argument 1 of ‘dc_link_bw_kbps_from_raw_frl_link_rate_data’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
997 | aconnector->dc_link->dc,

This commit fix this issue by making DC a constant variable since we only use it to invoke the function bw_kbps_from_raw_frl_link_rate_data().

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c | 3 +--
 drivers/gpu/drm/amd/display/dc/dc.h                   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c +1 -2
index 58fa911b1417..d24bc0a0b1d4 100644
@@ -285,8 +285,7 @@ int dc_link_aux_transfer_raw(struct ddc_service *ddc,
 			ddc, payload, operation_result);
 }
 
-uint32_t dc_link_bw_kbps_from_raw_frl_link_rate_data(
-		struct dc *dc, uint8_t bw)
+uint32_t dc_link_bw_kbps_from_raw_frl_link_rate_data(const struct dc *dc, uint8_t bw)
 {
 	return dc->link_srv->bw_kbps_from_raw_frl_link_rate_data(bw);
 }
drivers/gpu/drm/amd/display/dc/dc.h +1 -2
index 2818483964dd..624acd402eae 100644
@@ -1768,8 +1768,7 @@ void dc_restore_link_res_map(const struct dc *dc, uint32_t *map);
 bool dc_link_update_dsc_config(struct pipe_ctx *pipe_ctx);
 
 /* translate a raw link rate data to bandwidth in kbps */
-uint32_t dc_link_bw_kbps_from_raw_frl_link_rate_data(
-		struct dc *dc, uint8_t bw);
+uint32_t dc_link_bw_kbps_from_raw_frl_link_rate_data(const struct dc *dc, uint8_t bw);
 
 /* determine the optimal bandwidth given link and required bw.
  * @link - current detected link
Signature · 1 line
2.34.1
#5 lore raw

PATCH 5/19 drm/amd/display: skip wait vblank

In reply to Qingqing Zhuo

From: Zhikai Zhai <[email protected]>

[WHY]
There is no need to wait vblank in the vupdate locked region at a full type update

[HOW]
skip wait vblank when global sync change

---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +1 -3
index 53669f832ba5..69ea1f4ea749 100644
@@ -1720,10 +1720,8 @@ static void dcn20_program_pipe(
 				pipe_ctx->pipe_dlg_param.vupdate_offset,
 				pipe_ctx->pipe_dlg_param.vupdate_width);
 
-		if (pipe_ctx->stream->mall_stream_config.type != SUBVP_PHANTOM) {
-			pipe_ctx->stream_res.tg->funcs->wait_for_state(pipe_ctx->stream_res.tg, CRTC_STATE_VBLANK);
+		if (pipe_ctx->stream->mall_stream_config.type != SUBVP_PHANTOM)
 			pipe_ctx->stream_res.tg->funcs->wait_for_state(pipe_ctx->stream_res.tg, CRTC_STATE_VACTIVE);
-		}
 
 		pipe_ctx->stream_res.tg->funcs->set_vtg_params(
 				pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing, true);
Signature · 1 line
2.34.1
#6 lore raw

PATCH 6/19 drm/amd/display: update dio for two pixel per container case

In reply to Qingqing Zhuo

From: Charlene Liu <[email protected]>

[why]
Processing rate of the DP encoder, must be programmed to be the same as DIG_FIFO_OUTPUT_ PROCESSING_MODE in DP mode
0: 1 pixel per cycle
1: 2 pixel per cycle

---
 .../gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c  | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c +5 -0
index c72448125976..89de64f18040 100644
@@ -286,6 +286,7 @@ static void enc32_stream_encoder_dp_unblank(
 		uint32_t n_vid = 0x8000;
 		uint32_t m_vid;
 		uint32_t n_multiply = 0;
+		uint32_t pix_per_cycle = 0;
 		uint64_t m_vid_l = n_vid;
 
 		/* YCbCr 4:2:0 : Computed VID_M will be 2X the input rate */
@@ -320,6 +321,10 @@ static void enc32_stream_encoder_dp_unblank(
 		REG_UPDATE_2(DP_VID_TIMING,
 				DP_VID_M_N_GEN_EN, 1,
 				DP_VID_N_MUL, n_multiply);
+
+		REG_UPDATE(DP_PIXEL_FORMAT,
+				DP_PIXEL_PER_CYCLE_PROCESSING_MODE,
+				pix_per_cycle);
 	}
 
 	/* make sure stream is disabled before resetting steer fifo */
Signature · 1 line
2.34.1
#7 lore raw

PATCH 7/19 drm/amd/display: power down eDP if eDP not present

In reply to Qingqing Zhuo

From: Paul Hsieh <[email protected]>

[Why]
When init, driver will power up eDP to check eDP present or not. If eDP not present, driver doesn't power off eDP VDD cause power consumption.

[How]
If eDP is not present when detection, power off eDP VDD.

---
 drivers/gpu/drm/amd/display/dc/link/link_detection.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/link/link_detection.c +5 -0
index fee71ebdfc73..57cf6fa0de7a 100644
@@ -1225,6 +1225,11 @@ bool link_detect_connection_type(struct dc_link *link, enum dc_connection_type *
 		/* TODO: need to do the actual detection */
 	} else {
 		*type = dc_connection_none;
+		if (link->connector_signal == SIGNAL_TYPE_EDP) {
+			/* eDP is not connected, power down it */
+			if (!link->dc->config.edp_no_power_sequencing)
+				link->dc->hwss.edp_power_control(link, false);
+		}
 	}
 
 	return true;
Signature · 1 line
2.34.1
#8 lore raw

PATCH 8/19 drm/amd/display: initialize link_srv in virtual env

In reply to Qingqing Zhuo

From: Martin Leung <[email protected]>

[why]
when refactoring to link_srv, we did not include the virtual environment case where dc_construct_ctx gets called instead of dc_construct

[how]
add initialize link_srv to dc_construct_ctx as well

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
index ae5f1b7b4fef..dc67256f565d 100644
@@ -887,6 +887,7 @@ static bool dc_construct_ctx(struct dc *dc,
 	}
 
 	dc->ctx = dc_ctx;
+	dc->link_srv = link_create_link_service();
 
 	return true;
 }
Signature · 1 line
2.34.1
#9 lore raw

PATCH 9/19 drm/amd/display: Add function pointer for validate bw usb4

In reply to Qingqing Zhuo

From: Mustapha Ghaddar <[email protected]>

[WHY]
In order to follow the new protocol of calling link functions

[HOW]
Add the function pointer to the link_srv

---
 .../drm/amd/display/dc/core/dc_link_exports.c  |  5 +++++
 drivers/gpu/drm/amd/display/dc/dc.h            | 13 +++++++++++++
 drivers/gpu/drm/amd/display/dc/inc/link.h      |  3 +++
 .../gpu/drm/amd/display/dc/link/link_factory.c |  1 +
 .../drm/amd/display/dc/link/link_validation.c  | 18 ++++++++++++++++++
 .../drm/amd/display/dc/link/link_validation.h  |  4 ++++
 .../dc/link/protocols/link_dp_dpia_bw.c        |  9 ++-------
 .../dc/link/protocols/link_dp_dpia_bw.h        |  7 ++++++-
 8 files changed, 52 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c +5 -0
index d24bc0a0b1d4..18e098568cb4 100644
@@ -473,3 +473,8 @@ void dc_link_enable_hpd_filter(struct dc_link *link, bool enable)
 {
 	link->dc->link_srv->enable_hpd_filter(link, enable);
 }
+
+bool dc_link_validate(struct dc *dc, const struct dc_stream_state *streams, const unsigned int count)
+{
+	return dc->link_srv->validate_dpia_bandwidth(streams, count);
+}
drivers/gpu/drm/amd/display/dc/dc.h +13 -0
index 624acd402eae..1e6fa2d387f7 100644
@@ -2028,6 +2028,19 @@ void dc_link_handle_usb4_bw_alloc_response(struct dc_link *link,
 int dc_link_dp_dpia_handle_usb4_bandwidth_allocation_for_link(
 		struct dc_link *link, int peak_bw);
 
+/*
+ * Validate the BW of all the valid DPIA links to make sure it doesn't exceed
+ * available BW for each host router
+ *
+ * @dc: pointer to dc struct
+ * @stream: pointer to all possible streams
+ * @num_streams: number of valid DPIA streams
+ *
+ * return: TRUE if bw used by DPIAs doesn't exceed available BW else return FALSE
+ */
+bool dc_link_validate(struct dc *dc, const struct dc_stream_state *streams,
+		const unsigned int count);
+
 /* Sink Interfaces - A sink corresponds to a display output device */
 
 struct dc_container_id {
drivers/gpu/drm/amd/display/dc/inc/link.h +3 -0
index 11aaa7a9518a..f839494d59d8 100644
@@ -144,6 +144,9 @@ struct link_service {
 	uint32_t (*dp_link_bandwidth_kbps)(
 		const struct dc_link *link,
 		const struct dc_link_settings *link_settings);
+	bool (*validate_dpia_bandwidth)(
+			const struct dc_stream_state *stream,
+			const unsigned int num_streams);
 
 
 	/*************************** DPMS *************************************/
drivers/gpu/drm/amd/display/dc/link/link_factory.c +1 -0
index 3951d48118c4..1515c817f03b 100644
@@ -99,6 +99,7 @@ static void construct_link_service_validation(struct link_service *link_srv)
 {
 	link_srv->validate_mode_timing = link_validate_mode_timing;
 	link_srv->dp_link_bandwidth_kbps = dp_link_bandwidth_kbps;
+	link_srv->validate_dpia_bandwidth = link_validate_dpia_bandwidth;
 }
 
 /* link dpms owns the programming sequence of stream's dpms state associated
drivers/gpu/drm/amd/display/dc/link/link_validation.c +18 -0
index 9a5010f86003..139012ab20e3 100644
@@ -30,6 +30,7 @@
  */
 #include "link_validation.h"
 #include "protocols/link_dp_capability.h"
+#include "protocols/link_dp_dpia_bw.h"
 #include "resource.h"
 
 #define DC_LOGGER_INIT(logger)
@@ -394,3 +395,20 @@ enum dc_status link_validate_mode_timing(
 
 	return DC_OK;
 }
+
+bool link_validate_dpia_bandwidth(const struct dc_stream_state *stream, const unsigned int num_streams)
+{
+	bool ret = true;
+	int bw_needed[MAX_DPIA_NUM];
+	struct dc_link *link[MAX_DPIA_NUM];
+
+	if (!num_streams || num_streams > MAX_DPIA_NUM)
+		return ret;
+
+	for (uint8_t i = 0; i < num_streams; ++i) {
+
+		link[i] = stream[i].link;
+		bw_needed[i] = dc_bandwidth_in_kbps_from_timing(&stream[i].timing);
+	}
+	return ret;
+}
drivers/gpu/drm/amd/display/dc/link/link_validation.h +4 -0
index 2191d3a4950c..4a954317d0da 100644
@@ -29,7 +29,11 @@ enum dc_status link_validate_mode_timing(
 		const struct dc_stream_state *stream,
 		struct dc_link *link,
 		const struct dc_crtc_timing *timing);
+bool link_validate_dpia_bandwidth(
+		const struct dc_stream_state *stream,
+		const unsigned int num_streams);
 uint32_t dp_link_bandwidth_kbps(
 	const struct dc_link *link,
 	const struct dc_link_settings *link_settings);
+
 #endif /* __LINK_VALIDATION_H__ */
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +2 -7
index 2e251dcbb022..ac7166f600a8 100644
@@ -33,10 +33,6 @@
 #define DC_LOGGER \
 	link->ctx->logger
 
-/* Number of Host Routers per motherboard is 2 */
-#define MAX_HR_NUM			2
-/* Number of DPIA per host router is 2 */
-#define MAX_DPIA_NUM		(MAX_HR_NUM * 2)
 #define Kbps_TO_Gbps (1000 * 1000)
 
 // ------------------------------------------------------------------
@@ -377,9 +373,8 @@ void dpia_handle_bw_alloc_response(struct dc_link *link, uint8_t bw, uint8_t res
 		// 1. If due to unplug of other sink
 		if (estimated == host_router_total_estimated_bw) {
 			// First update the estimated & max_bw fields
-			if (link->dpia_bw_alloc_config.estimated_bw < estimated) {
+			if (link->dpia_bw_alloc_config.estimated_bw < estimated)
 				link->dpia_bw_alloc_config.estimated_bw = estimated;
-			}
 		}
 		// 2. If due to realloc bw btw 2 dpia due to plug OR realloc unused Bw
 		else {
@@ -462,7 +457,7 @@ int link_dp_dpia_allocate_usb4_bandwidth_for_stream(struct dc_link *link, int re
 out:
 	return ret;
 }
-bool dpia_validate_usb4_bw(struct dc_link **link, int *bw_needed_per_dpia, uint8_t num_dpias)
+bool dpia_validate_usb4_bw(struct dc_link **link, int *bw_needed_per_dpia, const unsigned int num_dpias)
 {
 	bool ret = true;
 	int bw_needed_per_hr[MAX_HR_NUM] = { 0, 0 };
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.h +6 -1
index 382616c8b698..7292690383ae 100644
@@ -28,6 +28,11 @@
 
 #include "link.h"
 
+/* Number of Host Routers per motherboard is 2 */
+#define MAX_HR_NUM			2
+/* Number of DPIA per host router is 2 */
+#define MAX_DPIA_NUM		(MAX_HR_NUM * 2)
+
 /*
  * Host Router BW type
  */
@@ -92,6 +97,6 @@ void dpia_handle_bw_alloc_response(struct dc_link *link, uint8_t bw, uint8_t res
  *
  * return: TRUE if bw used by DPIAs doesn't exceed available BW else return FALSE
  */
-bool dpia_validate_usb4_bw(struct dc_link **link, int *bw_needed, uint8_t num_dpias);
+bool dpia_validate_usb4_bw(struct dc_link **link, int *bw_needed, const unsigned int num_dpias);
 
 #endif /* DC_INC_LINK_DP_DPIA_BW_H_ */
Signature · 1 line
2.34.1
#10 lore raw

PATCH 10/19 drm/amd/display: Add CRC and DMUB test support

In reply to Qingqing Zhuo

From: Charlene Liu <[email protected]>

[Why & How]
- Add CRC for test support
- Add params to allow control into to DMUB.

---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 29 +++++++++++++++++++
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h   |  2 ++
 .../gpu/drm/amd/display/include/dal_asic_id.h |  1 +
 3 files changed, 32 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +29 -0
index 0b37bb0e184b..db766689af58 100644
@@ -161,10 +161,20 @@ struct dcn_optc_registers {
 	uint32_t OTG_CRC_CNTL2;
 	uint32_t OTG_CRC0_DATA_RG;
 	uint32_t OTG_CRC0_DATA_B;
+	uint32_t OTG_CRC1_DATA_B;
+	uint32_t OTG_CRC2_DATA_B;
+	uint32_t OTG_CRC3_DATA_B;
+	uint32_t OTG_CRC1_DATA_RG;
+	uint32_t OTG_CRC2_DATA_RG;
+	uint32_t OTG_CRC3_DATA_RG;
 	uint32_t OTG_CRC0_WINDOWA_X_CONTROL;
 	uint32_t OTG_CRC0_WINDOWA_Y_CONTROL;
 	uint32_t OTG_CRC0_WINDOWB_X_CONTROL;
 	uint32_t OTG_CRC0_WINDOWB_Y_CONTROL;
+	uint32_t OTG_CRC1_WINDOWA_X_CONTROL;
+	uint32_t OTG_CRC1_WINDOWA_Y_CONTROL;
+	uint32_t OTG_CRC1_WINDOWB_X_CONTROL;
+	uint32_t OTG_CRC1_WINDOWB_Y_CONTROL;
 	uint32_t GSL_SOURCE_SELECT;
 	uint32_t DWB_SOURCE_SELECT;
 	uint32_t OTG_DSC_START_POSITION;
@@ -464,6 +474,15 @@ struct dcn_optc_registers {
 	type CRC0_R_CR;\
 	type CRC0_G_Y;\
 	type CRC0_B_CB;\
+	type CRC1_R_CR;\
+	type CRC1_G_Y;\
+	type CRC1_B_CB;\
+	type CRC2_R_CR;\
+	type CRC2_G_Y;\
+	type CRC2_B_CB;\
+	type CRC3_R_CR;\
+	type CRC3_G_Y;\
+	type CRC3_B_CB;\
 	type OTG_CRC0_WINDOWA_X_START;\
 	type OTG_CRC0_WINDOWA_X_END;\
 	type OTG_CRC0_WINDOWA_Y_START;\
@@ -472,6 +491,15 @@ struct dcn_optc_registers {
 	type OTG_CRC0_WINDOWB_X_END;\
 	type OTG_CRC0_WINDOWB_Y_START;\
 	type OTG_CRC0_WINDOWB_Y_END;\
+	type OTG_CRC_WINDOW_DB_EN;\
+	type OTG_CRC1_WINDOWA_X_START;\
+	type OTG_CRC1_WINDOWA_X_END;\
+	type OTG_CRC1_WINDOWA_Y_START;\
+	type OTG_CRC1_WINDOWA_Y_END;\
+	type OTG_CRC1_WINDOWB_X_START;\
+	type OTG_CRC1_WINDOWB_X_END;\
+	type OTG_CRC1_WINDOWB_Y_START;\
+	type OTG_CRC1_WINDOWB_Y_END;\
 	type GSL0_READY_SOURCE_SEL;\
 	type GSL1_READY_SOURCE_SEL;\
 	type GSL2_READY_SOURCE_SEL;\
@@ -525,6 +553,7 @@ struct dcn_optc_registers {
 #define TG_REG_FIELD_LIST_DCN3_2(type) \
 	type OTG_H_TIMING_DIV_MODE_MANUAL;
 
+
 struct dcn_optc_shift {
 	TG_REG_FIELD_LIST(uint8_t)
 	TG_REG_FIELD_LIST_DCN3_2(uint8_t)
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +2 -0
index a391b939d709..ba1715e2d25a 100644
@@ -261,6 +261,8 @@ struct dmub_srv_hw_params {
 	bool usb4_cm_version;
 	bool fw_in_system_memory;
 	bool dpia_hpd_int_enable_supported;
+	bool disable_clock_gate;
+	bool disallow_dispclk_dppclk_ds;
 };
 
 /**
drivers/gpu/drm/amd/display/include/dal_asic_id.h +1 -0
index c3089c673975..e317089cf6ee 100644
@@ -246,6 +246,7 @@ enum {
 
 #define AMDGPU_FAMILY_GC_11_0_0 145
 #define AMDGPU_FAMILY_GC_11_0_1 148
+#define AMDGPU_FAMILY_GC_11_5_0 150
 #define GC_11_0_0_A0 0x1
 #define GC_11_0_2_A0 0x10
 #define GC_11_0_3_A0 0x20
Signature · 1 line
2.34.1
#11 lore raw

PATCH 11/19 drm/amd/display: add missing code change init pix_per_cycle

In reply to Qingqing Zhuo

From: Charlene Liu <[email protected]>

[why]
missing change when port to these two dcn version.

---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c +1 -0
index 89de64f18040..d05e7655f603 100644
@@ -294,6 +294,7 @@ static void enc32_stream_encoder_dp_unblank(
 			|| is_dp_dig_pixel_rate_div_policy(dc, &param->timing)) {
 			/*this logic should be the same in get_pixel_clock_parameters() */
 			n_multiply = 1;
+			pix_per_cycle = 1;
 		}
 		/* M / N = Fstream / Flink
 		 * m_vid / n_vid = pixel rate / link rate
Signature · 1 line
2.34.1
#12 lore raw

PATCH 12/19 drm/amd/display: Set MPC_SPLIT_DYNAMIC for DCN10

In reply to Qingqing Zhuo

From: Rodrigo Siqueira <[email protected]>

Since DC version 3.2.226, DC started to use a new internal commit sequence that better deals with multiple hardware constraints. One of the improvements is a more reliable sequence for pipe split. Due to the transition made in version 3.2.226, it should be more reliable to use the pipe policy as MPC_SPLIT_DYNAMIC, and this commit makes this change.

---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +2 -2
index 2bb8e11f26e0..21ec1ba5ed75 100644
@@ -542,8 +542,8 @@ static const struct dc_debug_options debug_defaults_drv = {
 		.disable_pplib_clock_request = false,
 		.disable_pplib_wm_range = false,
 		.pplib_wm_report_mode = WM_REPORT_DEFAULT,
-		.pipe_split_policy = MPC_SPLIT_AVOID,
-		.force_single_disp_pipe_split = false,
+		.pipe_split_policy = MPC_SPLIT_DYNAMIC,
+		.force_single_disp_pipe_split = true,
 		.disable_dcc = DCC_ENABLE,
 		.voltage_align_fclk = true,
 		.disable_stereo_support = true,
Signature · 1 line
2.34.1
#13 lore raw

PATCH 13/19 drm/amd/display: Set MPC_SPLIT_DYNAMIC for DCN301

In reply to Qingqing Zhuo

From: Rodrigo Siqueira <[email protected]>

Since DC version 3.2.226, DC started to use a new internal commit sequence that better deals with hardware limitations. Usually, DC adopts split pipe dynamics to improve the display bandwidth and, in some cases, to save power. This commit sets MPC_SPLIT_DYNAMIC for DCN301, improving the bandwidth and fixing the cursor bug on KDE when it tries hardware rotation.

---
 drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1 -1
index b93b4498dba4..5ac2a272c380 100644
@@ -687,7 +687,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 	.disable_clock_gate = true,
 	.disable_pplib_clock_request = true,
 	.disable_pplib_wm_range = true,
-	.pipe_split_policy = MPC_SPLIT_AVOID,
+	.pipe_split_policy = MPC_SPLIT_DYNAMIC,
 	.force_single_disp_pipe_split = false,
 	.disable_dcc = DCC_ENABLE,
 	.vsr_support = true,
Signature · 1 line
2.34.1
#14 lore raw

PATCH 14/19 Revert "drm/amdgpu/display: change pipe policy for DCN 2.0"

In reply to Qingqing Zhuo

From: Alex Deucher <[email protected]>

This reverts commit bcfab8e35ce81e2fd3230c1575024bfde0d28c8b.

Hopefully this is fixed by the previous patch to enable TEMP_DEPENDENT_VMIN for navi1x or otherwise and we can re-enable MPC_SPLIT_DYNAMIC for DCN 2.0 for better power savings.

---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -1
index 77ef474ced07..1d8c5805ef20 100644
@@ -712,7 +712,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 		.timing_trace = false,
 		.clock_trace = true,
 		.disable_pplib_clock_request = true,
-		.pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP,
+		.pipe_split_policy = MPC_SPLIT_DYNAMIC,
 		.force_single_disp_pipe_split = false,
 		.disable_dcc = DCC_ENABLE,
 		.vsr_support = true,
Signature · 1 line
2.34.1
#15 lore raw

PATCH 15/19 drm/amd/display: align commit_planes_for_stream to latest dc code

In reply to Qingqing Zhuo

From: Hersen Wu <[email protected]>

[Why & How]
Due to historic issues, commit_planes_for_stream() has grown differently compared to latest dc code. Apply missed changes to make it aligned.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 26 +++---------------------
 1 file changed, 3 insertions(+), 23 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -23
index dc67256f565d..40f2e174c524 100644
@@ -3493,22 +3493,6 @@ static void commit_planes_for_stream(struct dc *dc,
 
 	dc_dmub_update_dirty_rect(dc, surface_count, stream, srf_updates, context);
 
-	if (update_type != UPDATE_TYPE_FAST) {
-		for (i = 0; i < dc->res_pool->pipe_count; i++) {
-			struct pipe_ctx *new_pipe = &context->res_ctx.pipe_ctx[i];
-
-			if ((new_pipe->stream && new_pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) ||
-					subvp_prev_use) {
-				// If old context or new context has phantom pipes, apply
-				// the phantom timings now. We can't change the phantom
-				// pipe configuration safely without driver acquiring
-				// the DMCUB lock first.
-				dc->hwss.apply_ctx_to_hw(dc, context);
-				break;
-			}
-		}
-	}
-
 	// Stream updates
 	if (stream_update)
 		commit_planes_do_stream_update(dc, stream, stream_update, update_type, context);
@@ -3724,6 +3708,9 @@ static void commit_planes_for_stream(struct dc *dc,
 		}
 	}
 
+	if (update_type != UPDATE_TYPE_FAST)
+		dc->hwss.post_unlock_program_front_end(dc, context);
+
 	if (subvp_prev_use && !subvp_curr_use) {
 		/* If disabling subvp, disable phantom streams after front end
 		 * programming has completed (we turn on phantom OTG in order
@@ -3732,16 +3719,9 @@ static void commit_planes_for_stream(struct dc *dc,
 		dc->hwss.apply_ctx_to_hw(dc, context);
 	}
 
-	if (update_type != UPDATE_TYPE_FAST)
-		dc->hwss.post_unlock_program_front_end(dc, context);
 	if (update_type != UPDATE_TYPE_FAST)
 		if (dc->hwss.commit_subvp_config)
 			dc->hwss.commit_subvp_config(dc, context);
-
-	if (update_type != UPDATE_TYPE_FAST)
-		if (dc->hwss.commit_subvp_config)
-			dc->hwss.commit_subvp_config(dc, context);
-
 	/* Since phantom pipe programming is moved to post_unlock_program_front_end,
 	 * move the SubVP lock to after the phantom pipes have been setup
 	 */
Signature · 1 line
2.34.1
#16 lore raw

PATCH 16/19 drm/amd/display: fix wrong index used in dccg32_set_dpstreamclk

In reply to Qingqing Zhuo

From: Hersen Wu <[email protected]>

[Why & How]
When merging commit 8f6de23e03f1 ("drm/amd/display: Fix DCN32 DPSTREAMCLK_CNTL programming"), index change was not picked up.

Cc Mario Limonciello <[email protected]>
Fixes 8f6de23e03f1 ("drm/amd/display: Fix DCN32 DPSTREAMCLK_CNTL programming")
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +1 -2
index 5dbef498580b..ffbb739d85b6 100644
@@ -293,8 +293,7 @@ static void dccg32_set_dpstreamclk(
 	dccg32_set_dtbclk_p_src(dccg, src, otg_inst);
 
 	/* enabled to select one of the DTBCLKs for pipe */
-	switch (otg_inst)
-	{
+	switch (dp_hpo_inst) {
 	case 0:
 		REG_UPDATE_2(DPSTREAMCLK_CNTL,
 			     DPSTREAMCLK0_EN,
Signature · 1 line
2.34.1
#17 lore raw

PATCH 17/19 drm/amd/display: Set dcn32 caps.seamless_odm

In reply to Qingqing Zhuo

From: Hersen Wu <[email protected]>

[Why & How]
seamless_odm set was not picked up while
merging 2d017189e2b3 ("drm/amd/display:
Blank eDP on enable drv if odm enabled")

Fixes 2d017189e2b3 ("drm/amd/display: Blank eDP on enable drv if odm enabled")
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -0
index 633491331722..1715909b1225 100644
@@ -2185,6 +2185,7 @@ static bool dcn32_resource_construct(
 	dc->caps.edp_dsc_support = true;
 	dc->caps.extended_aux_timeout_support = true;
 	dc->caps.dmcub_support = true;
+	dc->caps.seamless_odm = true;
 
 	/* Color pipeline capabilities */
 	dc->caps.color.dpp.dcn_arch = 1;
Signature · 1 line
2.34.1
#18 lore raw

PATCH 18/19 drm/amd/display: 3.2.228

In reply to Qingqing Zhuo

From: Aric Cyr <[email protected]>

This DC version brings along:
- Power down eDP if eDP not present
- Set MPC_SPLIT_DYNAMIC for DCN10 and DCN301
- Initialize link_srv in virtual env
- Code cleanup and alignment

---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 1e6fa2d387f7..475128db02bb 100644
@@ -45,7 +45,7 @@ struct aux_payload;
 struct set_config_cmd_payload;
 struct dmub_notification;
 
-#define DC_VER "3.2.227"
+#define DC_VER "3.2.228"
 
 #define MAX_SURFACES 3
 #define MAX_PLANES 6
Signature · 1 line
2.34.1
#19 lore raw

PATCH 19/19 drm/amdgpu/smu11: enable TEMP_DEPENDENT_VMIN for navi1x

In reply to Qingqing Zhuo

From: Alex Deucher <[email protected]>

May help stability with some navi1x boards.

Hopefully this helps with stability with multiple monitors and would allow us to re-enable MPC_SPLIT_DYNAMIC in the DC code for better power savings.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +2 -1
index 95da6dd1cc65..c4000518dc56 100644
@@ -304,7 +304,8 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
 				| FEATURE_MASK(FEATURE_GFX_SS_BIT)
 				| FEATURE_MASK(FEATURE_APCC_DFLL_BIT)
 				| FEATURE_MASK(FEATURE_FW_CTF_BIT)
-				| FEATURE_MASK(FEATURE_OUT_OF_BAND_MONITOR_BIT);
+				| FEATURE_MASK(FEATURE_OUT_OF_BAND_MONITOR_BIT)
+				| FEATURE_MASK(FEATURE_TEMP_DEPENDENT_VMIN_BIT);
 
 	if (adev->pm.pp_feature & PP_SCLK_DPM_MASK)
 		*(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_DPM_GFXCLK_BIT);
Signature · 1 line
2.34.1
Reviewed-by on v1 19/19
#20 lore raw

RE: [PATCH 19/19] drm/amdgpu/smu11: enable TEMP_DEPENDENT_VMIN for navi1x

[AMD Official Use Only - General]

Better to update the subject with prefix as "drm/amd/pm" to align with other power changes. Either way the patch is

BR
Evan

Quoted 55 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Qingqing Zhuo
Sent: Saturday, March 18, 2023 3:56 PM
To: [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Deucher, Alexander <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: [PATCH 19/19] drm/amdgpu/smu11: enable TEMP_DEPENDENT_VMIN for navi1x

From: Alex Deucher <[email protected]>

May help stability with some navi1x boards.

Hopefully this helps with stability with multiple monitors and would allow us to re-enable MPC_SPLIT_DYNAMIC in the DC code for better power savings.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +2 -1
index 95da6dd1cc65..c4000518dc56 100644
@@ -304,7 +304,8 @@ navi10_get_allowed_feature_mask(struct
 smu_context *smu,
 				| FEATURE_MASK(FEATURE_GFX_SS_BIT)
 				| FEATURE_MASK(FEATURE_APCC_DFLL_BIT)
 				| FEATURE_MASK(FEATURE_FW_CTF_BIT)
-				|
 FEATURE_MASK(FEATURE_OUT_OF_BAND_MONITOR_BIT);
+				|
 FEATURE_MASK(FEATURE_OUT_OF_BAND_MONITOR_BIT)
+				|

FEATURE_MASK(FEATURE_TEMP_DEPENDENT_VMIN_BIT);

drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0 -0
 	if (adev->pm.pp_feature & PP_SCLK_DPM_MASK)
 		*(uint64_t *)feature_mask |=

FEATURE_MASK(FEATURE_DPM_GFXCLK_BIT);
--
2.34.1

author Reviewed-by Evan Quan
#21 lore raw

RE: [PATCH 19/19] drm/amdgpu/smu11: enable TEMP_DEPENDENT_VMIN for navi1x

[AMD Official Use Only - General]

Thanks Evan! Will do.

Thanks,
Lillian

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Monday, March 20, 2023 4:26 AM
To: Zhuo, Qingqing (Lillian) <[email protected]>; [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Deucher, Alexander <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: RE: [PATCH 19/19] drm/amdgpu/smu11: enable TEMP_DEPENDENT_VMIN for navi1x

[AMD Official Use Only - General]

Better to update the subject with prefix as "drm/amd/pm" to align with other power changes. Either way the patch is

BR
Evan

Quoted 55 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Qingqing Zhuo
Sent: Saturday, March 18, 2023 3:56 PM
To: [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Deucher, Alexander <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: [PATCH 19/19] drm/amdgpu/smu11: enable TEMP_DEPENDENT_VMIN for navi1x

From: Alex Deucher <[email protected]>

May help stability with some navi1x boards.

Hopefully this helps with stability with multiple monitors and would allow us to re-enable MPC_SPLIT_DYNAMIC in the DC code for better power savings.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +2 -1
index 95da6dd1cc65..c4000518dc56 100644
@@ -304,7 +304,8 @@ navi10_get_allowed_feature_mask(struct
 smu_context *smu,
                              | FEATURE_MASK(FEATURE_GFX_SS_BIT)
                              | FEATURE_MASK(FEATURE_APCC_DFLL_BIT)
                              | FEATURE_MASK(FEATURE_FW_CTF_BIT)
-                             |
 FEATURE_MASK(FEATURE_OUT_OF_BAND_MONITOR_BIT);
+                             |
 FEATURE_MASK(FEATURE_OUT_OF_BAND_MONITOR_BIT)
+                             |

FEATURE_MASK(FEATURE_TEMP_DEPENDENT_VMIN_BIT);

      if (adev->pm.pp_feature & PP_SCLK_DPM_MASK)
              *(uint64_t *)feature_mask |=

FEATURE_MASK(FEATURE_DPM_GFXCLK_BIT);
--
2.34.1

Tested-by on the v1 series
#22 lore raw
In reply to Qingqing Zhuo

[AMD Official Use Only - General]

Hi all,

This week this patchset was tested on the following systems:

Lenovo Thinkpad T14s Gen2, with AMD Ryzen 5 5650U
Lenovo Thinkpad T13s Gen4 with AMD Ryzen 5 6600U
Reference AMD RX6800

These systems were tested on the following display types:
eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U]) 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 HP Hook G2 with 1 and 2 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 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.1 and Chrome OS

Thank you,

Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com

-----Original Message-----
From: Zhuo, Qingqing (Lillian) <[email protected]>
Sent: March 18, 2023 3:56 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Wang, Chao-kai (Stylon) <[email protected]>; Chiu, Solomon <[email protected]>; Kotarac, Pavle <[email protected]>; Gutierrez, Agustin <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 00/19] DC Patches Mar 20th, 2023

This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Power down eDP if eDP not present
- Set MPC_SPLIT_DYNAMIC for DCN10 and DCN301
- Initialize link_srv in virtual env
- Code cleanup and alignment

Cc Daniel Wheeler <[email protected]>

---

Alex Deucher (2):
Revert "drm/amdgpu/display: change pipe policy for DCN 2.0" drm/amdgpu/smu11: enable TEMP_DEPENDENT_VMIN for navi1x

Alex Hung (1):
drm/amd/display: remove outdated 8bpc comments

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

Charlene Liu (3):
drm/amd/display: update dio for two pixel per container case drm/amd/display: Add CRC and DMUB test support drm/amd/display: add missing code change init pix_per_cycle

Hersen Wu (3):
drm/amd/display: align commit_planes_for_stream to latest dc code drm/amd/display: fix wrong index used in dccg32_set_dpstreamclk drm/amd/display: Set dcn32 caps.seamless_odm

Martin Leung (1):
drm/amd/display: initialize link_srv in virtual env

Mustapha Ghaddar (1):
drm/amd/display: Add function pointer for validate bw usb4

Paul Hsieh (1):
drm/amd/display: power down eDP if eDP not present

Rodrigo Siqueira (3):
drm/amd/display: Add const to a function drm/amd/display: Set MPC_SPLIT_DYNAMIC for DCN10 drm/amd/display: Set MPC_SPLIT_DYNAMIC for DCN301

Saaem Rizvi (1):
drm/amd/display: Implement workaround for writing to
OTG_PIXEL_RATE_DIV register

Wesley Chalmers (1):
drm/amd/display: Make DCN32 3dlut function available to future DCNs

Zhikai Zhai (1):
drm/amd/display: skip wait vblank

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  1 -
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 27 +++--------------
 .../drm/amd/display/dc/core/dc_link_exports.c |  8 +++--
 drivers/gpu/drm/amd/display/dc/dc.h           | 18 ++++++++++--
 .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 29 +++++++++++++++++++  .../drm/amd/display/dc/dcn10/dcn10_resource.c |  4 +--  .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h |  3 +-
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    |  4 +--
 .../drm/amd/display/dc/dcn20/dcn20_resource.c |  2 +-
 .../amd/display/dc/dcn301/dcn301_resource.c   |  2 +-
 .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 25 ++++++++++++++--  .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.h |  3 +-
 .../dc/dcn32/dcn32_dio_stream_encoder.c       |  6 ++++
 .../drm/amd/display/dc/dcn32/dcn32_hwseq.c    |  4 +--
 .../drm/amd/display/dc/dcn32/dcn32_hwseq.h    |  3 ++
 .../drm/amd/display/dc/dcn32/dcn32_resource.c |  1 +  .../drm/amd/display/dc/dcn32/dcn32_resource.h |  3 +-
 drivers/gpu/drm/amd/display/dc/inc/link.h     |  3 ++
 .../drm/amd/display/dc/link/link_detection.c  |  5 ++++
 .../drm/amd/display/dc/link/link_factory.c    |  1 +
 .../drm/amd/display/dc/link/link_validation.c | 18 ++++++++++++  .../drm/amd/display/dc/link/link_validation.h |  4 +++
 .../dc/link/protocols/link_dp_dpia_bw.c       |  9 ++----
 .../dc/link/protocols/link_dp_dpia_bw.h       |  7 ++++-
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h   |  2 ++
 .../gpu/drm/amd/display/include/dal_asic_id.h |  1 +
 .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c   |  3 +-
 27 files changed, 144 insertions(+), 52 deletions(-)

--
2.34.1