Skip to contentSkip to conversation

DC Patches Feburary 16, 2026

PATCH In review Ray Wu 3 participants 21 messages Feb 10 – Feb 17

Subsystems (4)
lore
Share & tools
lore

Ray Wu

author
#0 lore raw

cover DC Patches Feburary 16, 2026

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

- Add static keyword for sharpness tables.
- Refactor fams2 calculations.
- Add gpuvm and hvm params to dml21.
- Expose functions of other dcn use.
- Extend inbox0 HW lock support to DCN35.
- Disable SR feature on eDP1 by default.
- Implement ramless idle mouse trigger.
- Migrate DCCG register access from hwseq to dccg component.
- Skip eDP detection when no sink.
- Refactor and fix link_dpms
- Correct logic check error for fastboot.
- Check return of shaper curve to HW format.
- Remove conditional for shaper 3DLUT power-on.

Cc Dan Wheeler <[email protected]>

Alex Hung (2):
drm/amd/display: Check return of shaper curve to HW format drm/amd/display: Remove conditional for shaper 3DLUT power-on

Bhuvanachandra Pinninti (1):
drm/amd/display: Migrate DCCG registers access from hwseq to dccg
component.

Charlene Liu (2):
drm/amd/display: Disable SR feature on eDP1 by default drm/amd/display: Correct logic check error for fastboot

Dillon Varone (1):
drm/amd/display: Refactor fams2 calculations

Dmytro Laktyushkin (2):
drm/amd/display: Add gpuvm and hvm params to dml21 drm/amd/display: Expose functions of other dcn use

Dominik Kaszewski (2):
drm/amd/display: Refactor and fix link_dpms I2C drm/amd/display: Refactor and fix link_dpms info

Muaaz Nisar (1):
drm/amd/display: Implementing ramless idle mouse trigger

Nicholas Carbones (3):
Revert "drm/amd/display: Add Handling for gfxversion DcGfxBase" Revert "drm/amd/display: Correct hubp GfxVersion verification" Revert "drm/amd/display: Add Gfx Base Case For Linear Tiling Handling"

Saidireddy Yenugu (1):
drm/amd/display: Skip eDP detection when no sink

Samson Tam (1):
drm/amd/display: Add static keyword for sharpness tables

Taimur Hassan (1):
drm/amd/display: Promote DC to 3.2.370

Webb Chen (1):
drm/amd/display: Extend inbox0 HW lock support to DCN35

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   6 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  12 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c |   8 +
 drivers/gpu/drm/amd/display/dc/core/dc.c      |   5 +-
 .../drm/amd/display/dc/core/dc_hw_sequencer.c |   7 -
 .../gpu/drm/amd/display/dc/core/dc_resource.c |   1 -
 .../gpu/drm/amd/display/dc/core/dc_stream.c   |  15 +
 drivers/gpu/drm/amd/display/dc/dc.h           |   3 +-
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h  |   3 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |   9 +
 .../amd/display/dc/dccg/dcn20/dcn20_dccg.c    |  54 +-
 .../amd/display/dc/dccg/dcn20/dcn20_dccg.h    |  14 +-
 .../amd/display/dc/dccg/dcn201/dcn201_dccg.c  |   7 +-
 .../amd/display/dc/dccg/dcn21/dcn21_dccg.c    |   6 +-
 .../amd/display/dc/dccg/dcn30/dcn30_dccg.c    |   6 +-
 .../amd/display/dc/dccg/dcn301/dcn301_dccg.c  |   6 +-
 .../amd/display/dc/dccg/dcn31/dcn31_dccg.c    |   5 +
 .../amd/display/dc/dccg/dcn314/dcn314_dccg.c  |   7 +-
 .../amd/display/dc/dccg/dcn32/dcn32_dccg.c    |   5 +
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    |  11 +-
 .../amd/display/dc/dccg/dcn401/dcn401_dccg.c  |  17 +-
 .../drm/amd/display/dc/dce/dce_mem_input.c    |   3 -
 .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c |   5 +
 .../display/dc/dce110/dce110_mem_input_v.c    |   3 -
 drivers/gpu/drm/amd/display/dc/dm_helpers.h   |   2 +-
 .../drm/amd/display/dc/dml/calcs/dcn_calcs.c  |   1 -
 .../dml2_0/dml21/dml21_translation_helper.c   |  11 +-
 .../amd/display/dc/dml2_0/dml21/dml21_utils.c | 205 +++---
 .../amd/display/dc/dml2_0/dml21/dml21_utils.h |   1 +
 .../dml21/inc/dml_top_soc_parameter_types.h   |   2 +
 .../drm/amd/display/dc/dml2_0/dml2_wrapper.h  |   1 +
 .../display/dc/hubbub/dcn401/dcn401_hubbub.c  |  10 +-
 .../display/dc/hubbub/dcn401/dcn401_hubbub.h  |  10 +
 .../amd/display/dc/hubp/dcn10/dcn10_hubp.c    |  33 +-
 .../amd/display/dc/hubp/dcn20/dcn20_hubp.c    |  26 +-
 .../amd/display/dc/hubp/dcn30/dcn30_hubp.c    |  26 +-
 .../amd/display/dc/hubp/dcn401/dcn401_hubp.c  |   7 +-
 .../amd/display/dc/hwss/dce110/dce110_hwseq.c |   4 +-
 .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c   |   5 +-
 .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c   |  29 +-
 .../amd/display/dc/hwss/dcn201/dcn201_hwseq.c |   5 +-
 .../amd/display/dc/hwss/dcn21/dcn21_hwseq.c   |   9 +-
 .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c   |   5 +-
 .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c   |   5 +-
 .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c   |  11 +-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   |  48 +-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h   |   4 +
 .../amd/display/dc/hwss/dcn35/dcn35_init.c    |   2 +
 .../amd/display/dc/hwss/dcn351/dcn351_init.c  |   2 +
 .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c |   5 +-
 drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h  |   4 +
 .../drm/amd/display/dc/link/link_detection.c  |   2 +-
 .../gpu/drm/amd/display/dc/link/link_dpms.c   | 640 +++++++-----------
 .../drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c  |   3 +-
 .../amd/display/dc/optc/dcn35/dcn35_optc.c    |   6 +-
 .../amd/display/dc/optc/dcn35/dcn35_optc.h    |   9 +
 .../resource/dcn32/dcn32_resource_helpers.c   |   3 +-
 .../display/dc/sspl/dc_spl_isharp_filters.c   |   4 +-
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h   |   3 +-
 59 files changed, 698 insertions(+), 663 deletions(-)
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 1/18 drm/amd/display: Add static keyword for sharpness tables

From: Samson Tam <[email protected]>

[Why & How]
Sharpness tables are only accessed in dc_spl_isharp_filters source file.

---
 drivers/gpu/drm/amd/display/dc/sspl/dc_spl_isharp_filters.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_isharp_filters.c +2 -2
index 1d9edb89e47a..a75ab23b0726 100644
@@ -293,7 +293,7 @@ static const uint16_t filter_isharp_bs_3tap_64p_s1_12[99] = {
 };
 
 /* Pre-generated 1DLUT for given setup and sharpness level */
