Skip to contentSkip to conversation

DC Patches August 15, 2024

PATCH In review [email protected] 4 participants 22 messages Aug 15, 2024 – Aug 21, 2024

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

cover DC Patches August 15, 2024

From: Roman Li <[email protected]>

Cc Daniel Wheeler <[email protected]>

Aurabindo Pillai (1):
drm/amd/display: remove an extraneous call for checking dchub clock

Austin Zheng (1):
drm/amd/display: DML2.1 Reintegration for Various Fixes

Fangzhi Zuo (1):
drm/amd/display: Fix a typo in revert commit

Hansen Dsouza (1):
Revert "drm/amd/display: Update to using new dccg callbacks"

Ilya Bakoulin (1):
drm/amd/display: Fix construct_phy with MXM connector

Martin Leung (1):
drm/amd/display: Promote DC to 3.2.297

Michael Strauss (2):
drm/amd/display: Update HPO I/O When Handling Link Retrain Automation
Request
drm/amd/display: Allow UHBR Interop With eDP Supported Link Rates
Table

Nevenko Stupar (1):
drm/amd/display: Hardware cursor changes color when switched to
software cursor

Nicholas Susanto (2):
drm/amd/display: Remove redundant check in DCN35 hwseq drm/amd/display: DCN35 set min dispclk to 50Mhz

Sung Joon Kim (1):
drm/amd/display: Support UHBR10 link rate on eDP

Tim Huang (1):
drm/amd/display: fix double free issue during amdgpu module unload

 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   2 +-
 .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c  |   3 +
 .../gpu/drm/amd/display/dc/core/dc_resource.c |  18 +-
 drivers/gpu/drm/amd/display/dc/dc.h           |   3 +-
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    |   4 +-
 drivers/gpu/drm/amd/display/dc/dml2/Makefile  |   3 -
 .../dml21/inc/bounding_boxes/dcn4_soc_bb.h    |   2 +-
 .../dml21/inc/dml_top_soc_parameter_types.h   |   1 +
 .../dml2/dml21/src/dml2_core/dml2_core_dcn4.c |   1 -
 .../src/dml2_core/dml2_core_dcn4_calcs.c      | 478 +++++++------
 .../dml21/src/dml2_core/dml2_core_factory.c   |   2 +-
 .../dml21/src/dml2_core/dml2_core_shared.h    |  37 -
 .../src/dml2_core/dml2_core_shared_types.h    |  22 +-
 .../dml21/src/dml2_core/dml2_core_utils.c     | 631 ++++++++++++++++++
 .../dml21/src/dml2_core/dml2_core_utils.h     |  39 ++
 .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c |  54 +-
 .../dml21/src/dml2_dpmm/dml2_dpmm_factory.c   |   2 +-
 .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c  |  20 +-
 .../dml21/src/dml2_pmo/dml2_pmo_factory.c     |   2 +-
 .../amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c |   5 +-
 .../amd/display/dc/hwss/dce110/dce110_hwseq.c |  44 +-
 .../amd/display/dc/hwss/dcn31/dcn31_init.c    |   1 +
 .../amd/display/dc/hwss/dcn314/dcn314_init.c  |   1 +
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   |   3 -
 .../amd/display/dc/hwss/dcn351/dcn351_init.c  |   1 +
 .../drm/amd/display/dc/hwss/hw_sequencer.h    |   1 +
 drivers/gpu/drm/amd/display/dc/inc/resource.h |   2 +
 .../display/dc/link/accessories/link_dp_cts.c |   8 +
 .../drm/amd/display/dc/link/link_detection.c  |   3 +-
 .../gpu/drm/amd/display/dc/link/link_dpms.c   |   4 +-
 .../drm/amd/display/dc/link/link_factory.c    |   3 +-
 .../dc/link/protocols/link_dp_capability.c    |  59 +-
 .../link/protocols/link_edp_panel_control.c   |  14 +-
 .../link/protocols/link_edp_panel_control.h   |   2 +-
 .../dc/resource/dcn35/dcn35_resource.c        |   1 +
 35 files changed, 1110 insertions(+), 366 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.h
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/13 Revert "drm/amd/display: Update to using new dccg callbacks"

From: Hansen Dsouza <[email protected]>

[Why]
Revert updated DCCG wrappers due to regression

[How]
This reverts commit 28b190df7a8f43b39e13886d744742a74a2c162d.

---
 drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c +2 -2
index 004c4fe3ddfc..7f91e48902e2 100644
@@ -2396,11 +2396,11 @@ struct dccg *dccg35_create(
 	(void)&dccg35_disable_symclk_be_new;
 	(void)&dccg35_set_symclk32_le_root_clock_gating;
 	(void)&dccg35_set_smclk32_se_rcg;
-	(void)&dccg35_funcs;
+	(void)&dccg35_funcs_new;
 
 	base = &dccg_dcn->base;
 	base->ctx = ctx;
-	base->funcs = &dccg35_funcs_new;
+	base->funcs = &dccg35_funcs;
 
 	dccg_dcn->regs = regs;
 	dccg_dcn->dccg_shift = dccg_shift;
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/13 drm/amd/display: Update HPO I/O When Handling Link Retrain Automation Request

In reply to [email protected]

From: Michael Strauss <[email protected]>

[WHY]
Previous multi-display HPO fix moved where HPO I/O enable/disable is performed. The codepath now taken to enable/disable HPO I/O is not used for compliance test automation, meaning that if a compliance box being driven at a DP1 rate requests retrain at UHBR, HPO I/O will remain off if it was previously off.

[HOW]
Explicitly update HPO I/O after allocating encoders for test request.

---
 .../gpu/drm/amd/display/dc/core/dc_resource.c | 13 ++++++++++++
 .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 21 ++++---------------
 .../amd/display/dc/hwss/dcn31/dcn31_init.c    |  1 +
 .../amd/display/dc/hwss/dcn314/dcn314_init.c  |  1 +
 .../amd/display/dc/hwss/dcn351/dcn351_init.c  |  1 +
 .../drm/amd/display/dc/hwss/hw_sequencer.h    |  1 +
 drivers/gpu/drm/amd/display/dc/inc/resource.h |  2 ++
 .../display/dc/link/accessories/link_dp_cts.c |  8 +++++++
 8 files changed, 31 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +13 -0
index b38340c690c6..b6377efc6253 100644
@@ -5303,3 +5303,16 @@ int resource_calculate_det_for_stream(struct dc_state *state, struct pipe_ctx *o
 	}
 	return det_segments;
 }
+
+bool resource_is_hpo_acquired(struct dc_state *context)
+{
+	int i;
+
+	for (i = 0; i < MAX_HPO_DP2_ENCODERS; i++) {
+		if (context->res_ctx.is_hpo_dp_stream_enc_acquired[i]) {
+			return true;
+		}
+	}
+
+	return false;
+}
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +4 -17
index 217344ccf644..246fa300ee95 100644
@@ -2350,19 +2350,6 @@ static void dce110_setup_audio_dto(
 	}
 }
 
-static bool dce110_is_hpo_enabled(struct dc_state *context)
-{
-	int i;
-
-	for (i = 0; i < MAX_HPO_DP2_ENCODERS; i++) {
-		if (context->res_ctx.is_hpo_dp_stream_enc_acquired[i]) {
-			return true;
-		}
-	}
-
-	return false;
-}
-
 enum dc_status dce110_apply_ctx_to_hw(
 		struct dc *dc,
 		struct dc_state *context)
