Skip to contentSkip to conversation

Fix issues caused by DML2 in ASICs older than DCN35

PATCH In review Rodrigo Siqueira 2 participants 5 messages Oct 20, 2023

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

v2 cover Fix issues caused by DML2 in ASICs older than DCN35

The first commit of this series just sets the variable using_dml2 to false for all ASICs that do not require it. The second commit adds a fix to the DC sequence that calls a DML2 operation in ASICs that does not use it.

Cc Vitaly Prosyak <[email protected]>
Cc Roman Li <[email protected]>
Cc Qingqing Zhuo <[email protected]>
Cc Daniel Wheeler <[email protected]>
Cc Alex Deucher <[email protected]>

Rodrigo Siqueira (2):
drm/amd/display: Set the DML2 attribute to false in all DCNs older
than version 3.5
drm/amd/display: Fix DMUB errors introduced by DML2

 drivers/gpu/drm/amd/display/dc/core/dc_resource.c       | 9 +++++----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 1 +
 14 files changed, 20 insertions(+), 6 deletions(-)
Signature · 1 line
2.42.0
#1 lore raw

PATCH v2 1/2 drm/amd/display: Set the DML2 attribute to false in all DCNs older than version 3.5

When DML2 was introduced, it targeted only new DCN versions. For controlling which ASIC should use this new version of DML, it was introduced the using_dml2 attribute. To avoid ambiguities, this commit explicitly sets using_dml2 to false in all ASICs that do not support DML2.

Cc Vitaly Prosyak <[email protected]>
Cc Roman Li <[email protected]>
Cc Qingqing Zhuo <[email protected]>
Cc Daniel Wheeler <[email protected]>
Cc Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 1 +
 13 files changed, 15 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +1 -0
index d1d8e904346e..b94c5c97eee7 100644
@@ -554,6 +554,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 		.max_downscale_src_width = 3840,
 		.underflow_assert_delay_us = 0xFFFFFFFF,
 		.enable_legacy_fast_update = true,
+		.using_dml2 = false,
 };
 
 static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -0
index 7eda4bbcd8ac..0a422fbb14bc 100644
@@ -723,6 +723,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 		.sanity_checks = false,
 		.underflow_assert_delay_us = 0xFFFFFFFF,
 		.enable_legacy_fast_update = true,
+		.using_dml2 = false,
 };
 
 void dcn20_dpp_destroy(struct dpp **dpp)
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +1 -0
index a11b2f6afe4a..bca22d867696 100644
@@ -614,6 +614,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 		.underflow_assert_delay_us = 0xFFFFFFFF,
 		.enable_tri_buf = false,
 		.enable_legacy_fast_update = true,
+		.using_dml2 = false,
 };
 
 static void dcn201_dpp_destroy(struct dpp **dpp)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -0
index 58a0d37e9523..42277b280586 100644
@@ -654,6 +654,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 		.dmub_command_table = true,
 		.use_max_lb = true,
 		.enable_legacy_fast_update = true,
+		.using_dml2 = false,
 };
 
 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1 -0
index 473581cff06b..7b259cb5f418 100644
@@ -729,6 +729,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 	.use_max_lb = true,
 	.exit_idle_opt_for_cursor_updates = true,
 	.enable_legacy_fast_update = false,
+	.using_dml2 = false,
 };
 
 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +2 -1
index b4b3b52990b9..f3b75f283aa2 100644
@@ -701,7 +701,8 @@ static const struct dc_debug_options debug_defaults_drv = {
 	.dwb_fi_phase = -1, // -1 = disable
 	.dmub_command_table = true,
 	.use_max_lb = false,
-	.exit_idle_opt_for_cursor_updates = true
+	.exit_idle_opt_for_cursor_updates = true,
+	.using_dml2 = false,
 };
 
 static void dcn301_dpp_destroy(struct dpp **dpp)
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +1 -0
index 06332bd4e625..63ac984a04f7 100644
@@ -99,6 +99,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 		.use_max_lb = true,
 		.exit_idle_opt_for_cursor_updates = true,
 		.enable_legacy_fast_update = false,
+		.using_dml2 = false,
 };
 
 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c +1 -0
index 0d91291a54a9..3f0b52f50d93 100644
@@ -81,6 +81,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 		.dmub_command_table = true,
 		.exit_idle_opt_for_cursor_updates = true,
 		.disable_idle_power_optimizations = false,
+		.using_dml2 = false,
 };
 
 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1 -0
index cdf005f91869..79416cfb22f0 100644
@@ -893,6 +893,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 	.enable_legacy_fast_update = true,
 	.enable_z9_disable_interface = true, /* Allow support for the PMFW interface for disable Z9*/
 	.dml_hostvm_override = DML_HOSTVM_OVERRIDE_FALSE,