-struct isharp_1D_lut_pregen filter_isharp_1D_lut_pregen[NUM_SHARPNESS_SETUPS] = {
+static struct isharp_1D_lut_pregen filter_isharp_1D_lut_pregen[NUM_SHARPNESS_SETUPS] = {
 	{
 		0, 0,
 		{
@@ -332,7 +332,7 @@ struct isharp_1D_lut_pregen filter_isharp_1D_lut_pregen[NUM_SHARPNESS_SETUPS] =
 	},
 };
 
-struct scale_ratio_to_sharpness_level_adj sharpness_level_adj[NUM_SHARPNESS_ADJ_LEVELS] = {
+static struct scale_ratio_to_sharpness_level_adj sharpness_level_adj[NUM_SHARPNESS_ADJ_LEVELS] = {
 	{1125, 1000, 0},
 	{11, 10, 1},
 	{1075, 1000, 2},
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH 2/18 drm/amd/display: Refactor fams2 calculations

In reply to Ray Wu

From: Dillon Varone <[email protected]>

[WHY&HOW]
Cleanup calculations based on version to improve for future expansion.

---
 .../amd/display/dc/dml2_0/dml21/dml21_utils.c | 205 +++++++++---------
 .../amd/display/dc/dml2_0/dml21/dml21_utils.h |   1 +
 2 files changed, 107 insertions(+), 99 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_utils.c +106 -99
index f667026cb43e..732b994b8864 100644
@@ -374,128 +374,135 @@ void dml21_handle_phantom_streams_planes(const struct dc *dc, struct dc_state *c
 		dml2_map_dc_pipes(dml_ctx, context, NULL, &dml_ctx->v21.dml_to_dc_pipe_mapping, dc->current_state);
 }
 
-void dml21_build_fams2_programming(const struct dc *dc,
+static unsigned int dml21_build_fams2_stream_programming_v2(const struct dc *dc,
 		struct dc_state *context,
 		struct dml2_context *dml_ctx)
 {
-	int i, j, k;
+	int dc_stream_idx, dc_plane_idx, dc_pipe_idx;
 	unsigned int num_fams2_streams = 0;
 
-	/* reset fams2 data */
-	memset(&context->bw_ctx.bw.dcn.fams2_stream_base_params, 0, sizeof(union dmub_cmd_fams2_config) * DML2_MAX_PLANES);
-	memset(&context->bw_ctx.bw.dcn.fams2_stream_sub_params, 0, sizeof(union dmub_cmd_fams2_config) * DML2_MAX_PLANES);
-	memset(&context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2, 0, sizeof(union dmub_fams2_stream_static_sub_state_v2) * DML2_MAX_PLANES);
-	memset(&context->bw_ctx.bw.dcn.fams2_global_config, 0, sizeof(struct dmub_cmd_fams2_global_config));
+	for (dc_stream_idx = 0; dc_stream_idx < context->stream_count; dc_stream_idx++) {
+		int dml_stream_idx;
+		struct dc_stream_state *phantom_stream;
+		struct dc_stream_status *phantom_status;
+		enum fams2_stream_type type = 0;
 
-	if ((dml_ctx->v21.mode_programming.programming->fams2_required) ||
-		(dml_ctx->v21.mode_programming.programming->legacy_pstate_info_for_dmu)) {
-		for (i = 0; i < context->stream_count; i++) {
-			int dml_stream_idx;
-			struct dc_stream_state *phantom_stream;
-			struct dc_stream_status *phantom_status;
-			enum fams2_stream_type type = 0;
+		union dmub_cmd_fams2_config *static_base_state = &context->bw_ctx.bw.dcn.fams2_stream_base_params[num_fams2_streams];
+		union dmub_cmd_fams2_config *static_sub_state = &context->bw_ctx.bw.dcn.fams2_stream_sub_params[num_fams2_streams];
 
-			union dmub_cmd_fams2_config *static_base_state = &context->bw_ctx.bw.dcn.fams2_stream_base_params[num_fams2_streams];
-			union dmub_cmd_fams2_config *static_sub_state = &context->bw_ctx.bw.dcn.fams2_stream_sub_params[num_fams2_streams];
+		struct dc_stream_state *stream = context->streams[dc_stream_idx];
 
-			struct dc_stream_state *stream = context->streams[i];
+		if (context->stream_status[dc_stream_idx].plane_count == 0 ||
+				dml_ctx->config.svp_pstate.callbacks.get_stream_subvp_type(context, stream) == SUBVP_PHANTOM) {
+			/* can ignore blanked or phantom streams */
+			continue;
+		}
 
-			if (context->stream_status[i].plane_count == 0 ||
-					dml_ctx->config.svp_pstate.callbacks.get_stream_subvp_type(context, stream) == SUBVP_PHANTOM) {
-				/* can ignore blanked or phantom streams */
-				continue;
-			}
+		dml_stream_idx = dml21_helper_find_dml_pipe_idx_by_stream_id(dml_ctx, stream->stream_id);
+		if (dml_stream_idx < 0) {
+			ASSERT(dml_stream_idx >= 0);
+			continue;
+		}
 
-			dml_stream_idx = dml21_helper_find_dml_pipe_idx_by_stream_id(dml_ctx, stream->stream_id);
-			if (dml_stream_idx < 0) {
-				ASSERT(dml_stream_idx >= 0);
-				continue;
+		/* copy static state from PMO */
+		memcpy(static_base_state,
+				&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_base_params,
+				sizeof(union dmub_cmd_fams2_config));
+
+		memcpy(static_sub_state,
+				&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params,
+				sizeof(union dmub_cmd_fams2_config));
+
+		switch (dc->debug.fams_version.minor) {
+		case 1:
+		default:
+			type = static_base_state->stream_v1.base.type;
+
+			/* get information from context */
+			static_base_state->stream_v1.base.num_planes = context->stream_status[dc_stream_idx].plane_count;
+			static_base_state->stream_v1.base.otg_inst = context->stream_status[dc_stream_idx].primary_otg_inst;
+
+			/* populate pipe masks for planes */
+			for (dc_plane_idx = 0; dc_plane_idx < context->stream_status[dc_stream_idx].plane_count; dc_plane_idx++) {
+				for (dc_pipe_idx = 0; dc_pipe_idx < dc->res_pool->pipe_count; dc_pipe_idx++) {
+					if (context->res_ctx.pipe_ctx[dc_pipe_idx].stream &&
+							context->res_ctx.pipe_ctx[dc_pipe_idx].stream->stream_id == stream->stream_id &&
+							context->res_ctx.pipe_ctx[dc_pipe_idx].plane_state == context->stream_status[dc_stream_idx].plane_states[dc_plane_idx]) {
+						static_base_state->stream_v1.base.pipe_mask |= (1 << dc_pipe_idx);
+						static_base_state->stream_v1.base.plane_pipe_masks[dc_plane_idx] |= (1 << dc_pipe_idx);
+					}
+				}
 			}
+		}
 
-			/* copy static state from PMO */
-			memcpy(static_base_state,
-					&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_base_params,
-					sizeof(union dmub_cmd_fams2_config));
-
-			if (dc->debug.fams_version.major == 3) {
-				memcpy(&context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2[num_fams2_streams],
-						&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params_v2,
-						sizeof(union dmub_fams2_stream_static_sub_state_v2));
-			} else {
-				memcpy(static_sub_state,
-						&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params,
-						sizeof(union dmub_cmd_fams2_config));
-			}
+
+		/* get per method programming */
+		switch (type) {
+		case FAMS2_STREAM_TYPE_VBLANK:
+		case FAMS2_STREAM_TYPE_VACTIVE:
+		case FAMS2_STREAM_TYPE_DRR:
+			break;
+		case FAMS2_STREAM_TYPE_SUBVP:
+			phantom_stream = dml_ctx->config.svp_pstate.callbacks.get_paired_subvp_stream(context, stream);
+			if (!phantom_stream)
+				break;
+
+			phantom_status = dml_ctx->config.callbacks.get_stream_status(context, phantom_stream);
+
+			/* phantom status should always be present */
+			ASSERT(phantom_status);
+			if (!phantom_status)
+				break;
 
 			switch (dc->debug.fams_version.minor) {
 			case 1:
 			default:
-				type = static_base_state->stream_v1.base.type;
-
-				/* get information from context */
-				static_base_state->stream_v1.base.num_planes = context->stream_status[i].plane_count;
-				static_base_state->stream_v1.base.otg_inst = context->stream_status[i].primary_otg_inst;
-
-				/* populate pipe masks for planes */
-				for (j = 0; j < context->stream_status[i].plane_count; j++) {
-					for (k = 0; k < dc->res_pool->pipe_count; k++) {
-						if (context->res_ctx.pipe_ctx[k].stream &&
-								context->res_ctx.pipe_ctx[k].stream->stream_id == stream->stream_id &&
-								context->res_ctx.pipe_ctx[k].plane_state == context->stream_status[i].plane_states[j]) {
-							static_base_state->stream_v1.base.pipe_mask |= (1 << k);
-							static_base_state->stream_v1.base.plane_pipe_masks[j] |= (1 << k);
+				static_sub_state->stream_v1.sub_state.subvp.phantom_otg_inst = phantom_status->primary_otg_inst;
+
+				/* populate pipe masks for phantom planes */
+				for (dc_plane_idx = 0; dc_plane_idx < phantom_status->plane_count; dc_plane_idx++) {
+					for (dc_pipe_idx = 0; dc_pipe_idx < dc->res_pool->pipe_count; dc_pipe_idx++) {
+						if (context->res_ctx.pipe_ctx[dc_pipe_idx].stream &&
+								context->res_ctx.pipe_ctx[dc_pipe_idx].stream->stream_id == phantom_stream->stream_id &&
+								context->res_ctx.pipe_ctx[dc_pipe_idx].plane_state == phantom_status->plane_states[dc_plane_idx]) {
+							switch (dc->debug.fams_version.minor) {
+							case 1:
+							default:
+								static_sub_state->stream_v1.sub_state.subvp.phantom_pipe_mask |= (1 << dc_pipe_idx);
+								static_sub_state->stream_v1.sub_state.subvp.phantom_plane_pipe_masks[dc_plane_idx] |= (1 << dc_pipe_idx);
+							}
 						}
 					}
 				}
 			}
+			break;
+		default:
+			ASSERT(false);
+			break;
+		}
 
+		num_fams2_streams++;
+	}
 
-			/* get per method programming */
-			switch (type) {
-			case FAMS2_STREAM_TYPE_VBLANK:
-			case FAMS2_STREAM_TYPE_VACTIVE:
-			case FAMS2_STREAM_TYPE_DRR:
-				break;
-			case FAMS2_STREAM_TYPE_SUBVP:
-				phantom_stream = dml_ctx->config.svp_pstate.callbacks.get_paired_subvp_stream(context, stream);
-				if (!phantom_stream)
-					break;
-
-				phantom_status = dml_ctx->config.callbacks.get_stream_status(context, phantom_stream);
-
-				/* phantom status should always be present */
-				ASSERT(phantom_status);
-				if (!phantom_status)
-					break;
-
-				switch (dc->debug.fams_version.minor) {
-				case 1:
-				default:
-					static_sub_state->stream_v1.sub_state.subvp.phantom_otg_inst = phantom_status->primary_otg_inst;
-
-					/* populate pipe masks for phantom planes */
-					for (j = 0; j < phantom_status->plane_count; j++) {
-						for (k = 0; k < dc->res_pool->pipe_count; k++) {
-							if (context->res_ctx.pipe_ctx[k].stream &&
-									context->res_ctx.pipe_ctx[k].stream->stream_id == phantom_stream->stream_id &&
-									context->res_ctx.pipe_ctx[k].plane_state == phantom_status->plane_states[j]) {
-								switch (dc->debug.fams_version.minor) {
-								case 1:
-								default:
-									static_sub_state->stream_v1.sub_state.subvp.phantom_pipe_mask |= (1 << k);
-									static_sub_state->stream_v1.sub_state.subvp.phantom_plane_pipe_masks[j] |= (1 << k);
-								}
-							}
-						}
-					}
-				}
-				break;
-			default:
-				ASSERT(false);
-				break;
-			}
+	return num_fams2_streams;
+}
+
+void dml21_build_fams2_programming(const struct dc *dc,
+		struct dc_state *context,
+		struct dml2_context *dml_ctx)
+{
+	unsigned int num_fams2_streams = 0;
+
+	/* reset fams2 data */
+	memset(&context->bw_ctx.bw.dcn.fams2_stream_base_params, 0, sizeof(union dmub_cmd_fams2_config) * DML2_MAX_PLANES);
+	memset(&context->bw_ctx.bw.dcn.fams2_stream_sub_params, 0, sizeof(union dmub_cmd_fams2_config) * DML2_MAX_PLANES);
+	memset(&context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2, 0, sizeof(union dmub_fams2_stream_static_sub_state_v2) * DML2_MAX_PLANES);
+	memset(&context->bw_ctx.bw.dcn.fams2_global_config, 0, sizeof(struct dmub_cmd_fams2_global_config));
 
-			num_fams2_streams++;
+	if (dml_ctx->v21.mode_programming.programming->fams2_required ||
+			dml_ctx->v21.mode_programming.programming->legacy_pstate_info_for_dmu) {
+		if (dc->debug.fams_version.major == 2) {
+			num_fams2_streams = dml21_build_fams2_stream_programming_v2(dc, context, dml_ctx);
 		}
 	}
 
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_utils.h +1 -0
index 4bff52eaaef8..bff945a4ab3a 100644
@@ -9,6 +9,7 @@
 struct dc_state;
 struct dc_plane_state;
 struct pipe_ctx;
+struct dc_dmub_srv;
 
 struct dml2_context;
 struct dml2_display_rq_regs;
Signature · 1 line
2.43.0
author
#3 lore raw

PATCH 3/18 drm/amd/display: Add gpuvm and hvm params to dml21

In reply to Ray Wu

From: Dmytro Laktyushkin <[email protected]>

[Why & How]
Add missing params to display configuration for dml21

---
 .../display/dc/dml2_0/dml21/dml21_translation_helper.c    | 8 ++++++--
 .../dc/dml2_0/dml21/inc/dml_top_soc_parameter_types.h     | 2 ++
 drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.h      | 1 +
 3 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_translation_helper.c +6 -2
index 3f4963ce3a00..f4bcebd7ec7f 100644
@@ -737,8 +737,12 @@ bool dml21_map_dc_state_into_dml_display_cfg(const struct dc *in_dc, struct dc_s
 	memset(&dml_ctx->v21.dml_to_dc_pipe_mapping, 0, sizeof(struct dml2_dml_to_dc_pipe_mapping));
 
 	dml_dispcfg->gpuvm_enable = dml_ctx->config.gpuvm_enable;
-	dml_dispcfg->gpuvm_max_page_table_levels = 4;
-	dml_dispcfg->hostvm_enable = false;
+	if (dml_ctx->v21.dml_init.soc_bb.gpuvm_max_page_table_levels)
+		dml_dispcfg->gpuvm_max_page_table_levels = dml_ctx->v21.dml_init.soc_bb.gpuvm_max_page_table_levels;
+	else
+		dml_dispcfg->gpuvm_max_page_table_levels = 4;
+	dml_dispcfg->hostvm_enable = dml_ctx->config.hostvm_enable;
+	dml_dispcfg->hostvm_max_non_cached_page_table_levels = dml_ctx->v21.dml_init.soc_bb.hostvm_max_non_cached_page_table_levels;
 	dml_dispcfg->minimize_det_reallocation = true;
 	dml_dispcfg->overrides.enable_subvp_implicit_pmo = true;
 
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/inc/dml_top_soc_parameter_types.h +2 -0
index c4cce870877a..ddbb8dfa9ff8 100644
@@ -160,6 +160,8 @@ struct dml2_soc_bb {
 	unsigned long return_bus_width_bytes;
 	unsigned long hostvm_min_page_size_kbytes;
 	unsigned long gpuvm_min_page_size_kbytes;
+	unsigned int hostvm_max_non_cached_page_table_levels;
+	unsigned int gpuvm_max_page_table_levels;
 	double phy_downspread_percent;
 	double dcn_downspread_percent;
 	double dispclk_dppclk_vco_speed_mhz;
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.h +1 -0
index 9a9c27962f68..5ee489682f2e 100644
@@ -239,6 +239,7 @@ struct dml2_configuration_options {
 
 	bool use_clock_dc_limits;
 	bool gpuvm_enable;
+	bool hostvm_enable;
 	bool force_tdlut_enable;
 	void *bb_from_dmub;
 };
Signature · 1 line
2.43.0
author
#4 lore raw

PATCH 4/18 drm/amd/display: Expose functions of other dcn use

In reply to Ray Wu

From: Dmytro Laktyushkin <[email protected]>

[Why & HOw]
Expose some functions for later dcns to reuse

---
 .../drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c  | 15 +++++----------
 .../amd/display/dc/hubbub/dcn401/dcn401_hubbub.c  | 10 +++++-----
 .../amd/display/dc/hubbub/dcn401/dcn401_hubbub.h  | 10 ++++++++++
 .../drm/amd/display/dc/optc/dcn35/dcn35_optc.c    |  6 +++---
 .../drm/amd/display/dc/optc/dcn35/dcn35_optc.h    |  9 +++++++++
 5 files changed, 32 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c +5 -10
index 663a18ee5162..3063b6ab32e5 100644
@@ -595,16 +595,6 @@ void dccg401_set_dp_dto(
 
 	bool enable = false;
 
-	if (params->otg_inst > 3) {
-		/* dcn401 only has 4 instances */
-		BREAK_TO_DEBUGGER();
-		return;
-	}
-	if (!params->refclk_hz) {
-		BREAK_TO_DEBUGGER();
-		return;
-	}
-
 	if (!dc_is_tmds_signal(params->signal)) {
 		uint64_t dto_integer;
 		uint64_t dto_phase_hz;
@@ -612,6 +602,11 @@ void dccg401_set_dp_dto(
 
 		enable = true;
 
+		if (!params->refclk_hz) {
+			BREAK_TO_DEBUGGER();
+			return;
+		}
+
 		/* Set DTO values:
 		 * int = target_pix_rate / reference_clock
 		 * phase = target_pix_rate - int * reference_clock,
drivers/gpu/drm/amd/display/dc/hubbub/dcn401/dcn401_hubbub.c +5 -5
index d11afd1ce72a..941dce439e97 100644
@@ -41,7 +41,7 @@
 #define FN(reg_name, field_name) \
 	hubbub2->shifts->field_name, hubbub2->masks->field_name
 
-static void dcn401_init_crb(struct hubbub *hubbub)
+void dcn401_init_crb(struct hubbub *hubbub)
 {
 	struct dcn20_hubbub *hubbub2 = TO_DCN20_HUBBUB(hubbub);
 
@@ -1110,7 +1110,7 @@ bool hubbub401_get_dcc_compression_cap(struct hubbub *hubbub,
 	return true;
 }
 
-static void dcn401_program_det_segments(struct hubbub *hubbub, int hubp_inst, unsigned det_buffer_size_seg)
+void dcn401_program_det_segments(struct hubbub *hubbub, int hubp_inst, unsigned det_buffer_size_seg)
 {
 	struct dcn20_hubbub *hubbub2 = TO_DCN20_HUBBUB(hubbub);
 
@@ -1147,7 +1147,7 @@ static void dcn401_program_det_segments(struct hubbub *hubbub, int hubp_inst, un
 	}
 }
 
-static void dcn401_program_compbuf_segments(struct hubbub *hubbub, unsigned compbuf_size_seg, bool safe_to_increase)
+void dcn401_program_compbuf_segments(struct hubbub *hubbub, unsigned compbuf_size_seg, bool safe_to_increase)
 {
 	struct dcn20_hubbub *hubbub2 = TO_DCN20_HUBBUB(hubbub);
 
@@ -1170,7 +1170,7 @@ static void dcn401_program_compbuf_segments(struct hubbub *hubbub, unsigned comp
 	}
 }
 
-static void dcn401_wait_for_det_update(struct hubbub *hubbub, int hubp_inst)
+void dcn401_wait_for_det_update(struct hubbub *hubbub, int hubp_inst)
 {
 	struct dcn20_hubbub *hubbub2 = TO_DCN20_HUBBUB(hubbub);
 
@@ -1192,7 +1192,7 @@ static void dcn401_wait_for_det_update(struct hubbub *hubbub, int hubp_inst)
 	}
 }
 
-static bool dcn401_program_arbiter(struct hubbub *hubbub, struct dml2_display_arb_regs *arb_regs, bool safe_to_lower)
+bool dcn401_program_arbiter(struct hubbub *hubbub, struct dml2_display_arb_regs *arb_regs, bool safe_to_lower)
 {
 	struct dcn20_hubbub *hubbub2 = TO_DCN20_HUBBUB(hubbub);
 
drivers/gpu/drm/amd/display/dc/hubbub/dcn401/dcn401_hubbub.h +10 -0
index b1d9ea9d1c3d..f48715544429 100644
@@ -194,6 +194,11 @@ bool hubbub401_get_dcc_compression_cap(
 		const struct dc_dcc_surface_param *input,
 		struct dc_surface_dcc_cap *output);
 
+bool dcn401_program_arbiter(
+	struct hubbub *hubbub,
+	struct dml2_display_arb_regs *arb_regs,
+	bool safe_to_lower);
+
 void hubbub401_construct(struct dcn20_hubbub *hubbub2,
 	struct dc_context *ctx,
 	const struct dcn_hubbub_registers *hubbub_regs,
@@ -203,4 +208,9 @@ void hubbub401_construct(struct dcn20_hubbub *hubbub2,
 	int pixel_chunk_size_kb,
 	int config_return_buffer_size_kb);
 
+void dcn401_program_det_segments(struct hubbub *hubbub, int hubp_inst, unsigned det_buffer_size_seg);
+void dcn401_program_compbuf_segments(struct hubbub *hubbub, unsigned compbuf_size_seg, bool safe_to_increase);
+void dcn401_wait_for_det_update(struct hubbub *hubbub, int hubp_inst);
+void dcn401_init_crb(struct hubbub *hubbub);
+
 #endif
drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c +3 -3
index 0953acbcc6d4..5aafd0eedf66 100644
@@ -270,7 +270,7 @@ static bool optc35_get_crc(struct timing_generator *optc, uint8_t idx,
 	return true;
 }
 
-static bool optc35_configure_crc(struct timing_generator *optc,
+bool optc35_configure_crc(struct timing_generator *optc,
 				 const struct crc_params *params)
 {
 	struct optc *optc1 = DCN10TG_FROM_TG(optc);
@@ -437,7 +437,7 @@ void optc35_set_drr(
 	REG_WRITE(OTG_V_COUNT_STOP_CONTROL2, 0);
 }
 
-static void optc35_set_long_vtotal(
+void optc35_set_long_vtotal(
 	struct timing_generator *optc,
 	const struct long_vtotal_params *params)
 {
@@ -524,7 +524,7 @@ static void optc35_set_long_vtotal(
 	}
 }
 
-static void optc35_wait_otg_disable(struct timing_generator *optc)
+void optc35_wait_otg_disable(struct timing_generator *optc)
 {
 	struct optc *optc1;
 	uint32_t is_master_en;
drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.h +9 -0
index 5c2cb1f27783..82e0818c8f9f 100644
@@ -90,4 +90,13 @@ void dcn35_timing_generator_set_fgcg(struct optc *optc1, bool enable);
 
 void optc35_set_drr(struct timing_generator *optc, const struct drr_params *params);
 
+void optc35_set_long_vtotal(
+	struct timing_generator *optc,
+	const struct long_vtotal_params *params);
+
+bool optc35_configure_crc(struct timing_generator *optc,
+				 const struct crc_params *params);
+
+void optc35_wait_otg_disable(struct timing_generator *optc);
+
 #endif /* __DC_OPTC_DCN35_H__ */
Signature · 1 line
2.43.0
author
#5 lore raw

PATCH 5/18 drm/amd/display: Extend inbox0 HW lock support to DCN35

In reply to Ray Wu

From: Webb Chen <[email protected]>

[Why & How]
It is a SW lock mechanism to prevent racing with driver/FW.

---
 .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c |  5 +++
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   | 45 +++++++++++++++++++
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h   |  4 ++
 .../amd/display/dc/hwss/dcn35/dcn35_init.c    |  2 +
 .../amd/display/dc/hwss/dcn351/dcn351_init.c  |  2 +
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h   |  3 +-
 6 files changed, 60 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +5 -0
index 7116fdd4c7ec..f68cb10ab38b 100644
@@ -105,5 +105,10 @@ bool should_use_dmub_inbox1_lock(const struct dc *dc, const struct dc_link *link
 	if (dc->ctx->dce_version >= DCN_VERSION_4_01)
 		return false;
 
+	if ((dc->hwss.dmub_hw_control_lock) &&
+		(dc->hwss.dmub_hw_control_lock_fast) &&
+		(dc->ctx->dmub_srv->dmub->meta_info.feature_bits.bits.inbox0_lock_support))
+		return false;
+
 	return dmub_hw_lock_mgr_does_link_require_lock(dc, link);
 }
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +45 -0

54 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +4 -0
index e3459546a908..f84409f678ba 100644
@@ -27,6 +27,8 @@
 #ifndef __DC_HWSS_DCN35_H__
 #define __DC_HWSS_DCN35_H__
 
+#include "inc/core_types.h"
+#include "dc.h"
 #include "hw_sequencer_private.h"
 
 struct dc;
@@ -111,5 +113,7 @@ void dcn35_program_cursor_offload_now(struct dc *dc, const struct pipe_ctx *pipe
 void dcn35_disable_link_output(struct dc_link *link,
 		const struct link_resource *link_res,
 		enum signal_type signal);
+void dcn35_dmub_hw_control_lock(struct dc *dc, struct dc_state *context, bool lock);
+void dcn35_dmub_hw_control_lock_fast(union block_sequence_params *params);
 
 #endif /* __DC_HWSS_DCN35_H__ */
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +2 -0
index 6ac8ad97cf13..b3b4b8cae138 100644
@@ -134,6 +134,8 @@ static const struct hw_sequencer_funcs dcn35_funcs = {
 	.update_dchubp_dpp = dcn20_update_dchubp_dpp,
 	.post_unlock_reset_opp = dcn20_post_unlock_reset_opp,
 	.get_underflow_debug_data = dcn30_get_underflow_debug_data,
+	.dmub_hw_control_lock = dcn35_dmub_hw_control_lock,
+	.dmub_hw_control_lock_fast = dcn35_dmub_hw_control_lock_fast,
 };
 
 static const struct hwseq_private_funcs dcn35_private_funcs = {
drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +2 -0
index 04c260015eec..a7006322cde4 100644
@@ -123,6 +123,8 @@ static const struct hw_sequencer_funcs dcn351_funcs = {
 	.calculate_pix_rate_divider = dcn32_calculate_pix_rate_divider,
 	.setup_hpo_hw_control = dcn35_setup_hpo_hw_control,
 	.get_underflow_debug_data = dcn30_get_underflow_debug_data,
+	.dmub_hw_control_lock = dcn35_dmub_hw_control_lock,
+	.dmub_hw_control_lock_fast = dcn35_dmub_hw_control_lock_fast,
 };
 
 static const struct hwseq_private_funcs dcn351_private_funcs = {
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -1
index 6f388c910e18..555e35e55b03 100644
@@ -909,7 +909,8 @@ union dmub_fw_meta_feature_bits {
 	struct {
 		uint32_t shared_state_link_detection : 1; /**< 1 supports link detection via shared state */
 		uint32_t cursor_offload_v1_support: 1; /**< 1 supports cursor offload */
-		uint32_t reserved : 30;
+		uint32_t inbox0_lock_support: 1; /**< 1 supports inbox0 lock mechanism */
+		uint32_t reserved : 29;
 	} bits; /**< status bits */
 	uint32_t all; /**< 32-bit access to status bits */
 };
Signature · 1 line
2.43.0
author
#6 lore raw

PATCH 6/18 drm/amd/display: Disable SR feature on eDP1 by default

In reply to Ray Wu

From: Charlene Liu <[email protected]>

[Why & How]
Disable SR feature on eDP1 by default.

---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c    | 12 ++++++++++--
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c    |  8 ++++++++
 drivers/gpu/drm/amd/display/dc/dc.h                  |  1 -
 drivers/gpu/drm/amd/display/dc/dm_helpers.h          |  2 +-
 drivers/gpu/drm/amd/display/dc/link/link_detection.c |  2 +-
 5 files changed, 20 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +10 -2
index 1f41d6540b83..bf2a356b3475 100644
@@ -1153,11 +1153,19 @@ void dm_helpers_init_panel_settings(
 
 void dm_helpers_override_panel_settings(
 	struct dc_context *ctx,
-	struct dc_panel_config *panel_config)
+	struct dc_link *link)
 {
+	unsigned int panel_inst = 0;
+
 	// Feature DSC
 	if (amdgpu_dc_debug_mask & DC_DISABLE_DSC)
-		panel_config->dsc.disable_dsc_edp = true;
+		link->panel_config.dsc.disable_dsc_edp = true;
+
+	if (dc_get_edp_link_panel_inst(ctx->dc, link, &panel_inst) && panel_inst == 1) {
+			link->panel_config.psr.disable_psr = true;
+			link->panel_config.psr.disallow_psrsu = true;;
+			link->panel_config.psr.disallow_replay = true;
+	}
 }
 
 void *dm_helpers_allocate_gpu_mem(
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +8 -0
index fd491b7a3cd7..99d6d6c93561 100644
@@ -80,12 +80,20 @@ void amdgpu_dm_set_psr_caps(struct dc_link *link)
 		link->psr_settings.psr_feature_enabled = false;
 
 	} else {
+		unsigned int panel_inst = 0;
+
 		if (link_supports_psrsu(link))
 			link->psr_settings.psr_version = DC_PSR_VERSION_SU_1;
 		else
 			link->psr_settings.psr_version = DC_PSR_VERSION_1;
 
 		link->psr_settings.psr_feature_enabled = true;
+
+		/*disable allow psr/psrsu/replay on eDP1*/
+		if (dc_get_edp_link_panel_inst(link->ctx->dc, link, &panel_inst) && panel_inst == 1) {
+			link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED;
+			link->psr_settings.psr_feature_enabled = false;
+		}
 	}
 }
 
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
index ce08477d1ccd..4c4239cac863 100644
@@ -505,7 +505,6 @@ union allow_lttpr_non_transparent_mode {
 	} bits;
 	unsigned char raw;
 };
-
 /* Structure to hold configuration flags set by dm at dc creation. */
 struct dc_config {
 	bool gpu_vm_support;
drivers/gpu/drm/amd/display/dc/dm_helpers.h +1 -1
index 7014b8c2c956..2818df555e62 100644
@@ -209,7 +209,7 @@ void dm_helpers_init_panel_settings(
 	struct dc_sink *sink);
 void dm_helpers_override_panel_settings(
 	struct dc_context *ctx,
-	struct dc_panel_config *config);
+	struct dc_link *link);
 int dm_helper_dmub_aux_transfer_sync(
 		struct dc_context *ctx,
 		const struct dc_link *link,
drivers/gpu/drm/amd/display/dc/link/link_detection.c +1 -1
index 578509e8d0e2..b2c020071cbf 100644
@@ -1333,7 +1333,7 @@ static bool detect_link_and_local_sink(struct dc_link *link,
 			// Pickup base DM settings
 			dm_helpers_init_panel_settings(dc_ctx, &link->panel_config, sink);
 			// Override dc_panel_config if system has specific settings
-			dm_helpers_override_panel_settings(dc_ctx, &link->panel_config);
+			dm_helpers_override_panel_settings(dc_ctx, link);
 
 			//sink only can use supported link rate table, we are foreced to enable it
 			if (link->reported_link_cap.link_rate == LINK_RATE_UNKNOWN)
Signature · 1 line
2.43.0
author
#7 lore raw

PATCH 7/18 drm/amd/display: Implementing ramless idle mouse trigger

In reply to Ray Wu

From: Muaaz Nisar <[email protected]>

[Why & How]
Adding mouse trigger in dc_stream to recover from low refresh rate idle state upon mouse movement without vsync interrupts.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c        |  4 ++++
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 15 +++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc_stream.h      |  9 +++++++++
 3 files changed, 28 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -0
index 17ba7af0ddcd..6f3c283431d4 100644
@@ -3369,6 +3369,10 @@ static void copy_stream_update_to_stream(struct dc *dc,
 		stream->scaler_sharpener_update = *update->scaler_sharpener_update;
 	if (update->sharpening_required)
 		stream->sharpening_required = *update->sharpening_required;
+
+	if (update->drr_trigger_mode) {
+		stream->drr_trigger_mode = *update->drr_trigger_mode;
+	}
 }
 
 static void backup_planes_and_stream_state(
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +15 -0
index 9349cccc8438..191f6435e7c6 100644
@@ -515,6 +515,21 @@ bool dc_stream_program_cursor_position(
 			}
 		}
 
+		if (stream->drr_trigger_mode == DRR_TRIGGER_ON_FLIP_AND_CURSOR) {
+			/* apply manual trigger */
+			int i;
+
+			for (i = 0; i < dc->res_pool->pipe_count; i++) {
+				struct pipe_ctx *pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];
+
+				/* trigger event on first pipe with current stream */
+				if (stream == pipe_ctx->stream) {
+					pipe_ctx->stream_res.tg->funcs->program_manual_trigger(pipe_ctx->stream_res.tg);
+					break;
+				}
+			}
+		}
+
 		return true;
 	}
 
drivers/gpu/drm/amd/display/dc/dc_stream.h +9 -0
index 9960494007ff..86394203cee7 100644
@@ -183,6 +183,11 @@ struct luminance_data {
 	int dm_max_decrease_from_nominal;
 };
 
+enum dc_drr_trigger_mode {
+	DRR_TRIGGER_ON_FLIP = 0,
+	DRR_TRIGGER_ON_FLIP_AND_CURSOR,
+};
+
 struct dc_stream_state {
 	// sink is deprecated, new code should not reference
 	// this pointer
@@ -316,6 +321,8 @@ struct dc_stream_state {
 	bool scaler_sharpener_update;
 	bool sharpening_required;
 
+	enum dc_drr_trigger_mode drr_trigger_mode;
+
 	struct dc_update_scratch_space *update_scratch;
 };
 
@@ -366,6 +373,8 @@ struct dc_stream_update {
 	bool *hw_cursor_req;
 	bool *scaler_sharpener_update;
 	bool *sharpening_required;
+
+	enum dc_drr_trigger_mode *drr_trigger_mode;
 };
 
 bool dc_is_stream_unchanged(
Signature · 1 line
2.43.0
author
#8 lore raw

PATCH 8/18 drm/amd/display: Migrate DCCG registers access from hwseq to dccg component.

In reply to Ray Wu

From: Bhuvanachandra Pinninti <[email protected]>

[Why]
Direct DCCG register access in hwseq layer was creating register conflicts.

[How]
Migrated DCCG registers from hwseq-dccg component.

---
 .../amd/display/dc/dccg/dcn20/dcn20_dccg.c    | 54 ++++++++++++++++++-
 .../amd/display/dc/dccg/dcn20/dcn20_dccg.h    | 14 +++--
 .../amd/display/dc/dccg/dcn201/dcn201_dccg.c  |  7 ++-
 .../amd/display/dc/dccg/dcn21/dcn21_dccg.c    |  6 ++-
 .../amd/display/dc/dccg/dcn30/dcn30_dccg.c    |  6 ++-
 .../amd/display/dc/dccg/dcn301/dcn301_dccg.c  |  6 ++-
 .../amd/display/dc/dccg/dcn31/dcn31_dccg.c    |  5 ++
 .../amd/display/dc/dccg/dcn314/dcn314_dccg.c  |  7 ++-
 .../amd/display/dc/dccg/dcn32/dcn32_dccg.c    |  5 ++
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    | 11 +++-
 .../amd/display/dc/dccg/dcn401/dcn401_dccg.c  |  2 +
 .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c   |  5 +-
 .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c   | 29 +++-------
 .../amd/display/dc/hwss/dcn201/dcn201_hwseq.c |  5 +-
 .../amd/display/dc/hwss/dcn21/dcn21_hwseq.c   |  9 ++--
 .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c   |  5 +-
 .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c   |  5 +-
 .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c   |  5 +-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   |  3 +-
 .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c |  5 +-
 drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h  |  4 ++
 21 files changed, 143 insertions(+), 55 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.c +53 -1
index 33d8bd91cb01..733b85d450d9 100644
@@ -131,6 +131,54 @@ void dccg2_otg_drop_pixel(struct dccg *dccg,
 
 void dccg2_init(struct dccg *dccg)
 {
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+
+	/* Hardcoded register values for DCN20
+	 * These are specific to 100Mhz refclk
+	 * Different ASICs with different refclk may override this in their own init
+	 */
+	REG_WRITE(MICROSECOND_TIME_BASE_DIV, 0x00120264);
+	REG_WRITE(MILLISECOND_TIME_BASE_DIV, 0x001186a0);
+	REG_WRITE(DISPCLK_FREQ_CHANGE_CNTL, 0x0e01003c);
+
+	if (REG(REFCLK_CNTL))
+		REG_WRITE(REFCLK_CNTL, 0);
+}
+
+void dccg2_refclk_setup(struct dccg *dccg)
+{
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+
+	/* REFCLK programming that must occur after hubbub initialization */
+	if (REG(REFCLK_CNTL))
+		REG_WRITE(REFCLK_CNTL, 0);
+}
+
+bool dccg2_is_s0i3_golden_init_wa_done(struct dccg *dccg)
+{
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+
+	return REG_READ(MICROSECOND_TIME_BASE_DIV) == 0x00120464;
+}
+
+void dccg2_allow_clock_gating(struct dccg *dccg, bool allow)
+{
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+
+	if (allow) {
+		REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0);
+		REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0);
+	} else {
+		REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0xFFFFFFFF);
+		REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0xFFFFFFFF);
+	}
+}
+
+void dccg2_enable_memory_low_power(struct dccg *dccg, bool enable)
+{
+	struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+
+	REG_UPDATE(DC_MEM_GLOBAL_PWR_REQ_CNTL, DC_MEM_GLOBAL_PWR_REQ_DIS, enable ? 0 : 1);
 }
 
 static const struct dccg_funcs dccg2_funcs = {
@@ -139,7 +187,11 @@ static const struct dccg_funcs dccg2_funcs = {
 	.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
 	.otg_add_pixel = dccg2_otg_add_pixel,
 	.otg_drop_pixel = dccg2_otg_drop_pixel,
-	.dccg_init = dccg2_init
+	.dccg_init = dccg2_init,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 struct dccg *dccg2_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn20/dcn20_dccg.h +11 -3
index 8bdffd9ff31b..3711d400773a 100644
@@ -37,7 +37,8 @@
 	SR(REFCLK_CNTL),\
 	DCCG_SRII(PIXEL_RATE_CNTL, OTG, 0),\
 	DCCG_SRII(PIXEL_RATE_CNTL, OTG, 1),\
-	SR(DISPCLK_FREQ_CHANGE_CNTL)
+	SR(DISPCLK_FREQ_CHANGE_CNTL),\
+	SR(DC_MEM_GLOBAL_PWR_REQ_CNTL)
 
 #define DCCG_REG_LIST_DCN2() \
 	DCCG_COMMON_REG_LIST_DCN_BASE(),\
@@ -81,7 +82,8 @@
 	DCCG_SFII(OTG, PIXEL_RATE_CNTL, OTG, ADD_PIXEL, 0, mask_sh),\
 	DCCG_SFII(OTG, PIXEL_RATE_CNTL, OTG, ADD_PIXEL, 1, mask_sh),\
 	DCCG_SFII(OTG, PIXEL_RATE_CNTL, OTG, DROP_PIXEL, 0, mask_sh),\
-	DCCG_SFII(OTG, PIXEL_RATE_CNTL, OTG, DROP_PIXEL, 1, mask_sh)
+	DCCG_SFII(OTG, PIXEL_RATE_CNTL, OTG, DROP_PIXEL, 1, mask_sh),\
+	DCCG_SF(DC_MEM_GLOBAL_PWR_REQ_CNTL, DC_MEM_GLOBAL_PWR_REQ_DIS, mask_sh)
 
 
 
@@ -130,7 +132,8 @@
 	type DISPCLK_CHG_FWD_CORR_DISABLE;\
 	type DISPCLK_FREQ_CHANGE_CNTL;\
 	type OTG_ADD_PIXEL[MAX_PIPES];\
-	type OTG_DROP_PIXEL[MAX_PIPES];
+	type OTG_DROP_PIXEL[MAX_PIPES];\
+	type DC_MEM_GLOBAL_PWR_REQ_DIS;
 
 #define DCCG3_REG_FIELD_LIST(type) \
 	type HDMICHARCLK0_EN;\
@@ -515,6 +518,11 @@ void dccg2_otg_drop_pixel(struct dccg *dccg,
 
 void dccg2_init(struct dccg *dccg);
 
+void dccg2_refclk_setup(struct dccg *dccg);
+void dccg2_allow_clock_gating(struct dccg *dccg, bool allow);
+void dccg2_enable_memory_low_power(struct dccg *dccg, bool enable);
+bool dccg2_is_s0i3_golden_init_wa_done(struct dccg *dccg);
+
 struct dccg *dccg2_create(
 	struct dc_context *ctx,
 	const struct dccg_registers *regs,
drivers/gpu/drm/amd/display/dc/dccg/dcn201/dcn201_dccg.c +6 -1
index 9a3402148fde..79d14ce19393 100644
@@ -24,6 +24,7 @@
  */
 
 #include "dcn201_dccg.h"
+#include "dcn20/dcn20_dccg.h"
 
 #include "reg_helper.h"
 #include "core_types.h"
@@ -56,7 +57,11 @@ static const struct dccg_funcs dccg201_funcs = {
 	.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
 	.otg_add_pixel = dccg2_otg_add_pixel,
 	.otg_drop_pixel = dccg2_otg_drop_pixel,
-	.dccg_init = dccg2_init
+	.dccg_init = dccg2_init,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 struct dccg *dccg201_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c +5 -1
index d07c04458d31..b48dcafbae66 100644
@@ -103,7 +103,11 @@ static const struct dccg_funcs dccg21_funcs = {
 	.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
 	.otg_add_pixel = dccg2_otg_add_pixel,
 	.otg_drop_pixel = dccg2_otg_drop_pixel,
-	.dccg_init = dccg2_init
+	.dccg_init = dccg2_init,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 struct dccg *dccg21_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn30/dcn30_dccg.c +5 -1
index d445dfefc047..adec7c3c2d49 100644
@@ -49,7 +49,11 @@ static const struct dccg_funcs dccg3_funcs = {
 	.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
 	.otg_add_pixel = dccg2_otg_add_pixel,
 	.otg_drop_pixel = dccg2_otg_drop_pixel,
-	.dccg_init = dccg2_init
+	.dccg_init = dccg2_init,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 struct dccg *dccg3_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn301/dcn301_dccg.c +5 -1
index 97e9be87afd9..fc9bddd94b50 100644
@@ -48,7 +48,11 @@ static const struct dccg_funcs dccg301_funcs = {
 	.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
 	.otg_add_pixel = dccg2_otg_add_pixel,
 	.otg_drop_pixel = dccg2_otg_drop_pixel,
-	.dccg_init = dccg2_init
+	.dccg_init = dccg2_init,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 struct dccg *dccg301_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn31/dcn31_dccg.c +5 -0
index 97df04b7e39d..c647dff5234a 100644
@@ -26,6 +26,7 @@
 #include "reg_helper.h"
 #include "core_types.h"
 #include "dcn31_dccg.h"
+#include "dcn20/dcn20_dccg.h"
 #include "dal_asic_id.h"
 
 #define TO_DCN_DCCG(dccg)\
@@ -850,6 +851,10 @@ static const struct dccg_funcs dccg31_funcs = {
 	.disable_dsc = dccg31_disable_dscclk,
 	.enable_dsc = dccg31_enable_dscclk,
 	.dccg_read_reg_state = dccg31_read_reg_state,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 struct dccg *dccg31_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn314/dcn314_dccg.c +6 -1
index ef3db6beba25..2e9c4b13988a 100644
@@ -29,6 +29,7 @@
 
 #include "dcn31/dcn31_dccg.h"
 #include "dcn314_dccg.h"
+#include "dcn20/dcn20_dccg.h"
 
 #define TO_DCN_DCCG(dccg)\
 	container_of(dccg, struct dcn_dccg, base)
@@ -378,7 +379,11 @@ static const struct dccg_funcs dccg314_funcs = {
 	.trigger_dio_fifo_resync = dccg314_trigger_dio_fifo_resync,
 	.set_valid_pixel_rate = dccg314_set_valid_pixel_rate,
 	.set_dtbclk_p_src = dccg314_set_dtbclk_p_src,
-	.dccg_read_reg_state = dccg31_read_reg_state
+	.dccg_read_reg_state = dccg31_read_reg_state,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 struct dccg *dccg314_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn32/dcn32_dccg.c +5 -0
index 21a6ca5ca192..ce697c3249fb 100644
@@ -26,6 +26,7 @@
 #include "reg_helper.h"
 #include "core_types.h"
 #include "dcn32_dccg.h"
+#include "dcn20/dcn20_dccg.h"
 
 #define TO_DCN_DCCG(dccg)\
 	container_of(dccg, struct dcn_dccg, base)
@@ -347,6 +348,10 @@ static const struct dccg_funcs dccg32_funcs = {
 	.get_pixel_rate_div = dccg32_get_pixel_rate_div,
 	.trigger_dio_fifo_resync = dccg32_trigger_dio_fifo_resync,
 	.set_dtbclk_p_src = dccg32_set_dtbclk_p_src,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 struct dccg *dccg32_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c +10 -1
index 838c6617c029..943ec1983076 100644
@@ -26,6 +26,7 @@
 #include "core_types.h"
 #include "resource.h"
 #include "dcn35_dccg.h"
+#include "dcn20/dcn20_dccg.h"
 
 #define TO_DCN_DCCG(dccg)\
 	container_of(dccg, struct dcn_dccg, base)
@@ -2411,6 +2412,10 @@ static const struct dccg_funcs dccg35_funcs_new = {
 	.enable_symclk_se = dccg35_enable_symclk_se_cb,
 	.disable_symclk_se = dccg35_disable_symclk_se_cb,
 	.set_dtbclk_p_src = dccg35_set_dtbclk_p_src_cb,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done /* Deprecated - for backward compatibility only */
 };
 
 static const struct dccg_funcs dccg35_funcs = {
@@ -2442,8 +2447,12 @@ static const struct dccg_funcs dccg35_funcs = {
 	.enable_symclk_se = dccg35_enable_symclk_se,
 	.disable_symclk_se = dccg35_disable_symclk_se,
 	.set_dtbclk_p_src = dccg35_set_dtbclk_p_src,
+	.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
+	.allow_clock_gating = dccg2_allow_clock_gating,
+	.enable_memory_low_power = dccg2_enable_memory_low_power,
+	.is_s0i3_golden_init_wa_done = dccg2_is_s0i3_golden_init_wa_done, /* Deprecated - for backward compatibility only */
 	.dccg_root_gate_disable_control = dccg35_root_gate_disable_control,
-	.dccg_read_reg_state = dccg31_read_reg_state,
+	.dccg_read_reg_state = dccg31_read_reg_state
 };
 
 struct dccg *dccg35_create(
drivers/gpu/drm/amd/display/dc/dccg/dcn401/dcn401_dccg.c +2 -0
index 3063b6ab32e5..f1d394560892 100644
@@ -27,6 +27,7 @@
 #include "core_types.h"
 #include "dcn401_dccg.h"
 #include "dcn31/dcn31_dccg.h"
+#include "dcn20/dcn20_dccg.h"
 
 /*
 #include "dmub_common.h"
@@ -861,6 +862,7 @@ static const struct dccg_funcs dccg401_funcs = {
 	.update_dpp_dto = dccg401_update_dpp_dto,
 	.get_dccg_ref_freq = dccg401_get_dccg_ref_freq,
 	.dccg_init = dccg401_init,
+	.allow_clock_gating = dccg2_allow_clock_gating,
 	.set_dpstreamclk = dccg401_set_dpstreamclk,
 	.enable_symclk32_se = dccg31_enable_symclk32_se,
 	.disable_symclk32_se = dccg31_disable_symclk32_se,
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +2 -3
index 9613d1ceb5dc..5243177c1faa 100644
@@ -1887,9 +1887,8 @@ void dcn10_init_hw(struct dc *dc)
 
 	if (!dc->debug.disable_clock_gate) {
 		/* enable all DCN clock gating */
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0);
-
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0);
+		if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->allow_clock_gating)
+			dc->res_pool->dccg->funcs->allow_clock_gating(dc->res_pool->dccg, true);
 
 		REG_UPDATE(DCFCLK_CNTL, DCFCLK_GATE_DIS, 0);
 	}
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +8 -21
index 0ee3a0041c61..307e8f8060e6 100644
@@ -357,26 +357,10 @@ void dcn20_enable_power_gating_plane(
 
 void dcn20_dccg_init(struct dce_hwseq *hws)
 {
-	/*
-	 * set MICROSECOND_TIME_BASE_DIV
-	 * 100Mhz refclk -> 0x120264
-	 * 27Mhz refclk -> 0x12021b
-	 * 48Mhz refclk -> 0x120230
-	 *
-	 */
-	REG_WRITE(MICROSECOND_TIME_BASE_DIV, 0x120264);
-
-	/*
-	 * set MILLISECOND_TIME_BASE_DIV
-	 * 100Mhz refclk -> 0x1186a0
-	 * 27Mhz refclk -> 0x106978
-	 * 48Mhz refclk -> 0x10bb80
-	 *
-	 */
-	REG_WRITE(MILLISECOND_TIME_BASE_DIV, 0x1186a0);
+	struct dc *dc = hws->ctx->dc;
 
-	/* This value is dependent on the hardware pipeline delay so set once per SOC */
-	REG_WRITE(DISPCLK_FREQ_CHANGE_CNTL, 0xe01003c);
+	if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->dccg_init)
+		dc->res_pool->dccg->funcs->dccg_init(dc->res_pool->dccg);
 }
 
 void dcn20_disable_vga(
@@ -3156,8 +3140,11 @@ void dcn20_fpga_init_hw(struct dc *dc)
 
 	dcn10_hubbub_global_timer_enable(dc->res_pool->hubbub, true, 2);
 
-	if (REG(REFCLK_CNTL))
-		REG_WRITE(REFCLK_CNTL, 0);
+	if (hws->funcs.dccg_init)
+		hws->funcs.dccg_init(hws);
+
+	if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->refclk_setup)
+		dc->res_pool->dccg->funcs->refclk_setup(dc->res_pool->dccg);
 	//
 
 
drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c +2 -3
index 6298bd87a18b..ce18d75fd991 100644
@@ -367,9 +367,8 @@ void dcn201_init_hw(struct dc *dc)
 
 	if (!dc->debug.disable_clock_gate) {
 		/* enable all DCN clock gating */
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0);
-
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0);
+		if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->allow_clock_gating)
+			dc->res_pool->dccg->funcs->allow_clock_gating(dc->res_pool->dccg, true);
 
 		REG_UPDATE(DCFCLK_CNTL, DCFCLK_GATE_DIS, 0);
 	}
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c +4 -5
index e2269211553c..062745389d9a 100644
@@ -33,6 +33,7 @@
 #include "vmid.h"
 #include "reg_helper.h"
 #include "hw/clk_mgr.h"
+#include "hw/dccg.h"
 #include "dc_dmub_srv.h"
 #include "abm.h"
 #include "link_service.h"
@@ -87,12 +88,10 @@ int dcn21_init_sys_ctx(struct dce_hwseq *hws, struct dc *dc, struct dc_phy_addr_
 
 bool dcn21_s0i3_golden_init_wa(struct dc *dc)
 {
-	struct dce_hwseq *hws = dc->hwseq;
-	uint32_t value = 0;
+	if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->is_s0i3_golden_init_wa_done)
+		return !dc->res_pool->dccg->funcs->is_s0i3_golden_init_wa_done(dc->res_pool->dccg);
 
-	value = REG_READ(MICROSECOND_TIME_BASE_DIV);
-
-	return value != 0x00120464;
+	return false;
 }
 
 void dcn21_exit_optimized_pwr_state(
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +2 -3
index 333275088a6c..d04cfd403b7e 100644
@@ -801,9 +801,8 @@ void dcn30_init_hw(struct dc *dc)
 
 	if (!dc->debug.disable_clock_gate) {
 		/* enable all DCN clock gating */
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0);
-
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0);
+		if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->allow_clock_gating)
+			dc->res_pool->dccg->funcs->allow_clock_gating(dc->res_pool->dccg, true);
 
 		REG_UPDATE(DCFCLK_CNTL, DCFCLK_GATE_DIS, 0);
 	}
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +2 -3
index fa35d538a10a..db2f7cbb12ff 100644
@@ -247,9 +247,8 @@ void dcn31_init_hw(struct dc *dc)
 
 	if (!dc->debug.disable_clock_gate) {
 		/* enable all DCN clock gating */
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0);
-
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0);
+		if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->allow_clock_gating)
+			dc->res_pool->dccg->funcs->allow_clock_gating(dc->res_pool->dccg, true);
 
 		REG_UPDATE(DCFCLK_CNTL, DCFCLK_GATE_DIS, 0);
 	}
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +2 -3
index 01fa459ae7b0..2767d3a97812 100644
@@ -963,9 +963,8 @@ void dcn32_init_hw(struct dc *dc)
 
 	if (!dc->debug.disable_clock_gate) {
 		/* enable all DCN clock gating */
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0);
-
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0);
+		if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->allow_clock_gating)
+			dc->res_pool->dccg->funcs->allow_clock_gating(dc->res_pool->dccg, true);
 
 		REG_UPDATE(DCFCLK_CNTL, DCFCLK_GATE_DIS, 0);
 	}
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2 -1
index d757a0fdc62c..726aca9f9b82 100644
@@ -287,7 +287,8 @@ void dcn35_init_hw(struct dc *dc)
 	}
 
 	if (dc->debug.disable_mem_low_power) {
-		REG_UPDATE(DC_MEM_GLOBAL_PWR_REQ_CNTL, DC_MEM_GLOBAL_PWR_REQ_DIS, 1);
+		if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->enable_memory_low_power)
+			dc->res_pool->dccg->funcs->enable_memory_low_power(dc->res_pool->dccg, false);
 	}
 	if (!dcb->funcs->is_accelerated_mode(dcb) && dc->res_pool->hubbub->funcs->init_watermarks)
 		dc->res_pool->hubbub->funcs->init_watermarks(dc->res_pool->hubbub);
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +2 -3
index d1515039e824..b91517b9fedc 100644
@@ -326,9 +326,8 @@ void dcn401_init_hw(struct dc *dc)
 
 	if (!dc->debug.disable_clock_gate) {
 		/* enable all DCN clock gating */
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0);
-
-		REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0);
+		if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->allow_clock_gating)
+			dc->res_pool->dccg->funcs->allow_clock_gating(dc->res_pool->dccg, true);
 
 		REG_UPDATE(DCFCLK_CNTL, DCFCLK_GATE_DIS, 0);
 	}
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +4 -0
index 1e6ffd86a4c0..d6f5e01a0b66 100644
@@ -224,6 +224,10 @@ struct dccg_funcs {
 	void (*otg_drop_pixel)(struct dccg *dccg,
 			uint32_t otg_inst);
 	void (*dccg_init)(struct dccg *dccg);
+	void (*refclk_setup)(struct dccg *dccg); /* Deprecated - for backward compatibility only */
+	void (*allow_clock_gating)(struct dccg *dccg, bool allow);
+	void (*enable_memory_low_power)(struct dccg *dccg, bool enable);
+	bool (*is_s0i3_golden_init_wa_done)(struct dccg *dccg);
 	void (*set_dpstreamclk_root_clock_gating)(
 			struct dccg *dccg,
 			int dp_hpo_inst,
Signature · 1 line
2.43.0
author
#9 lore raw

PATCH 9/18 Revert "drm/amd/display: Add Handling for gfxversion DcGfxBase"

In reply to Ray Wu

From: Nicholas Carbones <[email protected]>

This reverts commit e563d5a20036 ("drm/amd/display: Add Handling for gfxversion DcGfxBase")

Reason for revert: Cause some regressions

---
 .../drm/amd/display/dc/dml2_0/dml21/dml21_translation_helper.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_translation_helper.c +0 -3
index f4bcebd7ec7f..75a279997961 100644
@@ -460,9 +460,6 @@ static void populate_dml21_surface_config_from_plane_state(
 	case DcGfxAddr3:
 		surface->tiling = gfx_addr3_to_dml2_swizzle_mode(plane_state->tiling_info.gfx_addr3.swizzle);
 		break;
-	case DcGfxBase:
-		surface->tiling = dml2_sw_linear;
-		break;
 	}
 }
 
Signature · 1 line
2.43.0
author
#10 lore raw

PATCH 10/18 Revert "drm/amd/display: Correct hubp GfxVersion verification"

In reply to Ray Wu

From: Nicholas Carbones <[email protected]>

This reverts commit 5ea2687f98a ("drm/amd/display: Correct hubp GfxVersion verification")

Reason for revert: Got blank screen issues while doing PNP

---
 .../amd/display/dc/hubp/dcn10/dcn10_hubp.c    | 35 ++++++++-----------
 .../amd/display/dc/hubp/dcn20/dcn20_hubp.c    | 28 +++++++--------
 .../amd/display/dc/hubp/dcn30/dcn30_hubp.c    | 28 +++++++--------
 3 files changed, 39 insertions(+), 52 deletions(-)
drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c +15 -20
index 78c866688c61..e697d9bf1b44 100644
@@ -145,26 +145,21 @@ void hubp1_program_tiling(
 {
 	struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
 
-	ASSERT(info->gfxversion == DcGfxVersion9 || info->gfxversion == DcGfxBase);
-
-	if (info->gfxversion == DcGfxVersion9) {
-		REG_UPDATE_6(DCSURF_ADDR_CONFIG,
-				NUM_PIPES, log_2(info->gfx9.num_pipes),
-				NUM_BANKS, log_2(info->gfx9.num_banks),
-				PIPE_INTERLEAVE, info->gfx9.pipe_interleave,
-				NUM_SE, log_2(info->gfx9.num_shader_engines),
-				NUM_RB_PER_SE, log_2(info->gfx9.num_rb_per_se),
-				MAX_COMPRESSED_FRAGS, log_2(info->gfx9.max_compressed_frags));
-
-		REG_UPDATE_4(DCSURF_TILING_CONFIG,
-				SW_MODE, info->gfx9.swizzle,
-				META_LINEAR, info->gfx9.meta_linear,
-				RB_ALIGNED, info->gfx9.rb_aligned,
-				PIPE_ALIGNED, info->gfx9.pipe_aligned);
-	} else {
-		hubp1_clear_tiling(&hubp1->base);
-	}
-
+	ASSERT(info->gfxversion == DcGfxVersion9);
+
+	REG_UPDATE_6(DCSURF_ADDR_CONFIG,
+			NUM_PIPES, log_2(info->gfx9.num_pipes),
+			NUM_BANKS, log_2(info->gfx9.num_banks),
+			PIPE_INTERLEAVE, info->gfx9.pipe_interleave,
+			NUM_SE, log_2(info->gfx9.num_shader_engines),
+			NUM_RB_PER_SE, log_2(info->gfx9.num_rb_per_se),
+			MAX_COMPRESSED_FRAGS, log_2(info->gfx9.max_compressed_frags));
+
+	REG_UPDATE_4(DCSURF_TILING_CONFIG,
+			SW_MODE, info->gfx9.swizzle,
+			META_LINEAR, info->gfx9.meta_linear,
+			RB_ALIGNED, info->gfx9.rb_aligned,
+			PIPE_ALIGNED, info->gfx9.pipe_aligned);
 }
 
 void hubp1_program_size(
drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c +12 -16
index aaa8f8cf6c30..4715e60e812a 100644
@@ -313,22 +313,18 @@ static void hubp2_program_tiling(
 	const struct dc_tiling_info *info,
 	const enum surface_pixel_format pixel_format)
 {
-	ASSERT(info->gfxversion == DcGfxVersion9 || info->gfxversion == DcGfxBase);
-
-	if (info->gfxversion == DcGfxVersion9) {
-		REG_UPDATE_3(DCSURF_ADDR_CONFIG,
-				NUM_PIPES, log_2(info->gfx9.num_pipes),
-				PIPE_INTERLEAVE, info->gfx9.pipe_interleave,
-				MAX_COMPRESSED_FRAGS, log_2(info->gfx9.max_compressed_frags));
-
-		REG_UPDATE_4(DCSURF_TILING_CONFIG,
-				SW_MODE, info->gfx9.swizzle,
-				META_LINEAR, 0,
-				RB_ALIGNED, 0,
-				PIPE_ALIGNED, 0);
-	} else {
-		hubp2_clear_tiling(&hubp2->base);
-	}
+	ASSERT(info->gfxversion == DcGfxVersion9);
+
+	REG_UPDATE_3(DCSURF_ADDR_CONFIG,
+			NUM_PIPES, log_2(info->gfx9.num_pipes),
+			PIPE_INTERLEAVE, info->gfx9.pipe_interleave,
+			MAX_COMPRESSED_FRAGS, log_2(info->gfx9.max_compressed_frags));
+
+	REG_UPDATE_4(DCSURF_TILING_CONFIG,
+			SW_MODE, info->gfx9.swizzle,
+			META_LINEAR, 0,
+			RB_ALIGNED, 0,
+			PIPE_ALIGNED, 0);
 }
 
 void hubp2_program_size(
drivers/gpu/drm/amd/display/dc/hubp/dcn30/dcn30_hubp.c +12 -16
index 2126830a5a9e..207c2f86b7d7 100644
@@ -321,22 +321,18 @@ void hubp3_program_tiling(
 	const struct dc_tiling_info *info,
 	const enum surface_pixel_format pixel_format)
 {
-	ASSERT(info->gfxversion == DcGfxVersion9 || info->gfxversion == DcGfxBase);
-
-	if (info->gfxversion == DcGfxVersion9) {
-		REG_UPDATE_4(DCSURF_ADDR_CONFIG,
-			NUM_PIPES, log_2(info->gfx9.num_pipes),
-			PIPE_INTERLEAVE, info->gfx9.pipe_interleave,
-			MAX_COMPRESSED_FRAGS, log_2(info->gfx9.max_compressed_frags),
-			NUM_PKRS, log_2(info->gfx9.num_pkrs));
-
-		REG_UPDATE_3(DCSURF_TILING_CONFIG,
-				SW_MODE, info->gfx9.swizzle,
-				META_LINEAR, info->gfx9.meta_linear,
-				PIPE_ALIGNED, info->gfx9.pipe_aligned);
-	} else {
-		hubp3_clear_tiling(&hubp2->base);
-	}
+	ASSERT(info->gfxversion == DcGfxVersion9);
+
+	REG_UPDATE_4(DCSURF_ADDR_CONFIG,
+		NUM_PIPES, log_2(info->gfx9.num_pipes),
+		PIPE_INTERLEAVE, info->gfx9.pipe_interleave,
+		MAX_COMPRESSED_FRAGS, log_2(info->gfx9.max_compressed_frags),
+		NUM_PKRS, log_2(info->gfx9.num_pkrs));
+
+	REG_UPDATE_3(DCSURF_TILING_CONFIG,
+			SW_MODE, info->gfx9.swizzle,
+			META_LINEAR, info->gfx9.meta_linear,
+			PIPE_ALIGNED, info->gfx9.pipe_aligned);
 
 }
 
Signature · 1 line
2.43.0
author
#11 lore raw

PATCH 11/18 Revert "drm/amd/display: Add Gfx Base Case For Linear Tiling Handling"

In reply to Ray Wu

From: Nicholas Carbones <[email protected]>

This reverts commit 27ca0d596700 ("drm/amd/display: Add Gfx Base Case For Linear Tiling Handling")

Reason for revert: Got blank screen issues while doing PNP

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c          | 1 -
 drivers/gpu/drm/amd/display/dc/core/dc.c                   | 1 -
 drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c      | 7 -------
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c          | 1 -
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h               | 3 +--
 drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c         | 3 ---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c | 3 ---
 drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c       | 1 -
 drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c     | 2 --
 drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c     | 2 --
 drivers/gpu/drm/amd/display/dc/hubp/dcn30/dcn30_hubp.c     | 2 --
 drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c   | 7 +------
 .../amd/display/dc/resource/dcn32/dcn32_resource_helpers.c | 3 +--
 13 files changed, 3 insertions(+), 33 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
index 3dfbbf66bcd5..10a234e7bae9 100644
@@ -8036,7 +8036,6 @@ static enum dc_status dm_validate_stream_and_context(struct dc *dc,
 	dc_plane_state->plane_size.chroma_size.height  = stream->src.height;
 	dc_plane_state->plane_size.chroma_size.width   = stream->src.width;
 	dc_plane_state->format = SURFACE_PIXEL_FORMAT_GRPH_ARGB8888;
-	dc_plane_state->tiling_info.gfxversion = DcGfxVersion9;
 	dc_plane_state->tiling_info.gfx9.swizzle = DC_SW_UNKNOWN;
 	dc_plane_state->rotation = ROTATION_ANGLE_0;
 	dc_plane_state->is_tiling_rotated = false;
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -1
index 6f3c283431d4..984b4bc5f53c 100644
@@ -2770,7 +2770,6 @@ static struct surface_update_descriptor get_plane_info_update_type(const struct
 		case DcGfxVersion7:
 		case DcGfxVersion8:
 		case DcGfxVersionUnknown:
-		case DcGfxBase:
 		default:
 			break;
 		}
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +0 -7
index a13d9d7dd6c5..052d573408c3 100644
@@ -2065,13 +2065,6 @@ void get_surface_tile_visual_confirm_color(
 	while (bottom_pipe_ctx->bottom_pipe != NULL)
 		bottom_pipe_ctx = bottom_pipe_ctx->bottom_pipe;
 
-	if (bottom_pipe_ctx->plane_state->tiling_info.gfxversion == DcGfxBase) {
-		/* LINEAR Surface - set border color to red */
-		color->color_r_cr = color_value;
-		return;
-	}
-
-	ASSERT(bottom_pipe_ctx->plane_state->tiling_info.gfxversion == DcGfxVersion9);
 	switch (bottom_pipe_ctx->plane_state->tiling_info.gfx9.swizzle) {
 	case DC_SW_LINEAR:
 		/* LINEAR Surface - set border color to red */
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -1
index 639831295b21..03d125f794b0 100644
@@ -4434,7 +4434,6 @@ enum dc_status dc_validate_global_state(
 
 			if (dc->res_pool->funcs->patch_unknown_plane_state &&
 					pipe_ctx->plane_state &&
-					pipe_ctx->plane_state->tiling_info.gfxversion == DcGfxVersion9 &&
 					pipe_ctx->plane_state->tiling_info.gfx9.swizzle == DC_SW_UNKNOWN) {
 				result = dc->res_pool->funcs->patch_unknown_plane_state(pipe_ctx->plane_state);
 				if (result != DC_OK)
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -2
index 7121629da38e..cfa569a7bff1 100644
@@ -342,8 +342,7 @@ enum swizzle_mode_addr3_values {
 };
 
 enum dc_gfxversion {
-	DcGfxBase = 0,
-	DcGfxVersion7,
+	DcGfxVersion7 = 0,
 	DcGfxVersion8,
 	DcGfxVersion9,
 	DcGfxVersion10,
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +0 -3
index 5df58fadc862..1c2009e38aa1 100644
@@ -100,7 +100,6 @@ static enum mi_bits_per_pixel get_mi_bpp(
 static enum mi_tiling_format get_mi_tiling(
 		struct dc_tiling_info *tiling_info)
 {
-	ASSERT(tiling_info->gfxversion == DcGfxVersion8);
 	switch (tiling_info->gfx8.array_mode) {
 	case DC_ARRAY_1D_TILED_THIN1:
 	case DC_ARRAY_1D_TILED_THICK:
@@ -434,7 +433,6 @@ static void program_tiling(
 	struct dce_mem_input *dce_mi, const struct dc_tiling_info *info)
 {
 	if (dce_mi->masks->GRPH_SW_MODE) { /* GFX9 */
-		ASSERT(info->gfxversion == DcGfxVersion9);
 		REG_UPDATE_6(GRPH_CONTROL,
 				GRPH_SW_MODE, info->gfx9.swizzle,
 				GRPH_NUM_BANKS, log_2(info->gfx9.num_banks),
@@ -449,7 +447,6 @@ static void program_tiling(
 	}
 
 	if (dce_mi->masks->GRPH_MICRO_TILE_MODE) { /* GFX8 */
-		ASSERT(info->gfxversion == DcGfxVersion8);
 		REG_UPDATE_9(GRPH_CONTROL,
 				GRPH_NUM_BANKS, info->gfx8.num_banks,
 				GRPH_BANK_WIDTH, info->gfx8.bank_width,
drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c +0 -3
index 67cfca3361fb..2c43c2422638 100644
@@ -165,8 +165,6 @@ static void program_tiling(
 	const struct dc_tiling_info *info,
 	const enum surface_pixel_format pixel_format)
 {
-	ASSERT(info->gfxversion == DcGfxVersion8);
-
 	uint32_t value = 0;
 
 	set_reg_field_value(value, info->gfx8.num_banks,
@@ -543,7 +541,6 @@ static const unsigned int *get_dvmm_hw_setting(
 	else
 		bpp = bpp_8;
 
-	ASSERT(tiling_info->gfxversion == DcGfxVersion8);
 	switch (tiling_info->gfx8.array_mode) {
 	case DC_ARRAY_1D_TILED_THIN1:
 	case DC_ARRAY_1D_TILED_THICK:
drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c +0 -1
index 71eeee02c0fa..74962791302f 100644
@@ -1006,7 +1006,6 @@ bool dcn_validate_bandwidth(
 
 			v->source_pixel_format[input_idx] = tl_pixel_format_to_bw_defs(
 					pipe->plane_state->format);
-			ASSERT(pipe->plane_state->tiling_info.gfxversion == DcGfxVersion9);
 			v->source_surface_mode[input_idx] = tl_sw_mode_to_bw_defs(
 					pipe->plane_state->tiling_info.gfx9.swizzle);
 			v->lb_bit_per_pixel[input_idx] = tl_lb_bpp_to_int(pipe->plane_res.scl_data.lb_params.depth);
drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c +0 -2
index e697d9bf1b44..6378e3fd7249 100644
@@ -145,8 +145,6 @@ void hubp1_program_tiling(
 {
 	struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
 
-	ASSERT(info->gfxversion == DcGfxVersion9);
-
 	REG_UPDATE_6(DCSURF_ADDR_CONFIG,
 			NUM_PIPES, log_2(info->gfx9.num_pipes),
 			NUM_BANKS, log_2(info->gfx9.num_banks),
drivers/gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c +0 -2
index 4715e60e812a..92288de4cc10 100644
@@ -313,8 +313,6 @@ static void hubp2_program_tiling(
 	const struct dc_tiling_info *info,
 	const enum surface_pixel_format pixel_format)
 {
-	ASSERT(info->gfxversion == DcGfxVersion9);
-
 	REG_UPDATE_3(DCSURF_ADDR_CONFIG,
 			NUM_PIPES, log_2(info->gfx9.num_pipes),
 			PIPE_INTERLEAVE, info->gfx9.pipe_interleave,
drivers/gpu/drm/amd/display/dc/hubp/dcn30/dcn30_hubp.c +0 -2
index 207c2f86b7d7..0cc6f4558989 100644
@@ -321,8 +321,6 @@ void hubp3_program_tiling(
 	const struct dc_tiling_info *info,
 	const enum surface_pixel_format pixel_format)
 {
-	ASSERT(info->gfxversion == DcGfxVersion9);
-
 	REG_UPDATE_4(DCSURF_ADDR_CONFIG,
 		NUM_PIPES, log_2(info->gfx9.num_pipes),
 		PIPE_INTERLEAVE, info->gfx9.pipe_interleave,
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +1 -6
index 861e940250af..c205500290ec 100644
@@ -589,12 +589,7 @@ void hubp401_program_tiling(
 	 *
 	 * DIM_TYPE field in DCSURF_TILING for Display is always 1 (2D dimension) which is HW default.
 	 */
-	 if (info->gfxversion == DcGfxAddr3) {
-		REG_UPDATE(DCSURF_TILING_CONFIG, SW_MODE, info->gfx_addr3.swizzle);
-	} else {
-		/* linear */
-		REG_UPDATE(DCSURF_TILING_CONFIG, SW_MODE, 0);
-	}
+	 REG_UPDATE(DCSURF_TILING_CONFIG, SW_MODE, info->gfx_addr3.swizzle);
 }
 
 void hubp401_program_size(
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource_helpers.c +1 -2
index 7d99f5d79e6d..f5a4e97c40ce 100644
@@ -401,8 +401,7 @@ void dcn32_set_det_allocations(struct dc *dc, struct dc_state *context,
 	 */
 	if (pipe_cnt == 1) {
 		pipes[0].pipe.src.det_size_override = DCN3_2_MAX_DET_SIZE;
-		if (pipe->plane_state && !disable_unbounded_requesting && pipe->plane_state->tiling_info.gfxversion != DcGfxBase &&
-			!(pipe->plane_state->tiling_info.gfxversion == DcGfxVersion9 && pipe->plane_state->tiling_info.gfx9.swizzle == DC_SW_LINEAR)) {
+		if (pipe->plane_state && !disable_unbounded_requesting && pipe->plane_state->tiling_info.gfx9.swizzle != DC_SW_LINEAR) {
 			if (!is_dual_plane(pipe->plane_state->format)) {
 				pipes[0].pipe.src.det_size_override = DCN3_2_DEFAULT_DET_SIZE;
 				pipes[0].pipe.src.unbounded_req_mode = true;
Signature · 1 line
2.43.0
author
#12 lore raw

PATCH 12/18 drm/amd/display: Skip eDP detection when no sink

In reply to Ray Wu

From: Saidireddy Yenugu <[email protected]>

[Why & How]
When there is no eDP panel connected and during
s0ix resume, unnecessary eDP power sequence and
HPD happening, resulting in ~2 seconds delay.

Fixed the issue by avoiding link detect for eDP
connection with no sink in dm_resume.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -0
index 10a234e7bae9..ee0f52eadc0c 100644
@@ -3614,6 +3614,11 @@ static int dm_resume(struct amdgpu_ip_block *ip_block)
 		if (aconnector->mst_root)
 			continue;
 
+		/* Skip eDP detection, when there is no sink present */
+		if (aconnector->dc_link->connector_signal == SIGNAL_TYPE_EDP &&
+		    !aconnector->dc_link->edp_sink_present)
+			continue;
+
 		guard(mutex)(&aconnector->hpd_lock);
 		if (!dc_link_detect_connection_type(aconnector->dc_link, &new_connection_type))
 			drm_err(adev_to_drm(adev), "KMS: Failed to detect connector\n");
Signature · 1 line
2.43.0
author
#13 lore raw

PATCH 13/18 drm/amd/display: Refactor and fix link_dpms I2C

In reply to Ray Wu

From: Dominik Kaszewski <[email protected]>

[Why]
link_dpms.c issues I2C writes during HDMI link enablement. Current implementation contains a lot of duplicated code with copy-paste errors.

[How]
* Refactor common logic into helper functions.
* Invert logic with early returns to decrease indentation.
* Sequence writes by looping over data arrays.
* Fix write_i2c_retimer_setting is_over_340mhz checking reg_settings instead of reg_settings_6g in the i2c_reg_index <= 0x20 check.

---
 .../gpu/drm/amd/display/dc/link/link_dpms.c   | 475 ++++++------------
 1 file changed, 165 insertions(+), 310 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +165 -310
index 91742bde4dc2..befbe005af68 100644
@@ -320,344 +320,203 @@ static bool get_ext_hdmi_settings(struct pipe_ctx *pipe_ctx,
 	return result;
 }
 
-static bool write_i2c(struct pipe_ctx *pipe_ctx,
-		uint8_t address, uint8_t *buffer, uint32_t length)
+static bool write_i2c(
+		const struct dc_link *link,
+		uint8_t address,
+		uint8_t *buffer,
+		uint32_t length
+)
 {
-	struct i2c_command cmd = {0};
-	struct i2c_payload payload = {0};
+	struct i2c_payload payload = {
+		.write = true,
+		.address = address,
+		.length = length,
+		.data = buffer,
+	};
+	struct i2c_command cmd = {
+		.payloads = &payload,
+		.number_of_payloads = 1,
+		.engine = I2C_COMMAND_ENGINE_DEFAULT,
+		.speed = link->ctx->dc->caps.i2c_speed_in_khz,
+	};
+
+	return dm_helpers_submit_i2c(link->ctx, link, &cmd);
+}
 
-	memset(&payload, 0, sizeof(payload));
-	memset(&cmd, 0, sizeof(cmd));
+static bool write_i2c_retimer_offset_value(
+		const struct dc_link *link,
+		uint8_t address,
+		uint8_t offset,
+		uint8_t value
+)
+{
+	DC_LOGGER_INIT(link->ctx->logger);
+	uint8_t buffer[] = { offset, value };
+	const bool success = write_i2c(link, address, buffer, sizeof(buffer));
+
+	RETIMER_REDRIVER_INFO(
+			"Retimer write, address: 0x%x, offset: 0x%x, value: 0x%x, success: %d\n",
+			address, offset, value, success
+	);
+	return success;
+}
 
-	cmd.number_of_payloads = 1;
-	cmd.engine = I2C_COMMAND_ENGINE_DEFAULT;
-	cmd.speed = pipe_ctx->stream->ctx->dc->caps.i2c_speed_in_khz;
+static bool write_i2c_retimer_vga(
+		const struct dc_link *link,
+		uint8_t address
+)
+{
+	DC_LOGGER_INIT(link->ctx->logger);
+	const uint8_t vga_data[][2] = {
+		{ 0xFF, 0x01 },
+		{ 0x00, 0x23 },
+		{ 0xFF, 0x00 },
+	};
+
+	for (size_t i = 0; i < ARRAY_SIZE(vga_data); i++) {
+		if (!write_i2c_retimer_offset_value(link, address, vga_data[i][0], vga_data[i][1])) {
+			DC_LOG_ERROR("Set retimer failed, vga index: %zu\n", i);
+			return false;
+		}
+	}
+	return true;
+}
 
-	payload.address = address;
-	payload.data = buffer;
-	payload.length = length;
-	payload.write = true;
-	cmd.payloads = &payload;
+static bool write_i2c_retimer_byte(
+		const struct dc_link *link,
+		uint8_t address,
+		uint8_t index,
+		uint8_t value
+)
+{
+	DC_LOGGER_INIT(link->ctx->logger);
+	const uint8_t apply_rx_tx_change = 0x4;
 
-	if (dm_helpers_submit_i2c(pipe_ctx->stream->ctx,
-			pipe_ctx->stream->link, &cmd))
+	if (index > 0x20)
 		return true;
 
-	return false;
+	if (!write_i2c_retimer_offset_value(link, address, index, value)) {
+		DC_LOG_ERROR("Set retimer failed, 3g index: 0x%x, value: 0x%x\n", index, value);
+		return false;
+	}
+
+	// Based on DP159 specs, APPLY_RX_TX_CHANGE bit in 0x0A
+	// needs to be set to 1 on every 0x0A-0x0C write.
+	if (0x0A <= index && index <= 0x0C) {
+		uint8_t offset = 0x0A;
+
+		// Query current value from offset 0x0A
+		if (index == 0x0A) {
+			// Just written correct value, so no need to read it back
+		} else {
+			if (!link_query_ddc_data(
+					link->ddc, address, &offset, 1, &value, 1
+			)) {
+				DC_LOG_ERROR("Set retimer failed, link_query_ddc_data\n");
+				return false;
+			}
+		}
+
+		value |= apply_rx_tx_change;
+		if (!write_i2c_retimer_offset_value(link, address, offset, value)) {
+			DC_LOG_ERROR("Set retimer failed, 3g offset: 0x%x, value: 0x%x\n", offset, value);
+			return false;
+		}
+	}
+	return true;
 }
 
-static void write_i2c_retimer_setting(
-		struct pipe_ctx *pipe_ctx,
+static bool write_i2c_retimer_setting(
+		const struct dc_link *link,
 		bool is_vga_mode,
 		bool is_over_340mhz,
 		struct ext_hdmi_settings *settings)
 {
-	uint8_t slave_address = (settings->slv_addr >> 1);
-	uint8_t buffer[2];
-	const uint8_t apply_rx_tx_change = 0x4;
-	uint8_t offset = 0xA;
-	uint8_t value = 0;
-	int i = 0;
-	bool i2c_success = false;
-	DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
-
-	memset(&buffer, 0, sizeof(buffer));
-
-	/* Start Ext-Hdmi programming*/
-
-	for (i = 0; i < settings->reg_num; i++) {
-		/* Apply 3G settings */
-		if (settings->reg_settings[i].i2c_reg_index <= 0x20) {
-
-			buffer[0] = settings->reg_settings[i].i2c_reg_index;
-			buffer[1] = settings->reg_settings[i].i2c_reg_val;
-			i2c_success = write_i2c(pipe_ctx, slave_address,
-						buffer, sizeof(buffer));
-			RETIMER_REDRIVER_INFO("retimer write to slave_address = 0x%x,\
-				offset = 0x%x, reg_val= 0x%x, i2c_success = %d\n",
-				slave_address, buffer[0], buffer[1], i2c_success?1:0);
+	DC_LOGGER_INIT(link->ctx->logger);
+	const uint8_t address = settings->slv_addr >> 1;
 
-			if (!i2c_success)
-				goto i2c_write_fail;
+	for (size_t i = 0; i < settings->reg_num; i++) {
+		const uint8_t index = settings->reg_settings[i].i2c_reg_index;
+		uint8_t value = settings->reg_settings[i].i2c_reg_val;
 
-			/* Based on DP159 specs, APPLY_RX_TX_CHANGE bit in 0x0A
-			 * needs to be set to 1 on every 0xA-0xC write.
-			 */
-			if (settings->reg_settings[i].i2c_reg_index == 0xA ||
-				settings->reg_settings[i].i2c_reg_index == 0xB ||
-				settings->reg_settings[i].i2c_reg_index == 0xC) {
-
-				/* Query current value from offset 0xA */
-				if (settings->reg_settings[i].i2c_reg_index == 0xA)
-					value = settings->reg_settings[i].i2c_reg_val;
-				else {
-					i2c_success =
-						link_query_ddc_data(
-						pipe_ctx->stream->link->ddc,
-						slave_address, &offset, 1, &value, 1);
-					if (!i2c_success)
-						goto i2c_write_fail;
-				}
-
-				buffer[0] = offset;
-				/* Set APPLY_RX_TX_CHANGE bit to 1 */
-				buffer[1] = value | apply_rx_tx_change;
-				i2c_success = write_i2c(pipe_ctx, slave_address,
-						buffer, sizeof(buffer));
-				RETIMER_REDRIVER_INFO("retimer write to slave_address = 0x%x,\
-					offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-					slave_address, buffer[0], buffer[1], i2c_success?1:0);
-				if (!i2c_success)
-					goto i2c_write_fail;
-			}
+		if (!write_i2c_retimer_byte(link, address, index, value)) {
+			DC_LOG_ERROR("Set retimer failed, index: %zu\n", i);
+			return false;
 		}
 	}
 
-	/* Apply 3G settings */
 	if (is_over_340mhz) {
-		for (i = 0; i < settings->reg_num_6g; i++) {
-			/* Apply 3G settings */
-			if (settings->reg_settings[i].i2c_reg_index <= 0x20) {
-
-				buffer[0] = settings->reg_settings_6g[i].i2c_reg_index;
-				buffer[1] = settings->reg_settings_6g[i].i2c_reg_val;
-				i2c_success = write_i2c(pipe_ctx, slave_address,
-							buffer, sizeof(buffer));
-				RETIMER_REDRIVER_INFO("above 340Mhz: retimer write to slave_address = 0x%x,\
-					offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-					slave_address, buffer[0], buffer[1], i2c_success?1:0);
-
-				if (!i2c_success)
-					goto i2c_write_fail;
-
-				/* Based on DP159 specs, APPLY_RX_TX_CHANGE bit in 0x0A
-				 * needs to be set to 1 on every 0xA-0xC write.
-				 */
-				if (settings->reg_settings_6g[i].i2c_reg_index == 0xA ||
-					settings->reg_settings_6g[i].i2c_reg_index == 0xB ||
-					settings->reg_settings_6g[i].i2c_reg_index == 0xC) {
-
-					/* Query current value from offset 0xA */
-					if (settings->reg_settings_6g[i].i2c_reg_index == 0xA)
-						value = settings->reg_settings_6g[i].i2c_reg_val;
-					else {
-						i2c_success =
-								link_query_ddc_data(
-								pipe_ctx->stream->link->ddc,
-								slave_address, &offset, 1, &value, 1);
-						if (!i2c_success)
-							goto i2c_write_fail;
-					}
+		for (size_t i = 0; i < settings->reg_num_6g; i++) {
+			const uint8_t index = settings->reg_settings_6g[i].i2c_reg_index;
+			uint8_t value = settings->reg_settings_6g[i].i2c_reg_val;
 
-					buffer[0] = offset;
-					/* Set APPLY_RX_TX_CHANGE bit to 1 */
-					buffer[1] = value | apply_rx_tx_change;
-					i2c_success = write_i2c(pipe_ctx, slave_address,
-							buffer, sizeof(buffer));
-					RETIMER_REDRIVER_INFO("retimer write to slave_address = 0x%x,\
-						offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-						slave_address, buffer[0], buffer[1], i2c_success?1:0);
-					if (!i2c_success)
-						goto i2c_write_fail;
-				}
+			if (!write_i2c_retimer_byte(link, address, index, value)) {
+				DC_LOG_ERROR("Set retimer failed, 6g index: %zu\n", i);
+				return false;
 			}
 		}
 	}
 
 	if (is_vga_mode) {
-		/* Program additional settings if using 640x480 resolution */
-
-		/* Write offset 0xFF to 0x01 */
-		buffer[0] = 0xff;
-		buffer[1] = 0x01;
-		i2c_success = write_i2c(pipe_ctx, slave_address,
-				buffer, sizeof(buffer));
-		RETIMER_REDRIVER_INFO("retimer write to slave_address = 0x%x,\
-				offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-				slave_address, buffer[0], buffer[1], i2c_success?1:0);
-		if (!i2c_success)
-			goto i2c_write_fail;
-
-		/* Write offset 0x00 to 0x23 */
-		buffer[0] = 0x00;
-		buffer[1] = 0x23;
-		i2c_success = write_i2c(pipe_ctx, slave_address,
-				buffer, sizeof(buffer));
-		RETIMER_REDRIVER_INFO("retimer write to slave_address = 0x%x,\
-			offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-			slave_address, buffer[0], buffer[1], i2c_success?1:0);
-		if (!i2c_success)
-			goto i2c_write_fail;
-
-		/* Write offset 0xff to 0x00 */
-		buffer[0] = 0xff;
-		buffer[1] = 0x00;
-		i2c_success = write_i2c(pipe_ctx, slave_address,
-				buffer, sizeof(buffer));
-		RETIMER_REDRIVER_INFO("retimer write to slave_address = 0x%x,\
-			offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-			slave_address, buffer[0], buffer[1], i2c_success?1:0);
-		if (!i2c_success)
-			goto i2c_write_fail;
-
-	}
-
-	return;
-
-i2c_write_fail:
-	DC_LOG_DEBUG("Set retimer failed");
+		return write_i2c_retimer_vga(link, address);
+	}
+	return true;
 }
 
-static void write_i2c_default_retimer_setting(
-		struct pipe_ctx *pipe_ctx,
+static bool write_i2c_default_retimer_setting(
+		const struct dc_link *link,
 		bool is_vga_mode,
 		bool is_over_340mhz)
 {
-	uint8_t slave_address = (0xBA >> 1);
-	uint8_t buffer[2];
-	bool i2c_success = false;
-	DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
+	const uint8_t address = 0xBA >> 1;
 
-	memset(&buffer, 0, sizeof(buffer));
-
-	/* Program Slave Address for tuning single integrity */
-	/* Write offset 0x0A to 0x13 */
-	buffer[0] = 0x0A;
-	buffer[1] = 0x13;
-	i2c_success = write_i2c(pipe_ctx, slave_address,
-			buffer, sizeof(buffer));
-	RETIMER_REDRIVER_INFO("retimer writes default setting to slave_address = 0x%x,\
-		offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-		slave_address, buffer[0], buffer[1], i2c_success?1:0);
-	if (!i2c_success)
-		goto i2c_write_fail;
-
-	/* Write offset 0x0A to 0x17 */
-	buffer[0] = 0x0A;
-	buffer[1] = 0x17;
-	i2c_success = write_i2c(pipe_ctx, slave_address,
-			buffer, sizeof(buffer));
-	RETIMER_REDRIVER_INFO("retimer write to slave_addr = 0x%x,\
-		offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-		slave_address, buffer[0], buffer[1], i2c_success?1:0);
-	if (!i2c_success)
-		goto i2c_write_fail;
-
-	/* Write offset 0x0B to 0xDA or 0xD8 */
-	buffer[0] = 0x0B;
-	buffer[1] = is_over_340mhz ? 0xDA : 0xD8;
-	i2c_success = write_i2c(pipe_ctx, slave_address,
-			buffer, sizeof(buffer));
-	RETIMER_REDRIVER_INFO("retimer write to slave_addr = 0x%x,\
-		offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-		slave_address, buffer[0], buffer[1], i2c_success?1:0);
-	if (!i2c_success)
-		goto i2c_write_fail;
-
-	/* Write offset 0x0A to 0x17 */
-	buffer[0] = 0x0A;
-	buffer[1] = 0x17;
-	i2c_success = write_i2c(pipe_ctx, slave_address,
-			buffer, sizeof(buffer));
-	RETIMER_REDRIVER_INFO("retimer write to slave_addr = 0x%x,\
-		offset = 0x%x, reg_val= 0x%x, i2c_success = %d\n",
-		slave_address, buffer[0], buffer[1], i2c_success?1:0);
-	if (!i2c_success)
-		goto i2c_write_fail;
-
-	/* Write offset 0x0C to 0x1D or 0x91 */
-	buffer[0] = 0x0C;
-	buffer[1] = is_over_340mhz ? 0x1D : 0x91;
-	i2c_success = write_i2c(pipe_ctx, slave_address,
-			buffer, sizeof(buffer));
-	RETIMER_REDRIVER_INFO("retimer write to slave_addr = 0x%x,\
-		offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-		slave_address, buffer[0], buffer[1], i2c_success?1:0);
-	if (!i2c_success)
-		goto i2c_write_fail;
-
-	/* Write offset 0x0A to 0x17 */
-	buffer[0] = 0x0A;
-	buffer[1] = 0x17;
-	i2c_success = write_i2c(pipe_ctx, slave_address,
-			buffer, sizeof(buffer));
-	RETIMER_REDRIVER_INFO("retimer write to slave_addr = 0x%x,\
-		offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-		slave_address, buffer[0], buffer[1], i2c_success?1:0);
-	if (!i2c_success)
-		goto i2c_write_fail;
+	DC_LOGGER_INIT(link->ctx->logger);
 
+	const uint8_t data[][2] = {
+		{ 0x0A, 0x13 },
+		{ 0x0A, 0x17 },
+		{ 0x0B, is_over_340mhz ? 0xDA : 0xD8 },
+		{ 0x0A, 0x17 },
+		{ 0x0C, is_over_340mhz ? 0x1D : 0x91 },
+		{ 0x0A, 0x17 },
+	};
+
+	for (size_t i = 0; i < ARRAY_SIZE(data); i++) {
+		if (!write_i2c_retimer_offset_value(link, address, data[i][0], data[i][1])) {
+			DC_LOG_ERROR("Set default retimer failed, index: %zu\n", i);
+			return false;
+		}
+	}
 
 	if (is_vga_mode) {
-		/* Program additional settings if using 640x480 resolution */
-
-		/* Write offset 0xFF to 0x01 */
-		buffer[0] = 0xff;
-		buffer[1] = 0x01;
-		i2c_success = write_i2c(pipe_ctx, slave_address,
-				buffer, sizeof(buffer));
-		RETIMER_REDRIVER_INFO("retimer write to slave_addr = 0x%x,\
-			offset = 0x%x, reg_val = 0x%x, i2c_success = %d\n",
-			slave_address, buffer[0], buffer[1], i2c_success?1:0);
-		if (!i2c_success)
-			goto i2c_write_fail;
-
-		/* Write offset 0x00 to 0x23 */
-		buffer[0] = 0x00;
-		buffer[1] = 0x23;
-		i2c_success = write_i2c(pipe_ctx, slave_address,
-				buffer, sizeof(buffer));
-		RETIMER_REDRIVER_INFO("retimer write to slave_addr = 0x%x,\
-			offset = 0x%x, reg_val= 0x%x, i2c_success = %d\n",
-			slave_address, buffer[0], buffer[1], i2c_success?1:0);
-		if (!i2c_success)
-			goto i2c_write_fail;
-
-		/* Write offset 0xff to 0x00 */
-		buffer[0] = 0xff;
-		buffer[1] = 0x00;
-		i2c_success = write_i2c(pipe_ctx, slave_address,
-				buffer, sizeof(buffer));
-		RETIMER_REDRIVER_INFO("retimer write default setting to slave_addr = 0x%x,\
-			offset = 0x%x, reg_val= 0x%x, i2c_success = %d end here\n",
-			slave_address, buffer[0], buffer[1], i2c_success?1:0);
-		if (!i2c_success)
-			goto i2c_write_fail;
-	}
-
-	return;
-
-i2c_write_fail:
-	DC_LOG_DEBUG("Set default retimer failed");
+		return write_i2c_retimer_vga(link, address);
+	}
+	return true;
 }
 
-static void write_i2c_redriver_setting(
-		struct pipe_ctx *pipe_ctx,
+static bool write_i2c_redriver_setting(
+		const struct dc_link *link,
 		bool is_over_340mhz)
 {
-	uint8_t slave_address = (0xF0 >> 1);
-	uint8_t buffer[16];
-	bool i2c_success = false;
-	DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
-
-	memset(&buffer, 0, sizeof(buffer));
-
-	// Program Slave Address for tuning single integrity
-	buffer[3] = 0x4E;
-	buffer[4] = 0x4E;
-	buffer[5] = 0x4E;
-	buffer[6] = is_over_340mhz ? 0x4E : 0x4A;
-
-	i2c_success = write_i2c(pipe_ctx, slave_address,
-					buffer, sizeof(buffer));
-	RETIMER_REDRIVER_INFO("redriver write 0 to all 16 reg offset expect following:\n\
-		\t slave_addr = 0x%x, offset[3] = 0x%x, offset[4] = 0x%x,\
-		offset[5] = 0x%x,offset[6] is_over_340mhz = 0x%x,\
-		i2c_success = %d\n",
-		slave_address, buffer[3], buffer[4], buffer[5], buffer[6], i2c_success?1:0);
-
-	if (!i2c_success)
-		DC_LOG_DEBUG("Set redriver failed");
+	DC_LOGGER_INIT(link->ctx->logger);
+	const uint8_t address = 0xF0 >> 1;
+	uint8_t buffer[16] = {
+		[3] = 0x4E,
+		[4] = 0x4E,
+		[5] = 0x4E,
+		[6] = is_over_340mhz ? 0x4E : 0x4A,
+	};
+
+	const bool success = write_i2c(link, address, buffer, sizeof(buffer));
+
+	RETIMER_REDRIVER_INFO(
+			"Redriver write, address: 0x%x, buffer: { [3]: 0x%x, 0x%x, 0x%x, 0x%x }, success: %d\n",
+			address, buffer[3], buffer[4], buffer[5], buffer[6], success
+	);
+
+	if (!success)
+		DC_LOG_ERROR("Set redriver failed");
+	return success;
 }
 
 static void update_psp_stream_config(struct pipe_ctx *pipe_ctx, bool dpms_off)
@@ -1934,15 +1793,13 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)
 			eng_id = pipe_ctx->stream_res.stream_enc->id;
 
 			if (get_ext_hdmi_settings(pipe_ctx, eng_id, &settings)) {
-				write_i2c_retimer_setting(pipe_ctx,
-						is_vga_mode, is_over_340mhz, &settings);
+				write_i2c_retimer_setting(link, is_vga_mode, is_over_340mhz, &settings);
 			} else {
-				write_i2c_default_retimer_setting(pipe_ctx,
-						is_vga_mode, is_over_340mhz);
+				write_i2c_default_retimer_setting(link, is_vga_mode, is_over_340mhz);
 			}
 		} else if (masked_chip_caps == AMD_EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204) {
 			/* PI3EQX1204, Redriver settings */
-			write_i2c_redriver_setting(pipe_ctx, is_over_340mhz);
+			write_i2c_redriver_setting(link, is_over_340mhz);
 		}
 	}
 
@@ -2353,14 +2210,12 @@ void link_set_dpms_off(struct pipe_ctx *pipe_ctx)
 		if (masked_chip_caps == AMD_EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT) {
 			/* DP159, Retimer settings */
 			if (get_ext_hdmi_settings(pipe_ctx, eng_id, &settings))
-				write_i2c_retimer_setting(pipe_ctx,
-						false, false, &settings);
+				write_i2c_retimer_setting(link, false, false, &settings);
 			else
-				write_i2c_default_retimer_setting(pipe_ctx,
-						false, false);
+				write_i2c_default_retimer_setting(link, false, false);
 		} else if (masked_chip_caps == AMD_EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204) {
 			/* PI3EQX1204, Redriver settings */
-			write_i2c_redriver_setting(pipe_ctx, false);
+			write_i2c_redriver_setting(link, false);
 		}
 	}
 
Signature · 1 line
2.43.0
author
#14 lore raw

PATCH 14/18 drm/amd/display: Refactor and fix link_dpms info

In reply to Ray Wu

From: Dominik Kaszewski <[email protected]>

[Why]
get_ext_hdmi_settings contained a copy-paste error, assigning both reg_num_6g and reg_num from dp0_ext_hdmi_6g_reg_num.

[How]
* Correctly assign reg_num from dp0_ext_hdmi_reg_num.
* Refactor and clean the function.

---
 .../gpu/drm/amd/display/dc/link/link_dpms.c   | 165 +++++++++---------
 1 file changed, 84 insertions(+), 81 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +84 -81
index befbe005af68..89c916dbf657 100644
@@ -223,16 +223,32 @@ void link_get_master_pipes_with_dpms_on(const struct dc_link *link,
 	}
 }
 
-static bool get_ext_hdmi_settings(struct pipe_ctx *pipe_ctx,
-		enum engine_id eng_id,
-		struct ext_hdmi_settings *settings)
+static struct ext_hdmi_settings create_ext_hdmi_settings(
+		uint8_t address,
+		uint8_t reg_num,
+		uint8_t reg_num_6g,
+		const struct i2c_reg_info *reg_settings,
+		const struct i2c_reg_info *reg_settings_6g
+)
 {
-	bool result = false;
-	int i = 0;
-	struct integrated_info *integrated_info =
-			pipe_ctx->stream->ctx->dc_bios->integrated_info;
+	struct ext_hdmi_settings result = {
+		.slv_addr = address,
+		.reg_num = reg_num,
+		.reg_num_6g = reg_num_6g,
+	};
+
+	memcpy(result.reg_settings, reg_settings, sizeof(result.reg_settings));
+	memcpy(result.reg_settings_6g, reg_settings_6g, sizeof(result.reg_settings_6g));
+	return result;
+}
 
-	if (integrated_info == NULL)
+static bool get_ext_hdmi_settings(
+		const struct integrated_info *info,
+		enum engine_id eng_id,
+		struct ext_hdmi_settings *settings
+)
+{
+	if (!settings || !info)
 		return false;
 
 	/*
@@ -242,82 +258,69 @@ static bool get_ext_hdmi_settings(struct pipe_ctx *pipe_ctx,
 	 */
 
 	// Check if current bios contains ext Hdmi settings
-	if (integrated_info->gpu_cap_info & 0x20) {
-		switch (eng_id) {
-		case ENGINE_ID_DIGA:
-			settings->slv_addr = integrated_info->dp0_ext_hdmi_slv_addr;
-			settings->reg_num = integrated_info->dp0_ext_hdmi_6g_reg_num;
-			settings->reg_num_6g = integrated_info->dp0_ext_hdmi_6g_reg_num;
-			memmove(settings->reg_settings,
-					integrated_info->dp0_ext_hdmi_reg_settings,
-					sizeof(integrated_info->dp0_ext_hdmi_reg_settings));
-			memmove(settings->reg_settings_6g,
-					integrated_info->dp0_ext_hdmi_6g_reg_settings,
-					sizeof(integrated_info->dp0_ext_hdmi_6g_reg_settings));
-			result = true;
-			break;
-		case ENGINE_ID_DIGB:
-			settings->slv_addr = integrated_info->dp1_ext_hdmi_slv_addr;
-			settings->reg_num = integrated_info->dp1_ext_hdmi_6g_reg_num;
-			settings->reg_num_6g = integrated_info->dp1_ext_hdmi_6g_reg_num;
-			memmove(settings->reg_settings,
-					integrated_info->dp1_ext_hdmi_reg_settings,
-					sizeof(integrated_info->dp1_ext_hdmi_reg_settings));
-			memmove(settings->reg_settings_6g,
-					integrated_info->dp1_ext_hdmi_6g_reg_settings,
-					sizeof(integrated_info->dp1_ext_hdmi_6g_reg_settings));
-			result = true;
-			break;
-		case ENGINE_ID_DIGC:
-			settings->slv_addr = integrated_info->dp2_ext_hdmi_slv_addr;
-			settings->reg_num = integrated_info->dp2_ext_hdmi_6g_reg_num;
-			settings->reg_num_6g = integrated_info->dp2_ext_hdmi_6g_reg_num;
-			memmove(settings->reg_settings,
-					integrated_info->dp2_ext_hdmi_reg_settings,
-					sizeof(integrated_info->dp2_ext_hdmi_reg_settings));
-			memmove(settings->reg_settings_6g,
-					integrated_info->dp2_ext_hdmi_6g_reg_settings,
-					sizeof(integrated_info->dp2_ext_hdmi_6g_reg_settings));
-			result = true;
-			break;
-		case ENGINE_ID_DIGD:
-			settings->slv_addr = integrated_info->dp3_ext_hdmi_slv_addr;
-			settings->reg_num = integrated_info->dp3_ext_hdmi_6g_reg_num;
-			settings->reg_num_6g = integrated_info->dp3_ext_hdmi_6g_reg_num;
-			memmove(settings->reg_settings,
-					integrated_info->dp3_ext_hdmi_reg_settings,
-					sizeof(integrated_info->dp3_ext_hdmi_reg_settings));
-			memmove(settings->reg_settings_6g,
-					integrated_info->dp3_ext_hdmi_6g_reg_settings,
-					sizeof(integrated_info->dp3_ext_hdmi_6g_reg_settings));
-			result = true;
-			break;
-		default:
-			break;
-		}
+	if (!(info->gpu_cap_info & 0x20))
+		return false;
 
-		if (result == true) {
-			// Validate settings from bios integrated info table
-			if (settings->slv_addr == 0)
-				return false;
-			if (settings->reg_num > 9)
-				return false;
-			if (settings->reg_num_6g > 3)
-				return false;
+	switch (eng_id) {
+	case ENGINE_ID_DIGA:
+		*settings = create_ext_hdmi_settings(
+				info->dp0_ext_hdmi_slv_addr,
+				info->dp0_ext_hdmi_reg_num,
+				info->dp0_ext_hdmi_6g_reg_num,
+				info->dp0_ext_hdmi_reg_settings,
+				info->dp0_ext_hdmi_6g_reg_settings
+		);
+		break;
+	case ENGINE_ID_DIGB:
+		*settings = create_ext_hdmi_settings(
+				info->dp1_ext_hdmi_slv_addr,
+				info->dp1_ext_hdmi_reg_num,
+				info->dp1_ext_hdmi_6g_reg_num,
+				info->dp1_ext_hdmi_reg_settings,
+				info->dp1_ext_hdmi_6g_reg_settings
+		);
+		break;
+	case ENGINE_ID_DIGC:
+		*settings = create_ext_hdmi_settings(
+				info->dp2_ext_hdmi_slv_addr,
+				info->dp2_ext_hdmi_reg_num,
+				info->dp2_ext_hdmi_6g_reg_num,
+				info->dp2_ext_hdmi_reg_settings,
+				info->dp2_ext_hdmi_6g_reg_settings
+		);
+		break;
+	case ENGINE_ID_DIGD:
+		*settings = create_ext_hdmi_settings(
+				info->dp3_ext_hdmi_slv_addr,
+				info->dp3_ext_hdmi_reg_num,
+				info->dp3_ext_hdmi_6g_reg_num,
+				info->dp3_ext_hdmi_reg_settings,
+				info->dp3_ext_hdmi_6g_reg_settings
+		);
+		break;
+	default:
+		return false;
+	}
 
-			for (i = 0; i < settings->reg_num; i++) {
-				if (settings->reg_settings[i].i2c_reg_index > 0x20)
-					return false;
-			}
+	// Validate settings from bios integrated info table
+	if (
+			!settings->slv_addr
+			|| settings->reg_num > ARRAY_SIZE(settings->reg_settings)
+			|| settings->reg_num_6g > ARRAY_SIZE(settings->reg_settings_6g)
+	) {
+		return false;
+	}
 
-			for (i = 0; i < settings->reg_num_6g; i++) {
-				if (settings->reg_settings_6g[i].i2c_reg_index > 0x20)
-					return false;
-			}
-		}
+	for (size_t i = 0; i < settings->reg_num; i++) {
+		if (settings->reg_settings[i].i2c_reg_index > 0x20)
+			return false;
 	}
 
-	return result;
+	for (size_t i = 0; i < settings->reg_num_6g; i++) {
+		if (settings->reg_settings_6g[i].i2c_reg_index > 0x20)
+			return false;
+	}
+	return true;
 }
 
 static bool write_i2c(
@@ -1792,7 +1795,7 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)
 			/* DP159, Retimer settings */
 			eng_id = pipe_ctx->stream_res.stream_enc->id;
 
-			if (get_ext_hdmi_settings(pipe_ctx, eng_id, &settings)) {
+			if (get_ext_hdmi_settings(stream->ctx->dc_bios->integrated_info, eng_id, &settings)) {
 				write_i2c_retimer_setting(link, is_vga_mode, is_over_340mhz, &settings);
 			} else {
 				write_i2c_default_retimer_setting(link, is_vga_mode, is_over_340mhz);
@@ -2209,7 +2212,7 @@ void link_set_dpms_off(struct pipe_ctx *pipe_ctx)
 			false);
 		if (masked_chip_caps == AMD_EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT) {
 			/* DP159, Retimer settings */
-			if (get_ext_hdmi_settings(pipe_ctx, eng_id, &settings))
+			if (get_ext_hdmi_settings(stream->ctx->dc_bios->integrated_info, eng_id, &settings))
 				write_i2c_retimer_setting(link, false, false, &settings);
 			else
 				write_i2c_default_retimer_setting(link, false, false);
Signature · 1 line
2.43.0
author
#15 lore raw

PATCH 15/18 drm/amd/display: Correct logic check error for fastboot

In reply to Ray Wu

From: Charlene Liu <[email protected]>

[Why]
Fix fastboot broken in driver.
This is caused by an open source backport change 7495962c.

from the comment, the intended check is to disable fastboot for pre-DCN10. but the logic check is reversed, and causes fastboot to be disabled on all DCN10 and after.

fastboot is for driver trying to pick up bios used hw setting and bypass reprogramming the hw if dc_validate_boot_timing() condition meets.

---
 drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +2 -2
index 4659e1b489ba..4277b6761522 100644
@@ -1964,8 +1964,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
 
 	get_edp_streams(context, edp_streams, &edp_stream_num);
 
-	/* Check fastboot support, disable on DCE 6-8 because of blank screens */
-	if (edp_num && edp_stream_num && dc->ctx->dce_version < DCE_VERSION_10_0) {
+	/* Check fastboot support, disable on DCE 6-8-10 because of blank screens */
+	if (edp_num && edp_stream_num && dc->ctx->dce_version > DCE_VERSION_10_0) {
 		for (i = 0; i < edp_num; i++) {
 			edp_link = edp_links[i];
 			if (edp_link != edp_streams[0]->link)
Signature · 1 line
2.43.0
Reviewed-by on v1 15/18
#16 lore raw

Re: [PATCH 15/18] drm/amd/display: Correct logic check error for fastboot

++

Quoted 10 lines · Ray Wu

From: Charlene Liu <[email protected]>

[Why]
Fix fastboot broken in driver.
This is caused by an open source backport change 7495962c.

from the comment, the intended check is to disable fastboot for pre-DCN10. but the logic check is reversed, and causes fastboot to be disabled on all DCN10 and after.

Quoted 7 lines

fastboot is for driver trying to pick up bios used hw setting and bypass reprogramming the hw if dc_validate_boot_timing() condition meets.

7495962c was already applied to 6.19. This should go to stable to avoid fastboot being broken in 6.19.y.

Fixes 7495962cbceb9 ("drm/amd/display: Disable fastboot on DCE 6 too")
Quoted 19 lines
---
  drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +2 -2
index 4659e1b489ba..4277b6761522 100644
@@ -1964,8 +1964,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
 
  	get_edp_streams(context, edp_streams, &edp_stream_num);
 
-	/* Check fastboot support, disable on DCE 6-8 because of blank screens */
-	if (edp_num && edp_stream_num && dc->ctx->dce_version < DCE_VERSION_10_0) {
+	/* Check fastboot support, disable on DCE 6-8-10 because of blank screens */
+	if (edp_num && edp_stream_num && dc->ctx->dce_version > DCE_VERSION_10_0) {
  		for (i = 0; i < edp_num; i++) {
  			edp_link = edp_links[i];
  			if (edp_link != edp_streams[0]->link)
author
#17 lore raw

PATCH 16/18 drm/amd/display: Check return of shaper curve to HW format

In reply to Ray Wu

From: Alex Hung <[email protected]>

[Why & How]
Check return of cm3_helper_translate_curve_to_hw_format.

This is reported as a CHECKED_RETURN error by Coverity.

---
 drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +3 -3
index 2767d3a97812..a0aaa727e9fa 100644
@@ -486,7 +486,7 @@ bool dcn32_set_mcm_luts(
 	struct dpp *dpp_base = pipe_ctx->plane_res.dpp;
 	int mpcc_id = pipe_ctx->plane_res.hubp->inst;
 	struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc;
-	bool result = true;
+	bool rval, result;
 	const struct pwl_params *lut_params = NULL;
 
 	// 1D LUT
@@ -509,10 +509,10 @@ bool dcn32_set_mcm_luts(
 		lut_params = &plane_state->in_shaper_func.pwl;
 	else if (plane_state->in_shaper_func.type == TF_TYPE_DISTRIBUTED_POINTS) {
 		// TODO: dpp_base replace
-		cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
+		rval = cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
 							&plane_state->in_shaper_func,
 							&dpp_base->shaper_params, true);
-		lut_params = &dpp_base->shaper_params;
+		lut_params = rval ? &dpp_base->shaper_params : NULL;
 	}
 
 	mpc->funcs->program_shaper(mpc, lut_params, mpcc_id);
Signature · 1 line
2.43.0
author
#18 lore raw

PATCH 17/18 drm/amd/display: Remove conditional for shaper 3DLUT power-on

In reply to Ray Wu

From: Alex Hung <[email protected]>

[Why]
Shaper programming has high chance to fail on first time after power-on or reboot. This can be verified by running IGT's kms_colorop.

[How]
Always power on the shaper and 3DLUT before programming by removing the debug flag of low power mode.

---
 drivers/gpu/drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c +1 -2
index 83bbbf34bcac..badcef027b84 100644
@@ -724,8 +724,7 @@ bool mpc32_program_shaper(
 		return false;
 	}
 
-	if (mpc->ctx->dc->debug.enable_mem_low_power.bits.mpc)
-		mpc32_power_on_shaper_3dlut(mpc, mpcc_id, true);
+	mpc32_power_on_shaper_3dlut(mpc, mpcc_id, true);
 
 	current_mode = mpc32_get_shaper_current(mpc, mpcc_id);
 
Signature · 1 line
2.43.0
author
#19 lore raw

PATCH 18/18 drm/amd/display: Promote DC to 3.2.370

In reply to Ray Wu

From: Taimur Hassan <[email protected]>

This version brings along the following updates:

- Add static keyword for sharpness tables.
- Refactor fams2 calculations.
- Add gpuvm and hvm params to dml21.
- Expose functions of other dcn use.
- Extend inbox0 HW lock support to DCN35.
- Disable SR feature on eDP1 by default.
- Implement ramless idle mouse trigger.
- Migrate DCCG register access from hwseq to dccg component.
- Revert "Add Handling for gfxversion DcGfxBase".
- Revert changes to Gfx Linear Tiling handling.
- Skip eDP detection when no sink.
- Refactor and fix link_dpms.
- Correct logic check error for fastboot.
- Check return of shaper curve to HW format.
- Remove conditional for shaper 3DLUT power-on.

---
 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 4c4239cac863..71f2812acf59 100644
@@ -63,7 +63,7 @@ struct dcn_dsc_reg_state;
 struct dcn_optc_reg_state;
 struct dcn_dccg_reg_state;
 
-#define DC_VER "3.2.369"
+#define DC_VER "3.2.370"
 
 /**
  * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
Signature · 1 line
2.43.0
Tested-by on the v1 series
#20 lore raw
In reply to Ray Wu

[Public]

Hi all,

This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types.

APU
* Single Display eDP -> 1080p 60hz, 1920x1200 165hz, 3840x2400 60hz
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
* Thunderbolt -> LG Ultrafine 5k
* MST DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
* USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 2x 4k60hz DP and 1x 4k60hz HDMI displays
* SST PCON -> Club3D CAC-1085 + 1x 4k 144hz, FRL3, at a max resolution supported by the dongle of 4k 120hz YUV420 12bpc.
* MST PCON -> 1x 4k 144hz, FRL3, at a max resolution supported by the adapter of 4k 120hz RGB 8bpc.

DGPU
* Single Display DP (SST DSC) -> 4k144hz, 4k240hz
* Multiple Display DP -> 4k240hz + 4k144hz
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
* MST DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)

The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
* Changing display configurations and settings
* Video/Audio playback
* Benchmark testing
* Suspend/Resume testing
* Feature testing (Freesync, HDCP, etc.)

Automated testing includes (but is not limited to)
* Script testing (scripts to automate some of the manual checks)
* IGT testing

The testing is mainly tested on the following displays, but occasionally there are tests with other displays
* Samsung G8 Neo 4k240hz
* Samsung QN55QN95B 4k 120hz
* Acer XV322QKKV 4k144hz
* HP U27 4k Wireless 4k60hz
* LG 27UD58B 4k60hz
* LG 32UN650WA 4k60hz
* LG Ultrafine 5k 5k60hz
* AU Optronics B140HAN01.1 1080p 60hz eDP
* AU Optronics B160UAN01.J 1920x1200 165hz eDP
* Samsung ATNA60YV02-0 3840x2400 60Hz OLED eDP

The patchset consists of the amd-staging-drm-next branch (Head commit - 058df1bf2127958e3a8d0b1951a9b4420f3b6975 -> drm/amd/display: Refactor fams2 calculations) with new patches added on top of it.

Tested on Ubuntu 24.04.3, on Wayland and X11, using Gnome.

Thank you,

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

-----Original Message-----
From: Ray Wu <[email protected]>
Sent: Tuesday, February 10, 2026 8:50 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Wheeler, Daniel <[email protected]>; Wu, Ray <[email protected]>; LIPSKI, IVAN <[email protected]>; Hung, Alex <[email protected]>; Wu, Ray <[email protected]>
Subject: [PATCH 00/18] DC Patches Feburary 16, 2026

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

- Add static keyword for sharpness tables.
- Refactor fams2 calculations.
- Add gpuvm and hvm params to dml21.
- Expose functions of other dcn use.
- Extend inbox0 HW lock support to DCN35.
- Disable SR feature on eDP1 by default.
- Implement ramless idle mouse trigger.
- Migrate DCCG register access from hwseq to dccg component.
- Skip eDP detection when no sink.
- Refactor and fix link_dpms
- Correct logic check error for fastboot.
- Check return of shaper curve to HW format.
- Remove conditional for shaper 3DLUT power-on.

Cc Dan Wheeler <[email protected]>

Alex Hung (2):
drm/amd/display: Check return of shaper curve to HW format drm/amd/display: Remove conditional for shaper 3DLUT power-on

Bhuvanachandra Pinninti (1):
drm/amd/display: Migrate DCCG registers access from hwseq to dccg
component.

Charlene Liu (2):
drm/amd/display: Disable SR feature on eDP1 by default drm/amd/display: Correct logic check error for fastboot

Dillon Varone (1):
drm/amd/display: Refactor fams2 calculations

Dmytro Laktyushkin (2):
drm/amd/display: Add gpuvm and hvm params to dml21 drm/amd/display: Expose functions of other dcn use

Dominik Kaszewski (2):
drm/amd/display: Refactor and fix link_dpms I2C drm/amd/display: Refactor and fix link_dpms info

Muaaz Nisar (1):
drm/amd/display: Implementing ramless idle mouse trigger

Nicholas Carbones (3):
Revert "drm/amd/display: Add Handling for gfxversion DcGfxBase" Revert "drm/amd/display: Correct hubp GfxVersion verification" Revert "drm/amd/display: Add Gfx Base Case For Linear Tiling Handling"

Saidireddy Yenugu (1):
drm/amd/display: Skip eDP detection when no sink

Samson Tam (1):
drm/amd/display: Add static keyword for sharpness tables

Taimur Hassan (1):
drm/amd/display: Promote DC to 3.2.370

Webb Chen (1):
drm/amd/display: Extend inbox0 HW lock support to DCN35

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   6 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  12 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c |   8 +
 drivers/gpu/drm/amd/display/dc/core/dc.c      |   5 +-
 .../drm/amd/display/dc/core/dc_hw_sequencer.c |   7 -
 .../gpu/drm/amd/display/dc/core/dc_resource.c |   1 -
 .../gpu/drm/amd/display/dc/core/dc_stream.c   |  15 +
 drivers/gpu/drm/amd/display/dc/dc.h           |   3 +-
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h  |   3 +-
 drivers/gpu/drm/amd/display/dc/dc_stream.h    |   9 +
 .../amd/display/dc/dccg/dcn20/dcn20_dccg.c    |  54 +-
 .../amd/display/dc/dccg/dcn20/dcn20_dccg.h    |  14 +-
 .../amd/display/dc/dccg/dcn201/dcn201_dccg.c  |   7 +-
 .../amd/display/dc/dccg/dcn21/dcn21_dccg.c    |   6 +-
 .../amd/display/dc/dccg/dcn30/dcn30_dccg.c    |   6 +-
 .../amd/display/dc/dccg/dcn301/dcn301_dccg.c  |   6 +-
 .../amd/display/dc/dccg/dcn31/dcn31_dccg.c    |   5 +
 .../amd/display/dc/dccg/dcn314/dcn314_dccg.c  |   7 +-
 .../amd/display/dc/dccg/dcn32/dcn32_dccg.c    |   5 +
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    |  11 +-
 .../amd/display/dc/dccg/dcn401/dcn401_dccg.c  |  17 +-
 .../drm/amd/display/dc/dce/dce_mem_input.c    |   3 -
 .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c |   5 +
 .../display/dc/dce110/dce110_mem_input_v.c    |   3 -
 drivers/gpu/drm/amd/display/dc/dm_helpers.h   |   2 +-
 .../drm/amd/display/dc/dml/calcs/dcn_calcs.c  |   1 -
 .../dml2_0/dml21/dml21_translation_helper.c   |  11 +-
 .../amd/display/dc/dml2_0/dml21/dml21_utils.c | 205 +++---
 .../amd/display/dc/dml2_0/dml21/dml21_utils.h |   1 +
 .../dml21/inc/dml_top_soc_parameter_types.h   |   2 +
 .../drm/amd/display/dc/dml2_0/dml2_wrapper.h  |   1 +
 .../display/dc/hubbub/dcn401/dcn401_hubbub.c  |  10 +-  .../display/dc/hubbub/dcn401/dcn401_hubbub.h  |  10 +
 .../amd/display/dc/hubp/dcn10/dcn10_hubp.c    |  33 +-
 .../amd/display/dc/hubp/dcn20/dcn20_hubp.c    |  26 +-
 .../amd/display/dc/hubp/dcn30/dcn30_hubp.c    |  26 +-
 .../amd/display/dc/hubp/dcn401/dcn401_hubp.c  |   7 +-
 .../amd/display/dc/hwss/dce110/dce110_hwseq.c |   4 +-
 .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c   |   5 +-
 .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c   |  29 +-
 .../amd/display/dc/hwss/dcn201/dcn201_hwseq.c |   5 +-
 .../amd/display/dc/hwss/dcn21/dcn21_hwseq.c   |   9 +-
 .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c   |   5 +-
 .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c   |   5 +-
 .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c   |  11 +-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   |  48 +-
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h   |   4 +
 .../amd/display/dc/hwss/dcn35/dcn35_init.c    |   2 +
 .../amd/display/dc/hwss/dcn351/dcn351_init.c  |   2 +
 .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c |   5 +-
 drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h  |   4 +
 .../drm/amd/display/dc/link/link_detection.c  |   2 +-
 .../gpu/drm/amd/display/dc/link/link_dpms.c   | 640 +++++++-----------
 .../drm/amd/display/dc/mpc/dcn32/dcn32_mpc.c  |   3 +-
 .../amd/display/dc/optc/dcn35/dcn35_optc.c    |   6 +-
 .../amd/display/dc/optc/dcn35/dcn35_optc.h    |   9 +
 .../resource/dcn32/dcn32_resource_helpers.c   |   3 +-
 .../display/dc/sspl/dc_spl_isharp_filters.c   |   4 +-
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h   |   3 +-
 59 files changed, 698 insertions(+), 663 deletions(-)

--
2.43.0