@@ -2371,8 +2358,8 @@ enum dc_status dce110_apply_ctx_to_hw(
 	struct dc_bios *dcb = dc->ctx->dc_bios;
 	enum dc_status status;
 	int i;
-	bool was_hpo_enabled = dce110_is_hpo_enabled(dc->current_state);
-	bool is_hpo_enabled = dce110_is_hpo_enabled(context);
+	bool was_hpo_acquired = resource_is_hpo_acquired(dc->current_state);
+	bool is_hpo_acquired = resource_is_hpo_acquired(context);
 
 	/* reset syncd pipes from disabled pipes */
 	if (dc->config.use_pipe_ctx_sync_logic)
@@ -2415,8 +2402,8 @@ enum dc_status dce110_apply_ctx_to_hw(
 
 	dce110_setup_audio_dto(dc, context);
 
-	if (dc->hwseq->funcs.setup_hpo_hw_control && was_hpo_enabled != is_hpo_enabled) {
-		dc->hwseq->funcs.setup_hpo_hw_control(dc->hwseq, is_hpo_enabled);
+	if (dc->hwseq->funcs.setup_hpo_hw_control && was_hpo_acquired != is_hpo_acquired) {
+		dc->hwseq->funcs.setup_hpo_hw_control(dc->hwseq, is_hpo_acquired);
 	}
 
 	for (i = 0; i < dc->res_pool->pipe_count; i++) {
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c +1 -0
index b57dd45611f2..56f3c70d4b55 100644
@@ -111,6 +111,7 @@ static const struct hw_sequencer_funcs dcn31_funcs = {
 	.optimize_pwr_state = dcn21_optimize_pwr_state,
 	.exit_optimized_pwr_state = dcn21_exit_optimized_pwr_state,
 	.update_visual_confirm_color = dcn10_update_visual_confirm_color,
+	.setup_hpo_hw_control = dcn31_setup_hpo_hw_control,
 };
 
 static const struct hwseq_private_funcs dcn31_private_funcs = {
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c +1 -0
index fe5495a8e7a2..68e6de6b5758 100644
@@ -114,6 +114,7 @@ static const struct hw_sequencer_funcs dcn314_funcs = {
 	.exit_optimized_pwr_state = dcn21_exit_optimized_pwr_state,
 	.update_visual_confirm_color = dcn10_update_visual_confirm_color,
 	.calculate_pix_rate_divider = dcn314_calculate_pix_rate_divider,
+	.setup_hpo_hw_control = dcn31_setup_hpo_hw_control,
 };
 
 static const struct hwseq_private_funcs dcn314_private_funcs = {
drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +1 -0
index 5da3069fc1ab..d00822e8daa5 100644
@@ -123,6 +123,7 @@ static const struct hw_sequencer_funcs dcn351_funcs = {
 	.set_long_vtotal = dcn35_set_long_vblank,
 	.calculate_pix_rate_divider = dcn32_calculate_pix_rate_divider,
 	.program_outstanding_updates = dcn32_program_outstanding_updates,
+	.setup_hpo_hw_control = dcn35_setup_hpo_hw_control,
 };
 
 static const struct hwseq_private_funcs dcn351_private_funcs = {
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h +1 -0
index 326854489802..ac9205625623 100644
@@ -461,6 +461,7 @@ struct hw_sequencer_funcs {
 	void (*set_long_vtotal)(struct pipe_ctx **pipe_ctx, int num_pipes, uint32_t v_total_min, uint32_t v_total_max);
 	void (*program_outstanding_updates)(struct dc *dc,
 			struct dc_state *context);
+	void (*setup_hpo_hw_control)(const struct dce_hwseq *hws, bool enable);
 };
 
 void color_space_to_black_color(
drivers/gpu/drm/amd/display/dc/inc/resource.h +2 -0
index 9cd80d3864c7..cd1157d225ab 100644
@@ -644,4 +644,6 @@ void resource_init_common_dml2_callbacks(struct dc *dc, struct dml2_configuratio
  *Calculate total DET allocated for all pipes for a given OTG_MASTER pipe
  */
 int resource_calculate_det_for_stream(struct dc_state *state, struct pipe_ctx *otg_master);
+
+bool resource_is_hpo_acquired(struct dc_state *context);
 #endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c +8 -0
index df3781081da7..ff8fe1a94965 100644
@@ -67,6 +67,8 @@ static void dp_retrain_link_dp_test(struct dc_link *link,
 {
 	struct pipe_ctx *pipes[MAX_PIPES];
 	struct dc_state *state = link->dc->current_state;
+	bool was_hpo_acquired = resource_is_hpo_acquired(link->dc->current_state);
+	bool is_hpo_acquired;
 	uint8_t count;
 	int i;
 
@@ -83,6 +85,12 @@ static void dp_retrain_link_dp_test(struct dc_link *link,
 				pipes[i]);
 	}
 
+	if (link->dc->hwss.setup_hpo_hw_control) {
+		is_hpo_acquired = resource_is_hpo_acquired(state);
+		if (was_hpo_acquired != is_hpo_acquired)
+			link->dc->hwss.setup_hpo_hw_control(link->dc->hwseq, is_hpo_acquired);
+	}
+
 	for (i = count-1; i >= 0; i--)
 		link_set_dpms_on(state, pipes[i]);
 }
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/13 drm/amd/display: remove an extraneous call for checking dchub clock

In reply to [email protected]

From: Aurabindo Pillai <[email protected]>

when removing the amdgpu module and reinserting it, a call trace is triggered:

[  334.230602] RIP: 0010:hubbub2_get_dchub_ref_freq+0xbb/0xe0 [amdgpu]
[  334.230807] Code: 25 28 00 00 00 75 3c 48 8d 65 f0 5b 41 5c 5d 31 c0 31 d2 31 c9 31 f6 31 ff 45 31 c0 45 31 c9 45 31 d2 45 31 db e9 55 a1 ca de <0f> 0b eb c6 0f 0b eb c2 d1 eb 8d 83 c0 63 ff ff 3d 20 4e 00 00 76
[  334.230809] RSP: 0018:ffffbc8b823fb540 EFLAGS: 00010246
[  334.230811] RAX: 0000000000001000 RBX: 00000000000186a0 RCX: 0000000000000000
[  334.230812] RDX: ffffbc8b823fb544 RSI: 0000000000000000 RDI: 0000000000000000
[  334.230813] RBP: ffffbc8b823fb560 R08: 0000000000000000 R09: 0000000000000000
[  334.230814] R10: 0000000000000000 R11: 000000000000000f R12: ffff9e644f1f2bb0
[  334.230815] R13: ffff9e6451361300 R14: 0000000000000000 R15: ffff9e6452c00000
[  334.230816] FS:  00007af7c8519000(0000) GS:ffff9e737dd00000(0000) knlGS:0000000000000000
[  334.230817] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  334.230818] CR2: 0000703576b9cbd0 CR3: 00000001095a2000 CR4: 0000000000750ee0
[  334.230819] PKRU: 55555554
[  334.230820] Call Trace:
[  334.230822]  <TASK>
[  334.230824]  ? show_regs+0x6d/0x80
[  334.230828]  ? __warn+0x89/0x160
[  334.230832]  ? hubbub2_get_dchub_ref_freq+0xbb/0xe0 [amdgpu]
[  334.231024]  ? report_bug+0x17e/0x1b0
[  334.231028]  ? handle_bug+0x46/0x90
[  334.231030]  ? exc_invalid_op+0x18/0x80
[  334.231032]  ? asm_exc_invalid_op+0x1b/0x20
[  334.231036]  ? hubbub2_get_dchub_ref_freq+0xbb/0xe0 [amdgpu]
[  334.231217]  dc_create_resource_pool+0xfd/0x320 [amdgpu]
[  334.231408]  dc_create+0x256/0x700 [amdgpu]
[  334.231588]  ? srso_alias_return_thunk+0x5/0x7f
[  334.231590]  ? dmi_matches+0xa0/0x230
[  334.231594]  amdgpu_dm_init+0x28c/0x25f0 [amdgpu]
[  334.231791]  ? prb_read_valid+0x1c/0x30
[  334.231795]  ? __irq_work_queue_local+0x43/0xf0
[  334.231798]  ? srso_alias_return_thunk+0x5/0x7f
[  334.231800]  ? irq_work_queue+0x2f/0x70
[  334.231802]  ? srso_alias_return_thunk+0x5/0x7f
[  334.231803]  ? __wake_up_klogd.part.0+0x40/0x70
[  334.231805]  ? srso_alias_return_thunk+0x5/0x7f
[  334.231807]  ? vprintk_emit+0xd9/0x210
[  334.231809]  ? set_dev_info+0x130/0x1c0
[  334.231812]  ? srso_alias_return_thunk+0x5/0x7f
[  334.231813]  ? dev_printk_emit+0xa1/0xe0
[  334.231819]  dm_hw_init+0x14/0x30 [amdgpu]
[  334.231993]  amdgpu_device_init+0x23c7/0x2fc0 [amdgpu]
[  334.232134]  ? pci_read_config_word+0x25/0x50
[  334.232139]  amdgpu_driver_load_kms+0x1a/0xd0 [amdgpu]
[  334.232284]  amdgpu_pci_probe+0x1f9/0x620 [amdgpu]

On DCN401, get_dchub_ref_freq() hook is called before init_hw() hook. Hence, it is expected to trigger an assert. Remove the extraneous call to get_dchub_ref_freq() to suppress the call trace

---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -5
index b6377efc6253..ef585a89847b 100644
@@ -342,11 +342,6 @@ struct resource_pool *dc_create_resource_pool(struct dc  *dc,
 				res_pool->ref_clocks.xtalin_clock_inKhz;
 			res_pool->ref_clocks.dchub_ref_clock_inKhz =
 				res_pool->ref_clocks.xtalin_clock_inKhz;
-			if (dc->debug.using_dml2)
-				if (res_pool->hubbub && res_pool->hubbub->funcs->get_dchub_ref_freq)
-					res_pool->hubbub->funcs->get_dchub_ref_freq(res_pool->hubbub,
-										    res_pool->ref_clocks.dccg_ref_clock_inKhz,
-										    &res_pool->ref_clocks.dchub_ref_clock_inKhz);
 		} else
 			ASSERT_CRITICAL(false);
 	}
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/13 drm/amd/display: Remove redundant check in DCN35 hwseq

In reply to [email protected]

From: Nicholas Susanto <[email protected]>

Removing redundant condition.

---
 drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +0 -3
index 899e239352aa..fbbb20b9dbee 100644
@@ -1024,9 +1024,6 @@ void dcn35_calc_blocks_to_gate(struct dc *dc, struct dc_state *context,
 	if (!hpo_frl_stream_enc_acquired && !hpo_dp_stream_enc_acquired)
 		update_state->pg_res_update[PG_HPO] = true;
 
-	if (hpo_frl_stream_enc_acquired)
-		update_state->pg_pipe_res_update[PG_HDMISTREAM][0] = true;
-
 	update_state->pg_res_update[PG_DWB] = true;
 
 	for (i = 0; i < dc->res_pool->pipe_count; i++) {
Signature · 1 line
2.34.1
#5 lore raw

PATCH 5/13 drm/amd/display: Allow UHBR Interop With eDP Supported Link Rates Table

In reply to [email protected]

From: Michael Strauss <[email protected]>

[WHY]
eDP 2.0 is introducing support for UHBR link rates, however current eDP ILR link optimization does not account for UHBR capabilities.
Either UHBR capabilities will be provided via the same 128b/132b rate DPCD caps that are currently used on DP2.1, or Table 4-13 may be updated to include UHBR rates.

[HOW]
Add extra Supported Link Rates table translations for UHBR10/13.5/20. Update eDP link setting optimization search to be aware of 128b/132b DPCD rate caps in order to unblock UHBR on panels with Supported Link Rates table.

---
 .../drm/amd/display/dc/link/link_detection.c  |  3 +-
 .../dc/link/protocols/link_dp_capability.c    | 59 ++++++++++---------
 .../link/protocols/link_edp_panel_control.c   | 11 ++--
 .../link/protocols/link_edp_panel_control.h   |  2 +-
 4 files changed, 40 insertions(+), 35 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_detection.c +1 -2
index 391dbe81534d..d21ee9d12d26 100644
@@ -1189,8 +1189,7 @@ static bool detect_link_and_local_sink(struct dc_link *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)
 				link->panel_config.ilr.optimize_edp_link_rate = true;
-			if (edp_is_ilr_optimization_enabled(link))
-				link->reported_link_cap.link_rate = get_max_link_rate_from_ilr_table(link);
+			link->reported_link_cap.link_rate = get_max_edp_link_rate(link);
 		}
 
 	} else {
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +32 -27

107 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +6 -5
index bf820d2b4dc4..070b6c8c1aef 100644
@@ -305,16 +305,17 @@ bool edp_is_ilr_optimization_enabled(struct dc_link *link)
 	return true;
 }
 
-enum dc_link_rate get_max_link_rate_from_ilr_table(struct dc_link *link)
+enum dc_link_rate get_max_edp_link_rate(struct dc_link *link)
 {
-	enum dc_link_rate link_rate = link->reported_link_cap.link_rate;
+	enum dc_link_rate max_ilr_rate = LINK_RATE_UNKNOWN;
+	enum dc_link_rate max_non_ilr_rate = dp_get_max_link_cap(link).link_rate;
 
 	for (int i = 0; i < link->dpcd_caps.edp_supported_link_rates_count; i++) {
-		if (link_rate < link->dpcd_caps.edp_supported_link_rates[i])
-			link_rate = link->dpcd_caps.edp_supported_link_rates[i];
+		if (max_ilr_rate < link->dpcd_caps.edp_supported_link_rates[i])
+			max_ilr_rate = link->dpcd_caps.edp_supported_link_rates[i];
 	}
 
-	return link_rate;
+	return (max_ilr_rate > max_non_ilr_rate ? max_ilr_rate : max_non_ilr_rate);
 }
 
 bool edp_is_ilr_optimization_required(struct dc_link *link,
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.h +1 -1
index 8df8ac5bde5b..30dc8c24c008 100644
@@ -69,7 +69,7 @@ bool edp_wait_for_t12(struct dc_link *link);
 bool edp_is_ilr_optimization_required(struct dc_link *link,
        struct dc_crtc_timing *crtc_timing);
 bool edp_is_ilr_optimization_enabled(struct dc_link *link);
-enum dc_link_rate get_max_link_rate_from_ilr_table(struct dc_link *link);
+enum dc_link_rate get_max_edp_link_rate(struct dc_link *link);
 bool edp_backlight_enable_aux(struct dc_link *link, bool enable);
 void edp_add_delay_for_T9(struct dc_link *link);
 bool edp_receiver_ready_T9(struct dc_link *link);
Signature · 1 line
2.34.1
#6 lore raw

PATCH 6/13 drm/amd/display: Hardware cursor changes color when switched to software cursor

In reply to [email protected]

From: Nevenko Stupar <[email protected]>

[Why & How]
DCN4 Cursor has separate degamma block and should always do Cursor degamma for Cursor color modes.

---
 drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c +2 -3
index 92b34fe47f74..3b6ca7974e18 100644
@@ -120,11 +120,10 @@ void dpp401_set_cursor_attributes(
 	enum dc_cursor_color_format color_format = cursor_attributes->color_format;
 	int cur_rom_en = 0;
 
+	// DCN4 should always do Cursor degamma for Cursor Color modes
 	if (color_format == CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA ||
 		color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA) {
-		if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) {
-			cur_rom_en = 1;
-		}
+		cur_rom_en = 1;
 	}
 
 	REG_UPDATE_3(CURSOR0_CONTROL,
Signature · 1 line
2.34.1
#7 lore raw

PATCH 7/13 drm/amd/display: Support UHBR10 link rate on eDP

In reply to [email protected]

From: Sung Joon Kim <[email protected]>

[why]
Supporting UHBR10 link rate on eDP leverages the existing DP2.0 code but need to add some small adjustments in code.

[how]
Acknowledge the given DPCD caps for UHBR10 link rate support and allow DP2.0 programming sequence and link training for eDP.

---
 drivers/gpu/drm/amd/display/dc/dc.h           |  1 +
 .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 23 ++++++++++---------
 .../gpu/drm/amd/display/dc/link/link_dpms.c   |  4 ++--
 .../link/protocols/link_edp_panel_control.c   |  3 +++
 4 files changed, 18 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
index 6b036417a73a..3de311533571 100644
@@ -1760,6 +1760,7 @@ struct dc_link {
 		bool dongle_mode_timing_override;
 		bool blank_stream_on_ocs_change;
 		bool read_dpcd204h_on_irq_hpd;
+		bool disable_assr_for_uhbr;
 	} wa_flags;
 	struct link_mst_stream_allocation_table mst_stream_alloc_table;
 
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +12 -11
index 246fa300ee95..d52ce58c6a98 100644
@@ -1232,20 +1232,21 @@ void dce110_blank_stream(struct pipe_ctx *pipe_ctx)
 			 * has changed or they enter protection state and hang.
 			 */
 			msleep(60);
-		} else if (pipe_ctx->stream->signal == SIGNAL_TYPE_EDP) {
-			if (!link->dc->config.edp_no_power_sequencing) {
-				/*
-				 * Sometimes, DP receiver chip power-controlled externally by an
-				 * Embedded Controller could be treated and used as eDP,
-				 * if it drives mobile display. In this case,
-				 * we shouldn't be doing power-sequencing, hence we can skip
-				 * waiting for T9-ready.
-				 */
-				link->dc->link_srv->edp_receiver_ready_T9(link);
-			}
 		}
 	}
 
+	if (pipe_ctx->stream->signal == SIGNAL_TYPE_EDP &&
+	    !link->dc->config.edp_no_power_sequencing) {
+			/*
+			 * Sometimes, DP receiver chip power-controlled externally by an
+			 * Embedded Controller could be treated and used as eDP,
+			 * if it drives mobile display. In this case,
+			 * we shouldn't be doing power-sequencing, hence we can skip
+			 * waiting for T9-ready.
+			 */
+		link->dc->link_srv->edp_receiver_ready_T9(link);
+	}
+
 }
 
 
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +2 -2
index d6550b904b16..c4e03482ba9a 100644
@@ -2358,7 +2358,7 @@ void link_set_dpms_off(struct pipe_ctx *pipe_ctx)
 
 	if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
 		deallocate_mst_payload(pipe_ctx);
-	else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT &&
+	else if (dc_is_dp_sst_signal(pipe_ctx->stream->signal) &&
 			dp_is_128b_132b_signal(pipe_ctx))
 		update_sst_payload(pipe_ctx, false);
 
@@ -2591,7 +2591,7 @@ void link_set_dpms_on(
 
 	if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
 		allocate_mst_payload(pipe_ctx);
-	else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT &&
+	else if (dc_is_dp_sst_signal(pipe_ctx->stream->signal) &&
 			dp_is_128b_132b_signal(pipe_ctx))
 		update_sst_payload(pipe_ctx, true);
 
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +3 -0
index 070b6c8c1aef..3aa05a2be6c0 100644
@@ -1168,6 +1168,9 @@ static void edp_set_assr_enable(const struct dc *pDC, struct dc_link *link,
 	link_enc_index = link->link_enc->transmitter - TRANSMITTER_UNIPHY_A;
 
 	if (link_res->hpo_dp_link_enc) {
+		if (link->wa_flags.disable_assr_for_uhbr)
+			return;
+
 		link_enc_index = link_res->hpo_dp_link_enc->inst;
 		use_hpo_dp_link_enc = true;
 	}
Signature · 1 line
2.34.1
#8 lore raw

PATCH 8/13 drm/amd/display: Fix construct_phy with MXM connector

In reply to [email protected]

From: Ilya Bakoulin <[email protected]>

[Why/How]
The call to construct_phy will fail in cases where connector type is MXM, and the dc_link won't be properly created/initialized.

---
 drivers/gpu/drm/amd/display/dc/link/link_factory.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/link/link_factory.c +1 -0
index 8246006857b3..85fd6e422238 100644
@@ -524,6 +524,7 @@ static bool construct_phy(struct dc_link *link,
 		link->connector_signal = SIGNAL_TYPE_DVI_DUAL_LINK;
 		break;
 	case CONNECTOR_ID_DISPLAY_PORT:
+	case CONNECTOR_ID_MXM:
 	case CONNECTOR_ID_USBC:
 		link->connector_signal = SIGNAL_TYPE_DISPLAY_PORT;
 
Signature · 1 line
2.34.1
#9 lore raw

PATCH 9/13 drm/amd/display: DCN35 set min dispclk to 50Mhz

In reply to [email protected]

From: Nicholas Susanto <[email protected]>

[Why]

Causes hard hangs when resuming after display off on extended/duplicate modes

[How]

Set the min dispclk to 50Mhz for DCN35

---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c   | 3 +++
 drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 1 +
 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +3 -0
index e2d906327e2e..0ce9b40dfc68 100644
@@ -305,6 +305,9 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base,
 	if (new_clocks->dtbclk_en && !new_clocks->ref_dtbclk_khz)
 		new_clocks->ref_dtbclk_khz = 600000;
 
+	if (dc->debug.min_disp_clk_khz > 0 && new_clocks->dispclk_khz < dc->debug.min_disp_clk_khz)
+		new_clocks->dispclk_khz = dc->debug.min_disp_clk_khz;
+
 	/*
 	 * if it is safe to lower, but we are already in the lower state, we don't have to do anything
 	 * also if safe to lower is false, we just go in the higher state
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +1 -0
index 5f3705f97bd7..46ad684fe192 100644
@@ -786,6 +786,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 	.disable_dmub_reallow_idle = false,
 	.static_screen_wait_frames = 2,
 	.disable_timeout = true,
+	.min_disp_clk_khz = 50000,
 };
 
 static const struct dc_panel_config panel_config_defaults = {
Signature · 1 line
2.34.1
#10 lore raw

PATCH 10/13 drm/amd/display: fix double free issue during amdgpu module unload

In reply to [email protected]

From: Tim Huang <[email protected]>

Flexible endpoints use DIGs from available inflexible endpoints, so only the encoders of inflexible links need to be freed. Otherwise, a double free issue may occur when unloading the amdgpu module.

[  279.190523] RIP: 0010:__slab_free+0x152/0x2f0
[  279.190577] Call Trace:
[  279.190580]  <TASK>
[  279.190582]  ? show_regs+0x69/0x80
[  279.190590]  ? die+0x3b/0x90
[  279.190595]  ? do_trap+0xc8/0xe0
[  279.190601]  ? do_error_trap+0x73/0xa0
[  279.190605]  ? __slab_free+0x152/0x2f0
[  279.190609]  ? exc_invalid_op+0x56/0x70
[  279.190616]  ? __slab_free+0x152/0x2f0
[  279.190642]  ? asm_exc_invalid_op+0x1f/0x30
[  279.190648]  ? dcn10_link_encoder_destroy+0x19/0x30 [amdgpu]
[  279.191096]  ? __slab_free+0x152/0x2f0
[  279.191102]  ? dcn10_link_encoder_destroy+0x19/0x30 [amdgpu]
[  279.191469]  kfree+0x260/0x2b0
[  279.191474]  dcn10_link_encoder_destroy+0x19/0x30 [amdgpu]
[  279.191821]  link_destroy+0xd7/0x130 [amdgpu]
[  279.192248]  dc_destruct+0x90/0x270 [amdgpu]
[  279.192666]  dc_destroy+0x19/0x40 [amdgpu]
[  279.193020]  amdgpu_dm_fini+0x16e/0x200 [amdgpu]
[  279.193432]  dm_hw_fini+0x26/0x40 [amdgpu]
[  279.193795]  amdgpu_device_fini_hw+0x24c/0x400 [amdgpu]
[  279.194108]  amdgpu_driver_unload_kms+0x4f/0x70 [amdgpu]
[  279.194436]  amdgpu_pci_remove+0x40/0x80 [amdgpu]
[  279.194632]  pci_device_remove+0x3a/0xa0
[  279.194638]  device_remove+0x40/0x70
[  279.194642]  device_release_driver_internal+0x1ad/0x210
[  279.194647]  driver_detach+0x4e/0xa0
[  279.194650]  bus_remove_driver+0x6f/0xf0
[  279.194653]  driver_unregister+0x33/0x60
[  279.194657]  pci_unregister_driver+0x44/0x90
[  279.194662]  amdgpu_exit+0x19/0x1f0 [amdgpu]
[  279.194939]  __do_sys_delete_module.isra.0+0x198/0x2f0
[  279.194946]  __x64_sys_delete_module+0x16/0x20
[  279.194950]  do_syscall_64+0x58/0x120
[  279.194954]  entry_SYSCALL_64_after_hwframe+0x6e/0x76
[  279.194980]  </TASK>
---
 drivers/gpu/drm/amd/display/dc/link/link_factory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/link/link_factory.c +1 -1
index 85fd6e422238..5e1b5ab9fbc6 100644
@@ -385,7 +385,7 @@ static void link_destruct(struct dc_link *link)
 	if (link->panel_cntl)
 		link->panel_cntl->funcs->destroy(&link->panel_cntl);
 
-	if (link->link_enc) {
+	if (link->link_enc && !link->is_dig_mapping_flexible) {
 		/* Update link encoder resource tracking variables. These are used for
 		 * the dynamic assignment of link encoders to streams. Virtual links
 		 * are not assigned encoder resources on creation.
Signature · 1 line
2.34.1
#11 lore raw

PATCH 11/13 drm/amd/display: DML2.1 Reintegration for Various Fixes

In reply to [email protected]

From: Austin Zheng <[email protected]>

[Why and How]
DML2.1 reintegration for several fixes and updates to the DML code.

---
 drivers/gpu/drm/amd/display/dc/dml2/Makefile  |   3 -
 .../dml21/inc/bounding_boxes/dcn4_soc_bb.h    |   2 +-
 .../dml21/inc/dml_top_soc_parameter_types.h   |   1 +
 .../dml2/dml21/src/dml2_core/dml2_core_dcn4.c |   1 -
 .../src/dml2_core/dml2_core_dcn4_calcs.c      | 478 +++++++------
 .../dml21/src/dml2_core/dml2_core_factory.c   |   2 +-
 .../dml21/src/dml2_core/dml2_core_shared.h    |  37 -
 .../src/dml2_core/dml2_core_shared_types.h    |  22 +-
 .../dml21/src/dml2_core/dml2_core_utils.c     | 631 ++++++++++++++++++
 .../dml21/src/dml2_core/dml2_core_utils.h     |  39 ++
 .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c |  54 +-
 .../dml21/src/dml2_dpmm/dml2_dpmm_factory.c   |   2 +-
 .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c  |  20 +-
 .../dml21/src/dml2_pmo/dml2_pmo_factory.c     |   2 +-
 14 files changed, 1009 insertions(+), 285 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.h
drivers/gpu/drm/amd/display/dc/dml2/Makefile +0 -3
index e954182c70a3..d2e158e69df4 100644
@@ -111,7 +111,6 @@ CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml2_top_optimization := $(dml2_
 CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.o := $(dml2_ccflags)
 CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.o := $(dml2_ccflags) $(frame_warn_flag)
 CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_factory.o := $(dml2_ccflags)
-CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_shared.o := $(dml2_ccflags) $(frame_warn_flag)
 CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.o := $(dml2_ccflags)
 CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.o := $(dml2_ccflags)
 CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_mcg/dml2_mcg_dcn4.o := $(dml2_ccflags)
@@ -133,7 +132,6 @@ CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.o :
 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.o := $(dml2_rcflags)
 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.o := $(dml2_rcflags)
 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_factory.o := $(dml2_rcflags)
-CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_shared.o := $(dml2_rcflags)
 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.o := $(dml2_rcflags)
 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.o := $(dml2_rcflags)
 CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_mcg/dml2_mcg_dcn4.o := $(dml2_rcflags)
@@ -154,7 +152,6 @@ DML21 += src/inc/dml2_debug.o
 DML21 += src/dml2_core/dml2_core_dcn4.o
 DML21 += src/dml2_core/dml2_core_factory.o
 DML21 += src/dml2_core/dml2_core_dcn4_calcs.o
-DML21 += src/dml2_core/dml2_core_shared.o
 DML21 += src/dml2_dpmm/dml2_dpmm_dcn4.o
 DML21 += src/dml2_dpmm/dml2_dpmm_factory.o
 DML21 += src/dml2_mcg/dml2_mcg_dcn4.o
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/bounding_boxes/dcn4_soc_bb.h +1 -1
index 898b1dd69edd..8ef7977841de 100644
@@ -355,7 +355,7 @@ static const struct dml2_ip_capabilities dml2_dcn401_max_ip_caps = {
 	.fams2 = {
 		.max_allow_delay_us = 100 * 1000,
 		.scheduling_delay_us = 125,
-		.vertical_interrupt_ack_delay_us = 18,
+		.vertical_interrupt_ack_delay_us = 40,
 		.allow_programming_delay_us = 18,
 		.min_allow_width_us = 20,
 		.subvp_df_throttle_delay_us = 100,
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_soc_parameter_types.h +1 -0
index 4a46b21c3e55..ebd8abe894a9 100644
@@ -151,6 +151,7 @@ struct dml2_soc_bb {
 	double phy_downspread_percent;
 	double dcn_downspread_percent;
 	double dispclk_dppclk_vco_speed_mhz;
+	bool no_dfs;
 	bool do_urgent_latency_adjustment;
 	unsigned int mem_word_bytes;
 	unsigned int num_dcc_mcaches;
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.c +0 -1
index 9375c6ae1147..698307f3ca39 100644
@@ -273,7 +273,6 @@ static void pack_mode_programming_params_with_implicit_subvp(struct dml2_core_in
 		programming->fams2_required = display_cfg->stage3.fams2_required;
 
 		dml2_core_calcs_get_global_fams2_programming(&core->clean_me_up.mode_lib, display_cfg, &programming->fams2_global_config);
-		programming->fams2_global_config.features.bits.enable = display_cfg->stage3.fams2_required;
 	}
 
 	// Only loop over all the main streams (the implicit svp streams will be packed as part of the main stream)
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +262 -216

1,033 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_factory.c +1 -1
index 640087e862f8..28394de02885 100644
@@ -10,7 +10,7 @@ bool dml2_core_create(enum dml2_project_id project_id, struct dml2_core_instance
 {
 	bool result = false;
 
-	if (!out)
+	if (out == 0)
 		return false;
 
 	memset(out, 0, sizeof(struct dml2_core_instance));
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared.h deleted +0 -37
deleted file mode 100644
index f3356b072b59..000000000000
@@ -1,37 +0,0 @@
-// SPDX-License-Identifier: MIT
-//
-// Copyright 2024 Advanced Micro Devices, Inc.
-
-#ifndef __DML2_CORE_SHARED_H__
-#define __DML2_CORE_SHARED_H__
-
-#define __DML_VBA_DEBUG__
-#define __DML2_CALCS_MAX_VRATIO_PRE_OTO__ 4.0 //<brief Prefetch schedule max vratio for one to one scheduling calculation for prefetch
-#define __DML2_CALCS_MAX_VRATIO_PRE_ENHANCE_PREFETCH_ACC__ 6.0 //<brief Prefetch schedule max vratio when enhance prefetch schedule acceleration is enabled and vstartup is earliest possible already
-#define __DML2_CALCS_DPP_INVALID__ 0
-#define __DML2_CALCS_DCFCLK_FACTOR__ 1.15 //<brief fudge factor for min dcfclk calclation
-#define __DML2_CALCS_PIPE_NO_PLANE__ 99
-
-#include "dml2_core_shared_types.h"
-#include "dml2_internal_shared_types.h"
-
-double dml2_core_shared_div_rem(double dividend, unsigned int divisor, unsigned int *remainder);
-
-const char *dml2_core_internal_bw_type_str(enum dml2_core_internal_bw_type bw_type);
-const char *dml2_core_internal_soc_state_type_str(enum dml2_core_internal_soc_state_type dml2_core_internal_soc_state_type);
-bool dml2_core_shared_is_420(enum dml2_source_format_class source_format);
-
-bool dml2_core_shared_mode_support(struct dml2_core_calcs_mode_support_ex *in_out_params);
-bool dml2_core_shared_mode_programming(struct dml2_core_calcs_mode_programming_ex *in_out_params);
-void dml2_core_shared_get_watermarks(const struct dml2_display_cfg *display_cfg, const struct dml2_core_internal_display_mode_lib *mode_lib, struct dml2_dchub_watermark_regs *out);
-void dml2_core_shared_get_arb_params(const struct dml2_core_internal_display_mode_lib *mode_lib, struct dml2_display_arb_regs *out);
-void dml2_core_shared_get_pipe_regs(const struct dml2_display_cfg *display_cfg,	struct dml2_core_internal_display_mode_lib *mode_lib,	struct dml2_dchub_per_pipe_register_set *out, int pipe_index);
-void dml2_core_shared_get_stream_programming(const struct dml2_core_internal_display_mode_lib *mode_lib, struct dml2_per_stream_programming *out, int pipe_index);
-void dml2_core_shared_get_mcache_allocation(const struct dml2_core_internal_display_mode_lib *mode_lib, struct dml2_mcache_surface_allocation *out, int plane_idx);
-void dml2_core_shared_get_mall_allocation(struct dml2_core_internal_display_mode_lib *mode_lib, unsigned int *out, int pipe_index);
-void dml2_core_shared_get_plane_support_info(const struct dml2_display_cfg *display_cfg, const struct dml2_core_internal_display_mode_lib *mode_lib, struct core_plane_support_info *out, int plane_idx);
-void dml2_core_shared_get_stream_support_info(const struct dml2_display_cfg *display_cfg, const struct dml2_core_internal_display_mode_lib *mode_lib, struct core_stream_support_info *out, int plane_index);
-void dml2_core_shared_get_informative(const struct dml2_core_internal_display_mode_lib *mode_lib, struct dml2_display_cfg_programming *out);
-void dml2_core_shared_cursor_dlg_reg(struct dml2_cursor_dlg_regs *cursor_dlg_regs, const struct dml2_get_cursor_dlg_reg *p);
-
-#endif
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared_types.h +19 -3
index 317008eff61b..13961c2eb634 100644
@@ -9,6 +9,15 @@
 #include "dml_top_display_cfg_types.h"
 #include "dml_top_types.h"
 
+#define __DML_VBA_DEBUG__
+#define __DML2_CALCS_MAX_VRATIO_PRE_OTO__ 4.0 //<brief max vratio for one-to-one prefetch bw scheduling
+#define __DML2_CALCS_MAX_VRATIO_PRE_EQU__ 6.0 //<brief max vratio for equalized prefetch bw scheduling
+#define __DML2_CALCS_MAX_VRATIO_PRE__ 8.0 //<brief max prefetch vratio register limit
+
+#define __DML2_CALCS_DPP_INVALID__ 0
+#define __DML2_CALCS_DCFCLK_FACTOR__ 1.15 //<brief fudge factor for min dcfclk calclation
+#define __DML2_CALCS_PIPE_NO_PLANE__ 99
+
 struct dml2_core_ip_params {
 	unsigned int vblank_nom_default_us;
 	unsigned int remote_iommu_outstanding_translations;
@@ -853,6 +862,9 @@ struct dml2_core_internal_SOCParametersList {
 	double USRRetrainingLatency;
 	double SMNLatency;
 	double g6_temp_read_blackout_us;
+	double max_urgent_latency_us;
+	double df_response_time_us;
+	enum dml2_qos_param_type qos_type;
 };
 
 struct dml2_core_calcs_mode_support_locals {
@@ -914,9 +926,7 @@ struct dml2_core_calcs_mode_support_locals {
 
 	double HostVMInefficiencyFactor;
 	double HostVMInefficiencyFactorPrefetch;
-	unsigned int NextMaxVStartup;
 	unsigned int MaxVStartup;
-	bool AnyLinesForVMOrRowTooLarge;
 	double PixelClockBackEndFactor;
 	unsigned int NumDSCUnitRequired;
 
@@ -1197,11 +1207,14 @@ struct dml2_core_calcs_CalculatePrefetchSchedule_locals {
 	double Tdmec;
 	double Tdmsks;
 	double prefetch_sw_bytes;
+	double total_row_bytes;
 	double prefetch_bw_pr;
 	double bytes_pp;
 	double dep_bytes;
 	double min_Lsw_oto;
+	double min_Lsw_equ;
 	double Tsw_est1;
+	double Tsw_est2;
 	double Tsw_est3;
 	double prefetch_bw1;
 	double prefetch_bw2;
@@ -1333,6 +1346,10 @@ struct dml2_core_shared_get_urgent_bandwidth_required_locals {
 	double tmp_nom_adj_factor_p1;
 	double tmp_pref_adj_factor_p0;
 	double tmp_pref_adj_factor_p1;
+	double vm_row_bw;
+	double flip_and_active_bw;
+	double flip_and_prefetch_bw;
+	double active_and_excess_bw;
 };
 
 struct dml2_core_shared_calculate_peak_bandwidth_required_locals {
@@ -1689,7 +1706,6 @@ struct dml2_core_calcs_CalculatePrefetchSchedule_params {
 	enum dml2_output_format_class OutputFormat;
 	unsigned int MaxInterDCNTileRepeaters;
 	unsigned int VStartup;
-	unsigned int MaxVStartup;
 	unsigned int HostVMMinPageSize;
 	bool DynamicMetadataEnable;
 	bool DynamicMetadataVMEnabled;
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.c new file +631 -0

631 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.h new file +39 -0
new file mode 100644
index 000000000000..a5cc6a07167a
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: MIT
+//
+// Copyright 2024 Advanced Micro Devices, Inc.
+
+#ifndef __DML2_CORE_UTILS_H__
+#define __DML2_CORE_UTILS_H__
+#include "dml2_internal_shared_types.h"
+#include "dml2_debug.h"
+#include "lib_float_math.h"
+
+double dml2_core_utils_div_rem(double dividend, unsigned int divisor, unsigned int *remainder);
+const char *dml2_core_utils_internal_bw_type_str(enum dml2_core_internal_bw_type bw_type);
+bool dml2_core_utils_is_420(enum dml2_source_format_class source_format);
+void dml2_core_utils_print_mode_support_info(const struct dml2_core_internal_mode_support_info *support, bool fail_only);
+const char *dml2_core_utils_internal_soc_state_type_str(enum dml2_core_internal_soc_state_type dml2_core_internal_soc_state_type);
+void dml2_core_utils_get_stream_output_bpp(double *out_bpp, const struct dml2_display_cfg *display_cfg);
+unsigned int dml2_core_utils_round_to_multiple(unsigned int num, unsigned int multiple, bool up);
+unsigned int dml2_core_util_get_num_active_pipes(int unsigned num_planes, const struct core_display_cfg_support_info *cfg_support_info);
+void dml2_core_utils_pipe_plane_mapping(const struct core_display_cfg_support_info *cfg_support_info, unsigned int *pipe_plane);
+bool dml2_core_utils_is_phantom_pipe(const struct dml2_plane_parameters *plane_cfg);
+unsigned int dml2_core_utils_get_tile_block_size_bytes(enum dml2_swizzle_mode sw_mode);
+bool dml2_core_utils_is_vertical_rotation(enum dml2_rotation_angle Scan);
+int unsigned dml2_core_utils_get_gfx_version(enum dml2_swizzle_mode sw_mode);
+unsigned int dml2_core_utils_get_qos_param_index(unsigned long uclk_freq_khz, const struct dml2_dcn4_uclk_dpm_dependent_qos_params *per_uclk_dpm_params);
+unsigned int dml2_core_utils_get_active_min_uclk_dpm_index(unsigned long uclk_freq_khz, const struct dml2_soc_state_table *clk_table);
+bool dml2_core_utils_is_dual_plane(enum dml2_source_format_class source_format);
+unsigned int dml2_core_utils_log_and_substract_if_non_zero(unsigned int a, unsigned int subtrahend);
+void dml2_core_utils_expand_implict_subvp(const struct display_configuation_with_meta *display_cfg, struct dml2_display_cfg *svp_expanded_display_cfg,
+	struct dml2_core_scratch *scratch);
+bool dml2_core_utils_is_stream_encoder_required(const struct dml2_stream_parameters *stream_descriptor);
+bool dml2_core_utils_is_encoder_dsc_capable(const struct dml2_stream_parameters *stream_descriptor);
+bool dml2_core_utils_is_dp_encoder(const struct dml2_stream_parameters *stream_descriptor);
+bool dml2_core_utils_is_dio_dp_encoder(const struct dml2_stream_parameters *stream_descriptor);
+bool dml2_core_utils_is_hpo_dp_encoder(const struct dml2_stream_parameters *stream_descriptor);
+bool dml2_core_utils_is_dp_8b_10b_link_rate(enum dml2_output_link_dp_rate rate);
+bool dml2_core_utils_is_dp_128b_132b_link_rate(enum dml2_output_link_dp_rate rate);
+bool dml2_core_utils_is_odm_split(enum dml2_odm_mode odm_mode);
+
+#endif /* __DML2_CORE_UTILS_H__ */
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c +41 -13

78 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.c +1 -1
index dfd01440737d..3861bc6c9621 100644
@@ -20,7 +20,7 @@ bool dml2_dpmm_create(enum dml2_project_id project_id, struct dml2_dpmm_instance
 {
 	bool result = false;
 
-	if (!out)
+	if (out == 0)
 		return false;
 
 	memset(out, 0, sizeof(struct dml2_dpmm_instance));
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c +12 -8
index 68b333b68933..30767f330fd4 100644
@@ -718,7 +718,7 @@ bool pmo_dcn4_fams2_init_for_vmin(struct dml2_pmo_init_for_vmin_in_out *in_out)
 	const struct dml2_core_mode_support_result *mode_support_result =
 			&in_out->base_display_config->mode_support_result;
 	struct dml2_optimization_stage4_state *state =
-			&in_out->base_display_config->stage4;
+				&in_out->base_display_config->stage4;
 
 	if (in_out->instance->options->disable_dyn_odm ||
 			(in_out->instance->options->disable_dyn_odm_for_multi_stream && display_config->num_streams > 1))
@@ -1444,7 +1444,7 @@ static bool stream_matches_drr_policy(struct dml2_pmo_instance *pmo,
 		/* DRR variable strategies are disallowed due to settings or policy */
 		strategy_matches_drr_requirements = false;
 	} else if (is_bit_set_in_bitfield(PMO_DRR_CLAMPED_STRATEGY_MASK, stream_pstate_method) &&
-			(pmo->options->disable_drr_clamped ||
+		(pmo->options->disable_drr_clamped ||
 			(!stream_descriptor->timing.drr_config.enabled ||
 			(!stream_descriptor->timing.drr_config.drr_active_fixed && !stream_descriptor->timing.drr_config.drr_active_variable)) ||
 			(pmo->options->disable_drr_clamped_when_var_active &&
@@ -1910,7 +1910,8 @@ static void setup_planes_for_vblank_by_mask(struct display_configuation_with_met
 		if (is_bit_set_in_bitfield(plane_mask, plane_index)) {
 			plane = &display_config->display_config.plane_descriptors[plane_index];
 
-			plane->overrides.reserved_vblank_time_ns = (long)(pmo->soc_bb->power_management_parameters.dram_clk_change_blackout_us * 1000);
+			plane->overrides.reserved_vblank_time_ns = (long)math_max2(pmo->soc_bb->power_management_parameters.dram_clk_change_blackout_us * 1000.0,
+					plane->overrides.reserved_vblank_time_ns);
 
 			display_config->stage3.pstate_switch_modes[plane_index] = dml2_uclk_pstate_support_method_vblank;
 
@@ -2196,15 +2197,15 @@ bool pmo_dcn4_fams2_test_for_stutter(struct dml2_pmo_test_for_stutter_in_out *in
 
 	unsigned int i;
 
-	for (i = 0; i < in_out->base_display_config->display_config.num_streams; i++) {
+	for (i = 0; i < in_out->base_display_config->display_config.num_planes; i++) {
 		if (pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us > 0 &&
 			pmo->scratch.pmo_dcn4.z8_vblank_optimizable &&
-			in_out->base_display_config->display_config.stream_descriptors[i].overrides.minimum_vblank_idle_requirement_us < (int)pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us) {
+			in_out->base_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns < (int)pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us * 1000) {
 			success = false;
 			break;
 		}
 		if (pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us > 0 &&
-			in_out->base_display_config->display_config.stream_descriptors[i].overrides.minimum_vblank_idle_requirement_us < (int)pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us) {
+			in_out->base_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns < (int)pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us * 1000) {
 			success = false;
 			break;
 		}
@@ -2223,8 +2224,11 @@ bool pmo_dcn4_fams2_optimize_for_stutter(struct dml2_pmo_optimize_for_stutter_in
 
 	if (!in_out->last_candidate_failed) {
 		if (pmo->scratch.pmo_dcn4.cur_stutter_candidate < pmo->scratch.pmo_dcn4.num_stutter_candidates) {
-			for (i = 0; i < in_out->optimized_display_config->display_config.num_streams; i++) {
-				in_out->optimized_display_config->display_config.stream_descriptors[i].overrides.minimum_vblank_idle_requirement_us = pmo->scratch.pmo_dcn4.optimal_vblank_reserved_time_for_stutter_us[pmo->scratch.pmo_dcn4.cur_stutter_candidate];
+			for (i = 0; i < in_out->optimized_display_config->display_config.num_planes; i++) {
+				/* take the max of the current and the optimal reserved time */
+				in_out->optimized_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns =
+						(long)math_max2(pmo->scratch.pmo_dcn4.optimal_vblank_reserved_time_for_stutter_us[pmo->scratch.pmo_dcn4.cur_stutter_candidate] * 1000,
+						in_out->optimized_display_config->display_config.plane_descriptors[i].overrides.reserved_vblank_time_ns);
 			}
 
 			success = true;
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_factory.c +1 -1
index 95f716e2641f..add51d41a515 100644
@@ -26,7 +26,7 @@ bool dml2_pmo_create(enum dml2_project_id project_id, struct dml2_pmo_instance *
 {
 	bool result = false;
 
-	if (!out)
+	if (out == 0)
 		return false;
 
 	memset(out, 0, sizeof(struct dml2_pmo_instance));
Signature · 1 line
2.34.1
#12 lore raw

PATCH 12/13 drm/amd/display: Fix a typo in revert commit

In reply to [email protected]

From: Fangzhi Zuo <[email protected]>

A typo is fixed for "drm/amd/display: Fix MST BW calculation Regression"

Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation Regression")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -1
index 958fad0d5307..5e08ca700c3f 100644
@@ -1066,7 +1066,7 @@ static int try_disable_dsc(struct drm_atomic_state *state,
 			vars[next_index].dsc_enabled = false;
 			vars[next_index].bpp_x16 = 0;
 		} else {
-			vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000);
+			vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000);
 			ret = drm_dp_atomic_find_time_slots(state,
 							    params[next_index].port->mgr,
 							    params[next_index].port,
Signature · 1 line
2.34.1
author Reviewed-by Tested-by Daniel Wheeler on v1 12/13
#13 lore raw

RE: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

[Public]

Wiil update commit message as:

-------------
drm/amd/display: Fix MST DSC lightup

[Why]
Secondary monitor does not come up due to MST DSC bw calculation regression.

[How]
Fix bug in try_disable_dsc()

Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation Regression")
Quoted 52 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Thursday, August 15, 2024 6:45 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Zuo, Jerry <[email protected]>
Subject: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

From: Fangzhi Zuo <[email protected]>

A typo is fixed for "drm/amd/display: Fix MST BW calculation Regression"

Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation

Regression")

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 958fad0d5307..5e08ca700c3f 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -1
@@ -1066,7 +1066,7 @@ static int try_disable_dsc(struct drm_atomic_state
 *state,
                      vars[next_index].dsc_enabled = false;
                      vars[next_index].bpp_x16 = 0;
              } else {
-                     vars[next_index].pbn =
 kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps,
 fec_overhead_multiplier_x1000);
+                     vars[next_index].pbn =

kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000);
ret = drm_dp_atomic_find_time_slots(state,

params[next_index].port->mgr,

params[next_index].port,
--
2.34.1

#14 lore raw

Re: RE: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

Quoted 9 lines · Roman

[Public]

Wiil update commit message as:

-------------
drm/amd/display: Fix MST DSC lightup

[Why]
Secondary monitor does not come up due to MST DSC bw calculation regression.

This patch is only related to this. It does not fix that issue on its own at all.

Quoted 2 lines

[How]
Fix bug in try_disable_dsc()

This update is worse than the original, IMO.

Could you write saner commit logs in the whole amdgpu overall?

If you insist on those [why] and [how] parts, something like:
"""
[Why]
The linked commit below misreverted one hunk in try_disable_dsc().

[How]
Fix that by using proper (original) 'max_kbps' instead of bogus 'stream_kbps'. ""

Quoted 6 lines
Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation Regression")

Care to fix up your machinery so that listed people are really CCed? I received a copy of neither the original (4b6564cb120c), nor this one.

Nor any mentions in the linked #3495 at all.

I would have told you that 4b6564cb120c is bogus. Immediately when it hit me as it differs from our (SUSE) in-tree revert in exactly this hunk. If I have known about this in the first place...

And you would have received a Tested-by if it had worked.

Given all the above, amdgpu workflow appears to be very ill. Please fix it.

Quoted 55 lines
Quoted 47 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Thursday, August 15, 2024 6:45 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Zuo, Jerry <[email protected]>
Subject: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

From: Fangzhi Zuo <[email protected]>

A typo is fixed for "drm/amd/display: Fix MST BW calculation Regression"

Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation

Regression")

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 958fad0d5307..5e08ca700c3f 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -1
@@ -1066,7 +1066,7 @@ static int try_disable_dsc(struct drm_atomic_state
 *state,
                       vars[next_index].dsc_enabled = false;
                       vars[next_index].bpp_x16 = 0;
               } else {
-                     vars[next_index].pbn =
 kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps,
 fec_overhead_multiplier_x1000);
+                     vars[next_index].pbn =

kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000);
ret = drm_dp_atomic_find_time_slots(state,

Quoted 3 lines
Quoted 3 lines

params[next_index].port->mgr,

params[next_index].port,

thanks,

Signature · 2 lines
js
suse labs
author
#15 lore raw

RE: RE: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

[Public]

Thank you, Jiri, for your feedback.
I've dropped this patch from DC v.3.2.297.
We will follow-up on this separately and merge it after you do confirm the issue you reported is fixed.

Thanks,
Roman

Quoted 130 lines

-----Original Message-----
From: Jiri Slaby <[email protected]>
Sent: Monday, August 19, 2024 4:37 AM
To: Li, Roman <[email protected]>; [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>
Subject: Re: RE: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

Quoted 9 lines · Roman

[Public]

Wiil update commit message as:

-------------
drm/amd/display: Fix MST DSC lightup

[Why]
Secondary monitor does not come up due to MST DSC bw calculation

regression.

This patch is only related to this. It does not fix that issue on its own at all.

Quoted 2 lines

[How]
Fix bug in try_disable_dsc()

This update is worse than the original, IMO.

Could you write saner commit logs in the whole amdgpu overall?

If you insist on those [why] and [how] parts, something like:
"""
[Why]
The linked commit below misreverted one hunk in try_disable_dsc().

[How]
Fix that by using proper (original) 'max_kbps' instead of bogus 'stream_kbps'. ""

Quoted 7 lines
Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation

Regression")

Care to fix up your machinery so that listed people are really CCed? I received a copy of neither the original (4b6564cb120c), nor this one.

Nor any mentions in the linked #3495 at all.

I would have told you that 4b6564cb120c is bogus. Immediately when it hit me as it differs from our (SUSE) in-tree revert in exactly this hunk. If I have known about this in the first place...

And you would have received a Tested-by if it had worked.

Given all the above, amdgpu workflow appears to be very ill. Please fix it.

Quoted 18 lines
Quoted 10 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Thursday, August 15, 2024 6:45 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>;

Mohamed,

Quoted 7 lines
Quoted 7 lines

Zaeem <[email protected]>; Zuo, Jerry <[email protected]>
Subject: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

From: Fangzhi Zuo <[email protected]>

A typo is fixed for "drm/amd/display: Fix MST BW calculation Regression"

Quoted 8 lines
Quoted 8 lines
Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation

Regression")

---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c |

2 +-

Quoted 7 lines
Quoted 7 lines
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 958fad0d5307..5e08ca700c3f 100644
---

a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Quoted 1 line
Quoted 1 line

+++

b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Quoted 13 lines
Quoted 13 lines
(quoted diff) +1 -1
@@ -1066,7 +1066,7 @@ static int try_disable_dsc(struct
 drm_atomic_state *state,
                       vars[next_index].dsc_enabled = false;
                       vars[next_index].bpp_x16 = 0;
               } else {
-                     vars[next_index].pbn =
 kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps,
 fec_overhead_multiplier_x1000);
+                     vars[next_index].pbn =

kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000);
ret = drm_dp_atomic_find_time_slots(state,

Quoted 3 lines
Quoted 3 lines

params[next_index].port->mgr,

params[next_index].port,

thanks,
--
js
suse labs

#16 lore raw

Re: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

Quoted 3 lines · Roman

Thank you, Jiri, for your feedback.
I've dropped this patch from DC v.3.2.297.
We will follow-up on this separately and merge it after you do confirm the issue you reported is fixed.

The patch is all fine and very welcome to be upstream as soon as possible. With this patch, it works as expected.

But the process is broken. Your and Fangzhi Zuo's send-email setup to the least.

BTW you write in the commit log:

Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation

Regression")

But:

$ git show 4b6564cb120c
fatal: ambiguous argument '4b6564cb120c': unknown revision or path not in the working tree.

Instead, it is:
commit 338567d17627064dba63cf063459605e782f71d2

Author: Fangzhi Zuo <[email protected]>
Date:   Mon Jul 29 10:23:03 2024 -0400

drm/amd/display: Fix MST BW calculation Regression

So apparently, someone in the process rebases the tree or something. Which is another breakage (non-reliable SHAs).

thanks,

Signature · 2 lines
js
suse labs
#17 lore raw

RE: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jiri:

Please kindly let me know the kernel branch you are using to validate the fix. I'll provide with two additional patches on top of ("drm/amd/display: Fix MST BW calculation Regression")

Regards,
Jerry

Quoted 52 lines

-----Original Message-----
From: Jiri Slaby <[email protected]>
Sent: Tuesday, August 20, 2024 12:49 AM
To: Li, Roman <[email protected]>; [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Limonciello, Mario <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

Quoted 3 lines · Roman

Thank you, Jiri, for your feedback.
I've dropped this patch from DC v.3.2.297.
We will follow-up on this separately and merge it after you do confirm the

issue you reported is fixed.

The patch is all fine and very welcome to be upstream as soon as possible. With this patch, it works as expected.

But the process is broken. Your and Fangzhi Zuo's send-email setup to the least.

BTW you write in the commit log:

Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation

Regression")

But:

$ git show 4b6564cb120c
fatal: ambiguous argument '4b6564cb120c': unknown revision or path not
in the working tree.

Instead, it is:
commit 338567d17627064dba63cf063459605e782f71d2

Author: Fangzhi Zuo <[email protected]>
Date:   Mon Jul 29 10:23:03 2024 -0400

drm/amd/display: Fix MST BW calculation Regression

So apparently, someone in the process rebases the tree or something. Which is another breakage (non-reliable SHAs).

thanks,
--
js
suse labs

#18 lore raw

Re: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

Quoted 5 lines · Jerry

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jiri:

Please kindly let me know the kernel branch you are using to validate the fix. I'll provide with two additional patches on top of ("drm/amd/display: Fix MST BW calculation Regression")

Hi,

whatever you prefer. E.g. even drm-next is fine here. Currently I run 6.10-stable plus the patch.

thanks,

Signature · 1 line
js
#19 lore raw

RE: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

In reply to Jiri Slaby

[Public]

Hi Jiri:

Please apply above two patches on top of latest https://gitlab.freedesktop.org/agd5f/linux/-/commits/amd-staging-drm-next, and give a sanity test on 4k60 over Lenovo HDMI output.

The patch posted in the gitlab forum has been broken down to below three patches:

"0001-drm-amd-display-Fix-MST-BW-calculation-Regression.patch" already merged to amd-staging-drm-next. "0002-drm-amd-display-Fix-a-mistake-in-revert-commit.patch" will be merged to amd-staging-drm-next after your validation.
"0003-drm-amd-display-Fix-Synaptics-Cascaded-DSC-Determina.patch" merged to amd-staging-drm-next this week.

Regards,
Jerry

Quoted 45 lines

-----Original Message-----
From: Jiri Slaby <[email protected]>
Sent: Tuesday, August 20, 2024 12:49 AM
To: Li, Roman <[email protected]>; [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Limonciello, Mario <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH 12/13] drm/amd/display: Fix a typo in revert commit

Quoted 3 lines · Roman

Thank you, Jiri, for your feedback.
I've dropped this patch from DC v.3.2.297.
We will follow-up on this separately and merge it after you do confirm the

issue you reported is fixed.

The patch is all fine and very welcome to be upstream as soon as possible. With this patch, it works as expected.

But the process is broken. Your and Fangzhi Zuo's send-email setup to the least.

BTW you write in the commit log:

Fixes 4b6564cb120c ("drm/amd/display: Fix MST BW calculation

Regression")

But:

$ git show 4b6564cb120c
fatal: ambiguous argument '4b6564cb120c': unknown revision or path not
in the working tree.

Instead, it is:
commit 338567d17627064dba63cf063459605e782f71d2

Author: Fangzhi Zuo <[email protected]>
Date:   Mon Jul 29 10:23:03 2024 -0400

drm/amd/display: Fix MST BW calculation Regression

Quoted 7 lines

So apparently, someone in the process rebases the tree or something. Which is another breakage (non-reliable SHAs).

thanks,
--
js
suse labs

From a0471f56da17944c9924087d93dbee764a822486 Mon Sep 17 00:00:00 2001
From: Fangzhi Zuo <[email protected]>
Date: Mon, 19 Aug 2024 13:43:00 -0400
Subject: [PATCH 1/2] drm/amd/display: Fix a mistake in revert commit

[why]
It is to fix in try_disable_dsc() due to misrevert patch of "drm/amd/display: Fix MST BW calculation Regression"

[How]
Fix restoring minimum compression bw by 'max_kbps', instead of native bw 'stream_kbps'

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -1
index 958fad0d5307..5e08ca700c3f 100644
@@ -1066,7 +1066,7 @@ static int try_disable_dsc(struct drm_atomic_state *state,
 			vars[next_index].dsc_enabled = false;
 			vars[next_index].bpp_x16 = 0;
 		} else {
-			vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000);
+			vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000);
 			ret = drm_dp_atomic_find_time_slots(state,
 							    params[next_index].port->mgr,
 							    params[next_index].port,
Signature · 1 line
2.34.1

From 962e981d9d2d9d55706648b86eca7761e0481892 Mon Sep 17 00:00:00 2001
From: Fangzhi Zuo <[email protected]>
Date: Mon, 19 Aug 2024 13:50:44 -0400
Subject: [PATCH 2/2] drm/amd/display: Fix Synaptics Cascaded DSC Determination

Synaptics Cascaded Panamera topology needs to unconditionally acquire root aux for dsc decoding.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -1
index 5e08ca700c3f..b77ecf3fb60c 100644
@@ -252,7 +252,7 @@ static bool validate_dsc_caps_on_connector(struct amdgpu_dm_connector *aconnecto
 		aconnector->dsc_aux = &aconnector->mst_root->dm_dp_aux.aux;
 
 	/* synaptics cascaded MST hub case */
-	if (!aconnector->dsc_aux && is_synaptics_cascaded_panamera(aconnector->dc_link, port))
+	if (is_synaptics_cascaded_panamera(aconnector->dc_link, port))
 		aconnector->dsc_aux = port->mgr->aux;
 
 	if (!aconnector->dsc_aux)
Signature · 1 line
2.34.1
#20 lore raw

PATCH 13/13 drm/amd/display: Promote DC to 3.2.297

In reply to [email protected]

From: Martin Leung <[email protected]>

- Various DML 2.1 fixes
- Fix MST Regression
- Fix module unload
- Fix construct_phy with MXM connector
- Support UHBR10 link rate on eDP
- Revert updated DCCG wrappers

---
 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 3de311533571..5bbc7d2daca6 100644
@@ -55,7 +55,7 @@ struct aux_payload;
 struct set_config_cmd_payload;
 struct dmub_notification;
 
-#define DC_VER "3.2.296"
+#define DC_VER "3.2.297"
 
 #define MAX_SURFACES 3
 #define MAX_PLANES 6
Signature · 1 line
2.34.1
Tested-by on the v1 series
#21 lore raw
In reply to [email protected]

[Public]

Hi all,

This week this patchset was tested on the following systems:
* Lenovo ThinkBook T13s Gen4 with AMD Ryzen 5 6600U
* MSI Gaming X Trio RX 6800
* Gigabyte Gaming OC RX 7900 XTX

These systems were tested on the following display/connection types:
* eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U])
* DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz, 4k 240hz [Includes USB-C to DP/HDMI adapters])
* Thunderbolt (LG Ultrafine 5k)
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60Hz displays)
* DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60 displays, and HP Hook G2 with 1 4k60 display)
* USB 4 (Kensington SD5700T and 1x 4k 60Hz display)
* PCON (Club3D CAC-1085 and 1x 4k 144Hz display [at 4k 120HZ, as that is the max the adapter supports])

The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
* Changing display configurations and settings
* Benchmark testing
* Feature testing (Freesync, etc.)

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

The patchset consists of the amd-staging-drm-next branch (Head commit - 982c225d4768ee1cbfb50c56b5560edca758dbfc -> drm/amdkfd: Add node_id to location_id generically) with new patches added on top of it.

Tested on Ubuntu 24.04.1, on Wayland and X11, using KDE Plasma and Gnome.

Thank you,

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

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Thursday, August 15, 2024 6:45 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Li, Roman <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 00/13] DC Patches August 15, 2024

From: Roman Li <[email protected]>

Cc Daniel Wheeler <[email protected]>

Aurabindo Pillai (1):
drm/amd/display: remove an extraneous call for checking dchub clock

Austin Zheng (1):
drm/amd/display: DML2.1 Reintegration for Various Fixes

Fangzhi Zuo (1):
drm/amd/display: Fix a typo in revert commit

Hansen Dsouza (1):
Revert "drm/amd/display: Update to using new dccg callbacks"

Ilya Bakoulin (1):
drm/amd/display: Fix construct_phy with MXM connector

Martin Leung (1):
drm/amd/display: Promote DC to 3.2.297

Michael Strauss (2):
drm/amd/display: Update HPO I/O When Handling Link Retrain Automation
Request
drm/amd/display: Allow UHBR Interop With eDP Supported Link Rates
Table

Nevenko Stupar (1):
drm/amd/display: Hardware cursor changes color when switched to
software cursor

Nicholas Susanto (2):
drm/amd/display: Remove redundant check in DCN35 hwseq drm/amd/display: DCN35 set min dispclk to 50Mhz

Sung Joon Kim (1):
drm/amd/display: Support UHBR10 link rate on eDP

Tim Huang (1):
drm/amd/display: fix double free issue during amdgpu module unload

 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   2 +-
 .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c  |   3 +
 .../gpu/drm/amd/display/dc/core/dc_resource.c |  18 +-
 drivers/gpu/drm/amd/display/dc/dc.h           |   3 +-
 .../amd/display/dc/dccg/dcn35/dcn35_dccg.c    |   4 +-
 drivers/gpu/drm/amd/display/dc/dml2/Makefile  |   3 -
 .../dml21/inc/bounding_boxes/dcn4_soc_bb.h    |   2 +-
 .../dml21/inc/dml_top_soc_parameter_types.h   |   1 +
 .../dml2/dml21/src/dml2_core/dml2_core_dcn4.c |   1 -
 .../src/dml2_core/dml2_core_dcn4_calcs.c      | 478 +++++++------
 .../dml21/src/dml2_core/dml2_core_factory.c   |   2 +-
 .../dml21/src/dml2_core/dml2_core_shared.h    |  37 -
 .../src/dml2_core/dml2_core_shared_types.h    |  22 +-
 .../dml21/src/dml2_core/dml2_core_utils.c     | 631 ++++++++++++++++++
 .../dml21/src/dml2_core/dml2_core_utils.h     |  39 ++
 .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c |  54 +-
 .../dml21/src/dml2_dpmm/dml2_dpmm_factory.c   |   2 +-
 .../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c  |  20 +-
 .../dml21/src/dml2_pmo/dml2_pmo_factory.c     |   2 +-
 .../amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c |   5 +-
 .../amd/display/dc/hwss/dce110/dce110_hwseq.c |  44 +-
 .../amd/display/dc/hwss/dcn31/dcn31_init.c    |   1 +
 .../amd/display/dc/hwss/dcn314/dcn314_init.c  |   1 +
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   |   3 -
 .../amd/display/dc/hwss/dcn351/dcn351_init.c  |   1 +
 .../drm/amd/display/dc/hwss/hw_sequencer.h    |   1 +
 drivers/gpu/drm/amd/display/dc/inc/resource.h |   2 +
 .../display/dc/link/accessories/link_dp_cts.c |   8 +
 .../drm/amd/display/dc/link/link_detection.c  |   3 +-
 .../gpu/drm/amd/display/dc/link/link_dpms.c   |   4 +-
 .../drm/amd/display/dc/link/link_factory.c    |   3 +-
 .../dc/link/protocols/link_dp_capability.c    |  59 +-
 .../link/protocols/link_edp_panel_control.c   |  14 +-
 .../link/protocols/link_edp_panel_control.h   |   2 +-
 .../dc/resource/dcn35/dcn35_resource.c        |   1 +
 35 files changed, 1110 insertions(+), 366 deletions(-)  delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.c
 create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.h

--
2.34.1