+	.using_dml2 = false,
 };
 
 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +2 -1
index 2d7436f2ea82..ab301ea7c10b 100644
@@ -924,7 +924,8 @@ static const struct dc_debug_options debug_defaults_drv = {
 			}
 	},
 
-	.seamless_boot_odm_combine = true
+	.seamless_boot_odm_combine = true,
+	.using_dml2 = false,
 };
 
 static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c +1 -0
index c11dbb1f4033..cb8024eee8e4 100644
@@ -889,6 +889,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 	},
 	.enable_legacy_fast_update = true,
 	.psr_power_use_phy_fsm = 0,
+	.using_dml2 = false,
 };
 
 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c +1 -0
index 4220fe4cae4a..b9753d4606f8 100644
@@ -885,6 +885,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 		}
 	},
 	.enable_legacy_fast_update = true,
+	.using_dml2 = false,
 };
 
 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 -0
index 44caf6711589..0b1ce6e28e11 100644
@@ -732,6 +732,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 	.fpo_vactive_max_blank_us = 1000,
 	.enable_legacy_fast_update = false,
 	.disable_dc_mode_overwrite = true,
+	.using_dml2 = false,
 };
 
 static struct dce_aux *dcn321_aux_engine_create(
Signature · 1 line
2.42.0
#2 lore raw

PATCH v2 2/2 drm/amd/display: Fix DMUB errors introduced by DML2

In reply to Rodrigo Siqueira

When DML 2 was introduced, it changed part of the generic sequence of DC, which caused issues on previous DCNs with DMUB support. This commit ensures the new sequence only works for new DCNs from 3.5 and above.

Changes since V1:
- Harry: Use the attribute using_dml2 instead of check the DCN version.

Cc Vitaly Prosyak <[email protected]>
Cc Roman Li <[email protected]>
Cc Qingqing Zhuo <[email protected]>
Cc Daniel Wheeler <[email protected]>
Cc Alex Deucher <[email protected]>
Fixes 7966f319c66d ("drm/amd/display: Introduce DML2")
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +5 -4
index 97f402123fbb..f9e472f08e21 100644
@@ -321,10 +321,11 @@ 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 (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);
+			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.42.0
maintainer Reviewed-by on the v2 series
#3 lore raw
In reply to Rodrigo Siqueira
Quoted 11 lines · Rodrigo Siqueira

The first commit of this series just sets the variable using_dml2 to false for all ASICs that do not require it. The second commit adds a fix to the DC sequence that calls a DML2 operation in ASICs that does not use it.

Cc Vitaly Prosyak <[email protected]>
Cc Roman Li <[email protected]>
Cc Qingqing Zhuo <[email protected]>
Cc Daniel Wheeler <[email protected]>
Cc Alex Deucher <[email protected]>

Didn't realize this would make the change much bigger but I think it'll be more consistent in the long-term.

Harry

Quoted 21 lines

Rodrigo Siqueira (2):
drm/amd/display: Set the DML2 attribute to false in all DCNs older
than version 3.5
drm/amd/display: Fix DMUB errors introduced by DML2

 drivers/gpu/drm/amd/display/dc/core/dc_resource.c       | 9 +++++----
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 1 +
 14 files changed, 20 insertions(+), 6 deletions(-)
#4 lore raw
Quoted 13 lines · Harry Wentland
Quoted 11 lines · Rodrigo Siqueira

The first commit of this series just sets the variable using_dml2 to false for all ASICs that do not require it. The second commit adds a fix to the DC sequence that calls a DML2 operation in ASICs that does not use it.

Cc Vitaly Prosyak <[email protected]>
Cc Roman Li <[email protected]>
Cc Qingqing Zhuo <[email protected]>
Cc Daniel Wheeler <[email protected]>
Cc Alex Deucher <[email protected]>
Quoted 4 lines

Didn't realize this would make the change much bigger but I think it'll be more consistent in the long-term.

Thanks Harry

Quoted 25 lines

Harry

Quoted 21 lines

Rodrigo Siqueira (2):
drm/amd/display: Set the DML2 attribute to false in all DCNs older
than version 3.5
drm/amd/display: Fix DMUB errors introduced by DML2

  drivers/gpu/drm/amd/display/dc/core/dc_resource.c       | 9 +++++----
  drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c   | 1 +
  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c   | 1 +
  drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 1 +
  drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c   | 1 +
  drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c   | 1 +
  drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 3 ++-
  drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 1 +
  drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 1 +
  drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c   | 1 +
  drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 3 ++-
  drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 1 +
  drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c | 1 +
  drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 1 +
  14 files changed, 20 insertions(+), 6 deletions(-)