Skip to contentSkip to conversation

drm/amd: Delete defunct DAL power level code

PATCH In review Timur Kristóf 2 participants 37 messages Apr 23 – Apr 30

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

cover drm/amd: Delete defunct DAL power level code

Delete unused code related to DAL power levels. It seems that the DAL power level concept has been never fully implemented and was thus non-functional in amdgpu.

DCE 11.0 and 11.2 never actually relied on the power level because they calculate all necessary power requirements in dce_calcs and communicate that using dm_pp_apply_display_requirements() to the power management code.

DCE 6, 8 and 10 also didn't rely on power levels because they always just set the maximum possible display clock and the power management code already takes that into account when setting the power state. This was somewhat improved recently by also using dm_pp_apply_display_requirements() on these DCE versions.

The code base for newer GPUs doesn't use the concept of power levels anymore either, so this change reduces the maintenance burden of the old DCE code.

On the DC side:

dm_pp_apply_power_level_change_request() was never implemented in amdgpu_dm, and DC has been working fine for years without it. Let's delete the dummy function and the code that calls it.

With that, we can also delete the power levels and the static arrays containing hardcoded power level values. These were never used for anything, only for finding the maximum supported display clock.

On the AMDGPU PM side:

The get_dal_power_level() implementations were dummy on SMU10, Vega10, Vega12 and Vega20 meaning that they didn't return an actual DAL power level, and were non-functional on SMU8 which always returned the highest possible power level. Nothing actually relied on the power level returned by these functions. Let's delete them.

What's next:

After this code cleanup lands, I have plans to further improve display power management on old DCE.

Timur Kristóf (14):
drm/amd/display: Delete unimplemented
dm_pp_apply_power_level_change_request()
drm/amd/display: Delete dce_get_required_clocks_state() drm/amd/display: Remove min/max clock levels from clk_mgr drm/amd/display: Delete max_clocks_state from dm_pp_static_clock_info drm/amd/display: Set max supported display clock without
max_clks_by_state
drm/amd/display: Delete max_clks_by_state from DCE clock manager drm/amd/display: Delete disp_clk_voltage from integrated info drm/amd/display: Delete dm_pp_clocks_state
drm/amd/pm: Delete unused get_display_power_level() function drm/amd/pm: Delete dummy get_dal_power_level implementations drm/amd/pm: Delete non-functional SMU8 get_dal_power_level
implementation
drm/amd/pm: Delete vddc_dep_on_dal_pwrl
drm/amd/pm: Delete get_dal_power_level
drm/amd/pm: Delete PP_DAL_POWERLEVEL

 .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  |  39 -----
 .../gpu/drm/amd/display/dc/bios/bios_parser.c |  36 -----
 .../drm/amd/display/dc/bios/bios_parser2.c    |   9 --
 .../display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 144 ++----------------
 .../display/dc/clk_mgr/dce100/dce_clk_mgr.h   |   3 -
 .../dc/clk_mgr/dce110/dce110_clk_mgr.c        |  25 ---
 .../dc/clk_mgr/dce112/dce112_clk_mgr.c        |  41 -----
 .../dc/clk_mgr/dce120/dce120_clk_mgr.c        |  16 --
 drivers/gpu/drm/amd/display/dc/dm_services.h  |   4 -
 .../drm/amd/display/dc/dm_services_types.h    |  30 ----
 .../amd/display/dc/inc/hw/clk_mgr_internal.h  |   4 -
 .../display/include/grph_object_ctrl_defs.h   |   9 --
 drivers/gpu/drm/amd/include/dm_pp_interface.h |  19 ---
 .../gpu/drm/amd/include/kgd_pp_interface.h    |   2 -
 .../gpu/drm/amd/pm/powerplay/amd_powerplay.c  |  22 ---
 .../amd/pm/powerplay/hwmgr/hardwaremanager.c  |  10 --
 .../amd/pm/powerplay/hwmgr/processpptables.c  |   1 -
 .../drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c  |  48 ------
 .../drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c   |  64 --------
 .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c |  18 ---
 .../drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c |  16 --
 .../drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c |  17 ---
 .../amd/pm/powerplay/inc/hardwaremanager.h    |   3 -
 drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h  |   4 -
 24 files changed, 11 insertions(+), 573 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/14 drm/amd/display: Delete unimplemented dm_pp_apply_power_level_change_request()

dm_pp_apply_power_level_change_request() was called from old DCE clock manager implementations on DCE6, 8, 10, 11.2 but has not been implemented ever since the beginning of DC.

Affected GPUs have been working fine without that implementation for many years. Let's delete it now.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 8 --------
 .../gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c  | 9 ---------
 .../drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c   | 9 ---------
 .../drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c   | 9 ---------
 drivers/gpu/drm/amd/display/dc/dm_services.h             | 4 ----
 5 files changed, 39 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -8
index 11b2ea6edf953..17f42201ab862 100644
@@ -417,14 +417,6 @@ bool dm_pp_notify_wm_clock_changes(
 	return false;
 }
 
-bool dm_pp_apply_power_level_change_request(
-	const struct dc_context *ctx,
-	struct dm_pp_power_level_change_request *level_change_req)
-{
-	/* TODO: to be implemented */
-	return false;
-}
-
 bool dm_pp_apply_clock_for_voltage_request(
 	const struct dc_context *ctx,
 	struct dm_pp_clock_for_voltage_req *clock_for_voltage_req)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -9
index 6d41df52d7c9b..ffb70120362e7 100644
@@ -431,19 +431,10 @@ static void dce_update_clocks(struct clk_mgr *clk_mgr_base,
 			bool safe_to_lower)
 {
 	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
 	const int max_disp_clk =
 		clk_mgr_dce->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
 	int patched_disp_clk = MIN(max_disp_clk, context->bw_ctx.bw.dce.dispclk_khz);
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
 	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
 		patched_disp_clk = dce_set_clock(clk_mgr_base, patched_disp_clk);
 		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +0 -9
index 13296c6ec08f4..ae922f1a31ff8 100644
@@ -257,21 +257,12 @@ static void dce11_update_clocks(struct clk_mgr *clk_mgr_base,
 			bool safe_to_lower)
 {
 	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
 	int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
 
 	/*TODO: W/A for dal3 linux, investigate why this works */
 	if (!clk_mgr_dce->dfs_bypass_active)
 		patched_disp_clk = patched_disp_clk * 115 / 100;
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
 	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
 		context->bw_ctx.bw.dce.dispclk_khz = dce_set_clock(clk_mgr_base, patched_disp_clk);
 		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -9
index 1f36ad8a7de46..48393c69735b6 100644
@@ -193,21 +193,12 @@ static void dce112_update_clocks(struct clk_mgr *clk_mgr_base,
 			bool safe_to_lower)
 {
 	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
 	int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
 
 	/*TODO: W/A for dal3 linux, investigate why this works */
 	if (!clk_mgr_dce->dfs_bypass_active)
 		patched_disp_clk = patched_disp_clk * 115 / 100;
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
 	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
 		patched_disp_clk = dce112_set_clock(clk_mgr_base, patched_disp_clk);
 		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/dm_services.h +0 -4
index fbbf9c757b3c3..1395d36bfabe9 100644
@@ -224,10 +224,6 @@ bool dm_pp_apply_display_requirements(
 	const struct dc_context *ctx,
 	const struct dm_pp_display_configuration *pp_display_cfg);
 
-bool dm_pp_apply_power_level_change_request(
-	const struct dc_context *ctx,
-	struct dm_pp_power_level_change_request *level_change_req);
-
 bool dm_pp_apply_clock_for_voltage_request(
 	const struct dc_context *ctx,
 	struct dm_pp_clock_for_voltage_req *clock_for_voltage_req);
Signature · 1 line
2.53.0
#2 lore raw

Re: [PATCH 01/14] drm/amd/display: Delete unimplemented dm_pp_apply_power_level_change_request()

Quoted 21 lines · Timur Kristóf

dm_pp_apply_power_level_change_request() was called from old DCE clock manager implementations on DCE6, 8, 10, 11.2 but has not been implemented ever since the beginning of DC.

Affected GPUs have been working fine without that implementation for many years. Let's delete it now.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 8 --------
  .../gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c  | 9 ---------
  .../drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c   | 9 ---------
  .../drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c   | 9 ---------
  drivers/gpu/drm/amd/display/dc/dm_services.h             | 4 ----
  5 files changed, 39 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -0
index 11b2ea6edf953..17f42201ab862 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c bool dm_pp_notify_wm_clock_changes( · line 422

Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -3
@@ -417,14 +417,6 @@ bool dm_pp_notify_wm_clock_changes(
  	return false;
  }
 
-bool dm_pp_apply_power_level_change_request(
-	const struct dc_context *ctx,
-	struct dm_pp_power_level_change_request *level_change_req)

Hi Timur,

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c bool dm_pp_notify_wm_clock_changes( · line 424

Quoted 2 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -2
-{
-	/* TODO: to be implemented */

I feel a little uneasy about removing all this infrastructure with this series, as AFAIU, it could be avoided by implementing this TODO (?) Any idea if AMD has this code somewhere that could be upstreamed, or did it end up in the firmware?

BTW, Looks like struct dm_pp_power_level_change_request also becomes unused with this change, right?

Melissa

Quoted 97 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -3
-	return false;
-}
-
  bool dm_pp_apply_clock_for_voltage_request(
  	const struct dc_context *ctx,
  	struct dm_pp_clock_for_voltage_req *clock_for_voltage_req)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -9
index 6d41df52d7c9b..ffb70120362e7 100644
@@ -431,19 +431,10 @@ static void dce_update_clocks(struct clk_mgr *clk_mgr_base,
  			bool safe_to_lower)
  {
  	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
  	const int max_disp_clk =
  		clk_mgr_dce->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
  	int patched_disp_clk = MIN(max_disp_clk, context->bw_ctx.bw.dce.dispclk_khz);
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
  	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
  		patched_disp_clk = dce_set_clock(clk_mgr_base, patched_disp_clk);
  		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +0 -9
index 13296c6ec08f4..ae922f1a31ff8 100644
@@ -257,21 +257,12 @@ static void dce11_update_clocks(struct clk_mgr *clk_mgr_base,
  			bool safe_to_lower)
  {
  	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
  	int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
 
  	/*TODO: W/A for dal3 linux, investigate why this works */
  	if (!clk_mgr_dce->dfs_bypass_active)
  		patched_disp_clk = patched_disp_clk * 115 / 100;
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
  	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
  		context->bw_ctx.bw.dce.dispclk_khz = dce_set_clock(clk_mgr_base, patched_disp_clk);
  		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -9
index 1f36ad8a7de46..48393c69735b6 100644
@@ -193,21 +193,12 @@ static void dce112_update_clocks(struct clk_mgr *clk_mgr_base,
  			bool safe_to_lower)
  {
  	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
  	int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
 
  	/*TODO: W/A for dal3 linux, investigate why this works */
  	if (!clk_mgr_dce->dfs_bypass_active)
  		patched_disp_clk = patched_disp_clk * 115 / 100;
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
  	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
  		patched_disp_clk = dce112_set_clock(clk_mgr_base, patched_disp_clk);
  		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/dm_services.h +0 -4
index fbbf9c757b3c3..1395d36bfabe9 100644
@@ -224,10 +224,6 @@ bool dm_pp_apply_display_requirements(
  	const struct dc_context *ctx,
  	const struct dm_pp_display_configuration *pp_display_cfg);
 
-bool dm_pp_apply_power_level_change_request(
-	const struct dc_context *ctx,
-	struct dm_pp_power_level_change_request *level_change_req);
-
  bool dm_pp_apply_clock_for_voltage_request(
  	const struct dc_context *ctx,
  	struct dm_pp_clock_for_voltage_req *clock_for_voltage_req);
#3 lore raw

Re: [PATCH 01/14] drm/amd/display: Delete unimplemented dm_pp_apply_power_level_change_request()

Quoted 35 lines · Central European Summer Time Melissa Wen
Quoted 23 lines · Timur Kristóf

dm_pp_apply_power_level_change_request() was called from old DCE clock manager implementations on DCE6, 8, 10, 11.2 but has not been implemented ever since the beginning of DC.

Affected GPUs have been working fine without that implementation for many years. Let's delete it now.

---

  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 8 --------
  .../gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c  | 9 ---------
  .../drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c   | 9 ---------
  .../drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c   | 9 ---------
  drivers/gpu/drm/amd/display/dc/dm_services.h             | 4 ----
  5 files changed, 39 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c index 11b2ea6edf953..17f42201ab862 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c bool dm_pp_notify_wm_clock_changes( · line 424

Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -3
@@ -417,14 +417,6 @@ bool dm_pp_notify_wm_clock_changes(
 
  	return false;
 
  }
 
-bool dm_pp_apply_power_level_change_request(
-	const struct dc_context *ctx,
-	struct dm_pp_power_level_change_request *level_change_req)

Hi Timur,

Quoted 7 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c bool dm_pp_notify_wm_clock_changes( · line 424

Quoted 2 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -2
-{
-	/* TODO: to be implemented */

I feel a little uneasy about removing all this infrastructure with this series, as AFAIU, it could be avoided by implementing this TODO (?) Any idea if AMD has this code somewhere that could be upstreamed, or did it end up in the firmware?

The display power requirements are already implemented in a different way. Here how it works:

1. We have dce_pplib_apply_display_requirements() to communicate the display power requirements to the power management code.
2. In the power management code, we have display_configuration_change() and pm_compute_clocks() that take care of the display power requirements.

Note that on DCE 6, 8, 10, currently DC always just sets the maximum possible clock, and it works fine. On DCE 11 and 11.2, we rely on dce_calcs so we don't need a DAL power level there either.

As far as I understand, the DAL power levels were a concept from the old Windows driver for these GPUs and were never really implemented in Linux. The newest affected GPU is about 10 years old by now and it has been working fine on Linux all these years without dm_pp_apply_power_level_change_request().

Side note: after this cleanup series lands, I plan to improve the situation and implement dm_pp_apply_clock_for_voltage_request() for these GPUs to match what we are doing on DCE 12.

Quoted 3 lines

BTW, Looks like struct dm_pp_power_level_change_request also becomes unused with this change, right?

Yes, that's right. It is removed in a subsequent commit.

Quoted 30 lines

Melissa

Quoted 27 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -3
-	return false;
-}
-
 

bool dm_pp_apply_clock_for_voltage_request(

const struct dc_context *ctx,
struct dm_pp_clock_for_voltage_req *clock_for_voltage_req)

(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c index 6d41df52d7c9b..ffb70120362e7 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
@@ -431,19 +431,10 @@ static void dce_update_clocks(struct clk_mgr
 *clk_mgr_base,> 
  			bool safe_to_lower)
 
  {
 
  	struct clk_mgr_internal *clk_mgr_dce =
  	TO_CLK_MGR_INTERNAL(clk_mgr_base);
 
-	struct dm_pp_power_level_change_request level_change_req;
 
  	const int max_disp_clk =
Quoted 7 lines
Quoted 1 line

clk_mgr_dce-

max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display

Quoted 5 lines

_clk_khz;>
int patched_disp_clk = MIN(max_disp_clk,
context->bw_ctx.bw.dce.dispclk_khz);>

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-	level_change_req.power_level =

dce_get_required_clocks_state(clk_mgr_base, context); - /* get max

clock

Quoted 4 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c

Quoted 2 lines

state from PPLIB */

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-	if ((level_change_req.power_level < clk_mgr_dce-

cur_min_clks_state &&

Quoted 1 line

safe_to_lower) - ||

level_change_req.power_level >

Quoted 10 lines
Quoted 3 lines

clk_mgr_dce->cur_min_clks_state) { - if
(dm_pp_apply_power_level_change_request(clk_mgr_base->ctx,
&level_change_req)) - clk_mgr_dce-

cur_min_clks_state =

Quoted 6 lines

level_change_req.power_level; - }
-

if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {>
patched_disp_clk = dce_set_clock(clk_mgr_base,

patched_disp_clk);

Quoted 21 lines
Quoted 21 lines
  		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c index 13296c6ec08f4..ae922f1a31ff8 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +0 -1
@@ -257,21 +257,12 @@ static void dce11_update_clocks(struct clk_mgr
 *clk_mgr_base,> 
  			bool safe_to_lower)
 
  {
 
  	struct clk_mgr_internal *clk_mgr_dce =
  	TO_CLK_MGR_INTERNAL(clk_mgr_base);
 
-	struct dm_pp_power_level_change_request level_change_req;
 
  	int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
 
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +0 -1
  	/*TODO: W/A for dal3 linux, investigate why this works */
  	if (!clk_mgr_dce->dfs_bypass_active)
 
  		patched_disp_clk = patched_disp_clk * 115 / 100;
 
-	level_change_req.power_level =

dce_get_required_clocks_state(clk_mgr_base, context); - /* get max

clock

Quoted 4 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c

Quoted 2 lines

state from PPLIB */

drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +0 -1
-	if ((level_change_req.power_level < clk_mgr_dce-

cur_min_clks_state &&

Quoted 1 line

safe_to_lower) - ||

level_change_req.power_level >

Quoted 10 lines
Quoted 3 lines

clk_mgr_dce->cur_min_clks_state) { - if
(dm_pp_apply_power_level_change_request(clk_mgr_base->ctx,
&level_change_req)) - clk_mgr_dce-

cur_min_clks_state =

Quoted 6 lines

level_change_req.power_level; - }
-

if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {>
context->bw_ctx.bw.dce.dispclk_khz =

dce_set_clock(clk_mgr_base,

Quoted 1 line
Quoted 1 line

patched_disp_clk); clk_mgr_base->clks.dispclk_khz =

patched_disp_clk;

Quoted 20 lines
Quoted 20 lines

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c index 1f36ad8a7de46..48393c69735b6 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -1
@@ -193,21 +193,12 @@ static void dce112_update_clocks(struct clk_mgr
 *clk_mgr_base,> 
  			bool safe_to_lower)
 
  {
 
  	struct clk_mgr_internal *clk_mgr_dce =
  	TO_CLK_MGR_INTERNAL(clk_mgr_base);
 
-	struct dm_pp_power_level_change_request level_change_req;
 
  	int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
 
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -1
  	/*TODO: W/A for dal3 linux, investigate why this works */
  	if (!clk_mgr_dce->dfs_bypass_active)
 
  		patched_disp_clk = patched_disp_clk * 115 / 100;
 
-	level_change_req.power_level =

dce_get_required_clocks_state(clk_mgr_base, context); - /* get max

clock

Quoted 4 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c

Quoted 2 lines

state from PPLIB */

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -1
-	if ((level_change_req.power_level < clk_mgr_dce-

cur_min_clks_state &&

Quoted 1 line

safe_to_lower) - ||

level_change_req.power_level >

Quoted 10 lines
Quoted 3 lines

clk_mgr_dce->cur_min_clks_state) { - if
(dm_pp_apply_power_level_change_request(clk_mgr_base->ctx,
&level_change_req)) - clk_mgr_dce-

cur_min_clks_state =

Quoted 6 lines

level_change_req.power_level; - }
-

if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {>
patched_disp_clk = dce112_set_clock(clk_mgr_base,

patched_disp_clk);

Quoted 21 lines
Quoted 21 lines
  		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/dm_services.h index fbbf9c757b3c3..1395d36bfabe9 100644

drivers/gpu/drm/amd/display/dc/dm_services.h +0 -4
@@ -224,10 +224,6 @@ bool dm_pp_apply_display_requirements(
 
  	const struct dc_context *ctx,
  	const struct dm_pp_display_configuration *pp_display_cfg);
 
-bool dm_pp_apply_power_level_change_request(
-	const struct dc_context *ctx,
-	struct dm_pp_power_level_change_request *level_change_req);
-
 
  bool dm_pp_apply_clock_for_voltage_request(

const struct dc_context *ctx,
struct dm_pp_clock_for_voltage_req *clock_for_voltage_req);

Reviewed-by on v1 1/14
#4 lore raw

Re: [PATCH 01/14] drm/amd/display: Delete unimplemented dm_pp_apply_power_level_change_request()

In reply to Timur Kristóf
Quoted 6 lines · Timur Kristóf

dm_pp_apply_power_level_change_request() was called from old DCE clock manager implementations on DCE6, 8, 10, 11.2 but has not been implemented ever since the beginning of DC.

Affected GPUs have been working fine without that implementation for many years. Let's delete it now.

Quoted 120 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 8 --------
  .../gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c  | 9 ---------
  .../drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c   | 9 ---------
  .../drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c   | 9 ---------
  drivers/gpu/drm/amd/display/dc/dm_services.h             | 4 ----
  5 files changed, 39 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -8
index 11b2ea6edf953..17f42201ab862 100644
@@ -417,14 +417,6 @@ bool dm_pp_notify_wm_clock_changes(
  	return false;
  }
 
-bool dm_pp_apply_power_level_change_request(
-	const struct dc_context *ctx,
-	struct dm_pp_power_level_change_request *level_change_req)
-{
-	/* TODO: to be implemented */
-	return false;
-}
-
  bool dm_pp_apply_clock_for_voltage_request(
  	const struct dc_context *ctx,
  	struct dm_pp_clock_for_voltage_req *clock_for_voltage_req)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -9
index 6d41df52d7c9b..ffb70120362e7 100644
@@ -431,19 +431,10 @@ static void dce_update_clocks(struct clk_mgr *clk_mgr_base,
  			bool safe_to_lower)
  {
  	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
  	const int max_disp_clk =
  		clk_mgr_dce->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
  	int patched_disp_clk = MIN(max_disp_clk, context->bw_ctx.bw.dce.dispclk_khz);
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
  	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
  		patched_disp_clk = dce_set_clock(clk_mgr_base, patched_disp_clk);
  		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +0 -9
index 13296c6ec08f4..ae922f1a31ff8 100644
@@ -257,21 +257,12 @@ static void dce11_update_clocks(struct clk_mgr *clk_mgr_base,
  			bool safe_to_lower)
  {
  	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
  	int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
 
  	/*TODO: W/A for dal3 linux, investigate why this works */
  	if (!clk_mgr_dce->dfs_bypass_active)
  		patched_disp_clk = patched_disp_clk * 115 / 100;
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
  	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
  		context->bw_ctx.bw.dce.dispclk_khz = dce_set_clock(clk_mgr_base, patched_disp_clk);
  		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -9
index 1f36ad8a7de46..48393c69735b6 100644
@@ -193,21 +193,12 @@ static void dce112_update_clocks(struct clk_mgr *clk_mgr_base,
  			bool safe_to_lower)
  {
  	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	struct dm_pp_power_level_change_request level_change_req;
  	int patched_disp_clk = context->bw_ctx.bw.dce.dispclk_khz;
 
  	/*TODO: W/A for dal3 linux, investigate why this works */
  	if (!clk_mgr_dce->dfs_bypass_active)
  		patched_disp_clk = patched_disp_clk * 115 / 100;
 
-	level_change_req.power_level = dce_get_required_clocks_state(clk_mgr_base, context);
-	/* get max clock state from PPLIB */
-	if ((level_change_req.power_level < clk_mgr_dce->cur_min_clks_state && safe_to_lower)
-			|| level_change_req.power_level > clk_mgr_dce->cur_min_clks_state) {
-		if (dm_pp_apply_power_level_change_request(clk_mgr_base->ctx, &level_change_req))
-			clk_mgr_dce->cur_min_clks_state = level_change_req.power_level;
-	}
-
  	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
  		patched_disp_clk = dce112_set_clock(clk_mgr_base, patched_disp_clk);
  		clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
drivers/gpu/drm/amd/display/dc/dm_services.h +0 -4
index fbbf9c757b3c3..1395d36bfabe9 100644
@@ -224,10 +224,6 @@ bool dm_pp_apply_display_requirements(
  	const struct dc_context *ctx,
  	const struct dm_pp_display_configuration *pp_display_cfg);
 
-bool dm_pp_apply_power_level_change_request(
-	const struct dc_context *ctx,
-	struct dm_pp_power_level_change_request *level_change_req);
-
  bool dm_pp_apply_clock_for_voltage_request(
  	const struct dc_context *ctx,
  	struct dm_pp_clock_for_voltage_req *clock_for_voltage_req);
#5 lore raw

PATCH 2/14 drm/amd/display: Delete dce_get_required_clocks_state()

In reply to Timur Kristóf

It is not called from anywhere anymore.

---
 .../display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 34 -------------------
 .../display/dc/clk_mgr/dce100/dce_clk_mgr.h   |  3 --
 2 files changed, 37 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -34
index ffb70120362e7..988eb6f841f54 100644
@@ -220,40 +220,6 @@ uint32_t dce_get_max_pixel_clock_for_all_paths(struct dc_state *context)
 	return max_pix_clk;
 }
 
-enum dm_pp_clocks_state dce_get_required_clocks_state(
-	struct clk_mgr *clk_mgr_base,
-	struct dc_state *context)
-{
-	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	int i;
-	enum dm_pp_clocks_state low_req_clk;
-	int max_pix_clk = dce_get_max_pixel_clock_for_all_paths(context);
-
-	/* Iterate from highest supported to lowest valid state, and update
-	 * lowest RequiredState with the lowest state that satisfies
-	 * all required clocks
-	 */
-	for (i = clk_mgr_dce->max_clks_state; i >= DM_PP_CLOCKS_STATE_ULTRA_LOW; i--)
-		if (context->bw_ctx.bw.dce.dispclk_khz >
-				clk_mgr_dce->max_clks_by_state[i].display_clk_khz
-			|| max_pix_clk >
-				clk_mgr_dce->max_clks_by_state[i].pixel_clk_khz)
-			break;
-
-	low_req_clk = i + 1;
-	if (low_req_clk > clk_mgr_dce->max_clks_state) {
-		/* set max clock state for high phyclock, invalid on exceeding display clock */
-		if (clk_mgr_dce->max_clks_by_state[clk_mgr_dce->max_clks_state].display_clk_khz
-				< context->bw_ctx.bw.dce.dispclk_khz)
-			low_req_clk = DM_PP_CLOCKS_STATE_INVALID;
-		else
-			low_req_clk = clk_mgr_dce->max_clks_state;
-	}
-
-	return low_req_clk;
-}
-
-
 /* TODO: remove use the two broken down functions */
 int dce_set_clock(
 	struct clk_mgr *clk_mgr_base,
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.h +0 -3
index f6622f58f62eb..f9f0cfa2a7b20 100644
@@ -32,9 +32,6 @@
 /* functions shared by other dce clk mgrs */
 int dce_adjust_dp_ref_freq_for_ss(struct clk_mgr_internal *clk_mgr_dce, int dp_ref_clk_khz);
 int dce_get_dp_ref_freq_khz(struct clk_mgr *clk_mgr_base);
-enum dm_pp_clocks_state dce_get_required_clocks_state(
-	struct clk_mgr *clk_mgr_base,
-	struct dc_state *context);
 
 uint32_t dce_get_max_pixel_clock_for_all_paths(struct dc_state *context);
 
Signature · 1 line
2.53.0
Reviewed-by on v1 2/14
#6 lore raw

Re: [PATCH 02/14] drm/amd/display: Delete dce_get_required_clocks_state()

Quoted 1 line · Timur Kristóf

It is not called from anywhere anymore.

Quoted 66 lines
---
  .../display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 34 -------------------
  .../display/dc/clk_mgr/dce100/dce_clk_mgr.h   |  3 --
  2 files changed, 37 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -34
index ffb70120362e7..988eb6f841f54 100644
@@ -220,40 +220,6 @@ uint32_t dce_get_max_pixel_clock_for_all_paths(struct dc_state *context)
  	return max_pix_clk;
  }
 
-enum dm_pp_clocks_state dce_get_required_clocks_state(
-	struct clk_mgr *clk_mgr_base,
-	struct dc_state *context)
-{
-	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	int i;
-	enum dm_pp_clocks_state low_req_clk;
-	int max_pix_clk = dce_get_max_pixel_clock_for_all_paths(context);
-
-	/* Iterate from highest supported to lowest valid state, and update
-	 * lowest RequiredState with the lowest state that satisfies
-	 * all required clocks
-	 */
-	for (i = clk_mgr_dce->max_clks_state; i >= DM_PP_CLOCKS_STATE_ULTRA_LOW; i--)
-		if (context->bw_ctx.bw.dce.dispclk_khz >
-				clk_mgr_dce->max_clks_by_state[i].display_clk_khz
-			|| max_pix_clk >
-				clk_mgr_dce->max_clks_by_state[i].pixel_clk_khz)
-			break;
-
-	low_req_clk = i + 1;
-	if (low_req_clk > clk_mgr_dce->max_clks_state) {
-		/* set max clock state for high phyclock, invalid on exceeding display clock */
-		if (clk_mgr_dce->max_clks_by_state[clk_mgr_dce->max_clks_state].display_clk_khz
-				< context->bw_ctx.bw.dce.dispclk_khz)
-			low_req_clk = DM_PP_CLOCKS_STATE_INVALID;
-		else
-			low_req_clk = clk_mgr_dce->max_clks_state;
-	}
-
-	return low_req_clk;
-}
-
-
  /* TODO: remove use the two broken down functions */
  int dce_set_clock(
  	struct clk_mgr *clk_mgr_base,
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.h +0 -3
index f6622f58f62eb..f9f0cfa2a7b20 100644
@@ -32,9 +32,6 @@
  /* functions shared by other dce clk mgrs */
  int dce_adjust_dp_ref_freq_for_ss(struct clk_mgr_internal *clk_mgr_dce, int dp_ref_clk_khz);
  int dce_get_dp_ref_freq_khz(struct clk_mgr *clk_mgr_base);
-enum dm_pp_clocks_state dce_get_required_clocks_state(
-	struct clk_mgr *clk_mgr_base,
-	struct dc_state *context);
 
  uint32_t dce_get_max_pixel_clock_for_all_paths(struct dc_state *context);
 
#7 lore raw

PATCH 3/14 drm/amd/display: Remove min/max clock levels from clk_mgr

In reply to Timur Kristóf

These fields are not used by anything anymore.

---
 .../amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 14 --------------
 .../display/dc/clk_mgr/dce112/dce112_clk_mgr.c    | 15 ---------------
 .../drm/amd/display/dc/inc/hw/clk_mgr_internal.h  |  2 --
 3 files changed, 31 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -14
index 988eb6f841f54..2ba341df7fffd 100644
@@ -257,11 +257,6 @@ int dce_set_clock(
 		actual_clock = pxl_clk_params.dfs_bypass_display_clock;
 	}
 
-	/* from power down, we need mark the clock state as ClocksStateNominal
-	 * from HWReset, so when resume we will call pplib voltage regulator.*/
-	if (requested_clk_khz == 0)
-		clk_mgr_dce->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-
 	if (dmcu && dmcu->funcs->is_dmcu_initialized(dmcu))
 		dmcu->funcs->set_psr_wait_loop(dmcu, actual_clock / 1000 / 7);
 
@@ -425,7 +420,6 @@ void dce_clk_mgr_construct(
 		struct clk_mgr_internal *clk_mgr)
 {
 	struct clk_mgr *base = &clk_mgr->base;
-	struct dm_pp_static_clock_info static_clk_info = {0};
 
 	if (ctx->dce_version <= DCE_VERSION_6_4)
 		memcpy(clk_mgr->max_clks_by_state,
@@ -451,14 +445,6 @@ void dce_clk_mgr_construct(
 	clk_mgr->dprefclk_ss_divider = 1000;
 	clk_mgr->ss_on_dprefclk = false;
 
-	if (ctx->dce_version >= DCE_VERSION_8_0) {
-		if (dm_pp_get_static_clocks(ctx, &static_clk_info))
-			clk_mgr->max_clks_state = static_clk_info.max_clocks_state;
-		else
-			clk_mgr->max_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-		clk_mgr->cur_min_clks_state = DM_PP_CLOCKS_STATE_INVALID;
-	}
-
 	base->clks.max_supported_dispclk_khz =
 		clk_mgr->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
 
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -15
index 48393c69735b6..0f3f8df4df96a 100644
@@ -89,13 +89,6 @@ int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)
 	bp->funcs->set_dce_clock(bp, &dce_clk_params);
 	actual_clock = dce_clk_params.target_clock_frequency;
 
-	/*
-	 * from power down, we need mark the clock state as ClocksStateNominal
-	 * from HWReset, so when resume we will call pplib voltage regulator.
-	 */
-	if (requested_clk_khz == 0)
-		clk_mgr_dce->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-
 	/*Program DP ref Clock*/
 	/*VBIOS will determine DPREFCLK frequency, so we don't set it*/
 	dce_clk_params.target_clock_frequency = 0;
@@ -143,14 +136,6 @@ int dce112_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_clk_khz)
 	bp->funcs->set_dce_clock(bp, &dce_clk_params);
 	actual_clock = dce_clk_params.target_clock_frequency;
 
-	/*
-	 * from power down, we need mark the clock state as ClocksStateNominal
-	 * from HWReset, so when resume we will call pplib voltage regulator.
-	 */
-	if (requested_clk_khz == 0)
-		clk_mgr->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-
-
 	if (dmcu && dmcu->funcs->is_dmcu_initialized(dmcu)) {
 		if (clk_mgr->dfs_bypass_disp_clk != actual_clock)
 			dmcu->funcs->set_psr_wait_loop(dmcu,
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +0 -2
index c69ccfcebeb5a..e01bf6bd7f3f4 100644
@@ -477,8 +477,6 @@ struct clk_mgr_internal {
 	 */
 	int dprefclk_ss_divider;
 
-	enum dm_pp_clocks_state max_clks_state;
-	enum dm_pp_clocks_state cur_min_clks_state;
 	bool periodic_retraining_disabled;
 
 	unsigned int cur_phyclk_req_table[MAX_LINKS];
Signature · 1 line
2.53.0
#8 lore raw

Re: [PATCH 03/14] drm/amd/display: Remove min/max clock levels from clk_mgr

Quoted 34 lines · Timur Kristóf

These fields are not used by anything anymore.

---
  .../amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 14 --------------
  .../display/dc/clk_mgr/dce112/dce112_clk_mgr.c    | 15 ---------------
  .../drm/amd/display/dc/inc/hw/clk_mgr_internal.h  |  2 --
  3 files changed, 31 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -6
index 988eb6f841f54..2ba341df7fffd 100644
@@ -257,11 +257,6 @@ int dce_set_clock(
  		actual_clock = pxl_clk_params.dfs_bypass_display_clock;
  	}
 
-	/* from power down, we need mark the clock state as ClocksStateNominal
-	 * from HWReset, so when resume we will call pplib voltage regulator.*/
-	if (requested_clk_khz == 0)
-		clk_mgr_dce->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-
  	if (dmcu && dmcu->funcs->is_dmcu_initialized(dmcu))
  		dmcu->funcs->set_psr_wait_loop(dmcu, actual_clock / 1000 / 7);
 
@@ -425,7 +420,6 @@ void dce_clk_mgr_construct(
  		struct clk_mgr_internal *clk_mgr)
  {
  	struct clk_mgr *base = &clk_mgr->base;
-	struct dm_pp_static_clock_info static_clk_info = {0};
 
  	if (ctx->dce_version <= DCE_VERSION_6_4)
  		memcpy(clk_mgr->max_clks_by_state,

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 455

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
@@ -451,14 +445,6 @@ void dce_clk_mgr_construct(
  	clk_mgr->dprefclk_ss_divider = 1000;
  	clk_mgr->ss_on_dprefclk = false;
 
-	if (ctx->dce_version >= DCE_VERSION_8_0) {
-		if (dm_pp_get_static_clocks(ctx, &static_clk_info))

and dm_pp_get_static_clocks becomes unused, right?

Quoted 55 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -6
-			clk_mgr->max_clks_state = static_clk_info.max_clocks_state;
-		else
-			clk_mgr->max_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-		clk_mgr->cur_min_clks_state = DM_PP_CLOCKS_STATE_INVALID;
-	}
-
  	base->clks.max_supported_dispclk_khz =
  		clk_mgr->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
 
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -15
index 48393c69735b6..0f3f8df4df96a 100644
@@ -89,13 +89,6 @@ int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)
  	bp->funcs->set_dce_clock(bp, &dce_clk_params);
  	actual_clock = dce_clk_params.target_clock_frequency;
 
-	/*
-	 * from power down, we need mark the clock state as ClocksStateNominal
-	 * from HWReset, so when resume we will call pplib voltage regulator.
-	 */
-	if (requested_clk_khz == 0)
-		clk_mgr_dce->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-
  	/*Program DP ref Clock*/
  	/*VBIOS will determine DPREFCLK frequency, so we don't set it*/
  	dce_clk_params.target_clock_frequency = 0;
@@ -143,14 +136,6 @@ int dce112_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_clk_khz)
  	bp->funcs->set_dce_clock(bp, &dce_clk_params);
  	actual_clock = dce_clk_params.target_clock_frequency;
 
-	/*
-	 * from power down, we need mark the clock state as ClocksStateNominal
-	 * from HWReset, so when resume we will call pplib voltage regulator.
-	 */
-	if (requested_clk_khz == 0)
-		clk_mgr->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-
-
  	if (dmcu && dmcu->funcs->is_dmcu_initialized(dmcu)) {
  		if (clk_mgr->dfs_bypass_disp_clk != actual_clock)
  			dmcu->funcs->set_psr_wait_loop(dmcu,
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +0 -2
index c69ccfcebeb5a..e01bf6bd7f3f4 100644
@@ -477,8 +477,6 @@ struct clk_mgr_internal {
  	 */
  	int dprefclk_ss_divider;
 
-	enum dm_pp_clocks_state max_clks_state;
-	enum dm_pp_clocks_state cur_min_clks_state;
  	bool periodic_retraining_disabled;
 
  	unsigned int cur_phyclk_req_table[MAX_LINKS];
#9 lore raw

Re: [PATCH 03/14] drm/amd/display: Remove min/max clock levels from clk_mgr

Quoted 11 lines · Central European Summer Time Melissa Wen
Quoted 10 lines · Timur Kristóf

These fields are not used by anything anymore.

---

  .../amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 14 --------------
  .../display/dc/clk_mgr/dce112/dce112_clk_mgr.c    | 15 ---------------
  .../drm/amd/display/dc/inc/hw/clk_mgr_internal.h  |  2 --
  3 files changed, 31 deletions(-)
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c int dce_set_clock( · line 258

Quoted 8 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c index 988eb6f841f54..2ba341df7fffd 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -0
@@ -257,11 +257,6 @@ int dce_set_clock(
 
  		actual_clock = 

pxl_clk_params.dfs_bypass_display_clock;

Quoted 4 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c int dce_set_clock( · line 261

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
  	}
 
-	/* from power down, we need mark the clock state as 

ClocksStateNominal

Quoted 1 line

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c int dce_set_clock( · line 262

Quoted 1 line
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-	 * from HWReset, so when resume we will call pplib voltage 

regulator.*/

Quoted 2 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c int dce_set_clock( · line 264

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
-	if (requested_clk_khz == 0)
-		clk_mgr_dce->cur_min_clks_state = 

DM_PP_CLOCKS_STATE_NOMINAL;

Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-
 
  	if (dmcu && dmcu->funcs->is_dmcu_initialized(dmcu))

dmcu->funcs->set_psr_wait_loop(dmcu, actual_clock /

1000 / 7);

Quoted 17 lines
Quoted 17 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
@@ -425,7 +420,6 @@ void dce_clk_mgr_construct(
 
  		struct clk_mgr_internal *clk_mgr)
 
  {
 
  	struct clk_mgr *base = &clk_mgr->base;
 
-	struct dm_pp_static_clock_info static_clk_info = {0};
 
  	if (ctx->dce_version <= DCE_VERSION_6_4)
 
  		memcpy(clk_mgr->max_clks_by_state,
@@ -451,14 +445,6 @@ void dce_clk_mgr_construct(
 
Quoted 7 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 455

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
  	clk_mgr->dprefclk_ss_divider = 1000;
  	clk_mgr->ss_on_dprefclk = false;
 
-	if (ctx->dce_version >= DCE_VERSION_8_0) {
-		if (dm_pp_get_static_clocks(ctx, &static_clk_info))

and dm_pp_get_static_clocks becomes unused, right?

Looks like nothing else is using dm_pp_get_static_clocks() so that can be deleted as well. I can do that in a follow-up series if that's OK.

Quoted 2 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 457

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-			clk_mgr->max_clks_state = 

static_clk_info.max_clocks_state;

Quoted 2 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 459

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
-		else
-			clk_mgr->max_clks_state = 

DM_PP_CLOCKS_STATE_NOMINAL;

Quoted 1 line

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 460

Quoted 1 line
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-		clk_mgr->cur_min_clks_state = 

DM_PP_CLOCKS_STATE_INVALID;

Quoted 20 lines
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
-	}
-
 
  	base->clks.max_supported_dispclk_khz =

clk_mgr-

max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk

Quoted 13 lines

_khz;

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c index 48393c69735b6..0f3f8df4df96a 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -0
@@ -89,13 +89,6 @@ int dce112_set_clock(struct clk_mgr *clk_mgr_base, int

requested_clk_khz)>
bp->funcs->set_dce_clock(bp, &dce_clk_params); actual_clock = dce_clk_params.target_clock_frequency;

Quoted 2 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -2
-	/*
-	 * from power down, we need mark the clock state as 

ClocksStateNominal

Quoted 1 line

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c

Quoted 1 line
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -1
-	 * from HWReset, so when resume we will call pplib voltage 

regulator.

Quoted 3 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -3
-	 */
-	if (requested_clk_khz == 0)
-		clk_mgr_dce->cur_min_clks_state = 

DM_PP_CLOCKS_STATE_NOMINAL;

Quoted 6 lines
Quoted 6 lines

-

/*Program DP ref Clock*/
/*VBIOS will determine DPREFCLK frequency, so we don't set it*/ dce_clk_params.target_clock_frequency = 0;

Quoted 7 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c int dce112_set_dispclk(struct clk_mgr_internal · line 148

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -2
@@ -143,14 +136,6 @@ int dce112_set_dispclk(struct clk_mgr_internal
 *clk_mgr, int requested_clk_khz)> 
  	bp->funcs->set_dce_clock(bp, &dce_clk_params);
  	actual_clock = dce_clk_params.target_clock_frequency;
 
-	/*
-	 * from power down, we need mark the clock state as 

ClocksStateNominal

Quoted 1 line

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c int dce112_set_dispclk(struct clk_mgr_internal · line 149

Quoted 1 line
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -1
-	 * from HWReset, so when resume we will call pplib voltage 

regulator.

Quoted 3 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -3
-	 */
-	if (requested_clk_khz == 0)
-		clk_mgr->cur_min_clks_state = 

DM_PP_CLOCKS_STATE_NOMINAL;

Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -2
-
-
 
  	if (dmcu && dmcu->funcs->is_dmcu_initialized(dmcu)) {

if (clk_mgr->dfs_bypass_disp_clk != actual_clock)

dmcu->funcs->set_psr_wait_loop(dmcu,

(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h index c69ccfcebeb5a..e01bf6bd7f3f4 100644

drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +0 -2
@@ -477,8 +477,6 @@ struct clk_mgr_internal {
 
  	 */
 
  	int dprefclk_ss_divider;
 
-	enum dm_pp_clocks_state max_clks_state;
-	enum dm_pp_clocks_state cur_min_clks_state;
 

bool periodic_retraining_disabled;

  	unsigned int cur_phyclk_req_table[MAX_LINKS];
Reviewed-by
#10 lore raw

Re: [PATCH 03/14] drm/amd/display: Remove min/max clock levels from clk_mgr

Quoted 54 lines · Timur Kristóf
Quoted 11 lines · Central European Summer Time Melissa Wen
Quoted 10 lines · Timur Kristóf

These fields are not used by anything anymore.

---

   .../amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 14 --------------
   .../display/dc/clk_mgr/dce112/dce112_clk_mgr.c    | 15 ---------------
   .../drm/amd/display/dc/inc/hw/clk_mgr_internal.h  |  2 --
   3 files changed, 31 deletions(-)
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c int dce_set_clock( · line 258

Quoted 8 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c index 988eb6f841f54..2ba341df7fffd 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -0
@@ -257,11 +257,6 @@ int dce_set_clock(
 
   		actual_clock =

pxl_clk_params.dfs_bypass_display_clock;

Quoted 4 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c int dce_set_clock( · line 261

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
   	}
 
-	/* from power down, we need mark the clock state as

ClocksStateNominal

Quoted 1 line

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c int dce_set_clock( · line 262

Quoted 1 line
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-	 * from HWReset, so when resume we will call pplib voltage

regulator.*/

Quoted 2 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c int dce_set_clock( · line 264

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
-	if (requested_clk_khz == 0)
-		clk_mgr_dce->cur_min_clks_state =

DM_PP_CLOCKS_STATE_NOMINAL;

Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-
 
   	if (dmcu && dmcu->funcs->is_dmcu_initialized(dmcu))
   	
   		dmcu->funcs->set_psr_wait_loop(dmcu, actual_clock /

1000 / 7);

Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
@@ -425,7 +420,6 @@ void dce_clk_mgr_construct(
 
   		struct clk_mgr_internal *clk_mgr)
 
   {
 
   	struct clk_mgr *base = &clk_mgr->base;
 
-	struct dm_pp_static_clock_info static_clk_info = {0};
 
   	if (ctx->dce_version <= DCE_VERSION_6_4)
 
   		memcpy(clk_mgr->max_clks_by_state,
@@ -451,14 +445,6 @@ void dce_clk_mgr_construct(
 
Quoted 8 lines
Quoted 6 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 455

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
   	clk_mgr->dprefclk_ss_divider = 1000;
   	clk_mgr->ss_on_dprefclk = false;
 
-	if (ctx->dce_version >= DCE_VERSION_8_0) {
-		if (dm_pp_get_static_clocks(ctx, &static_clk_info))

and dm_pp_get_static_clocks becomes unused, right?

Looks like nothing else is using dm_pp_get_static_clocks() so that can be deleted as well. I can do that in a follow-up series if that's OK.

Okay. After cleaning this too, this patch is

Quoted 86 lines
Quoted 2 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 457

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-			clk_mgr->max_clks_state =

static_clk_info.max_clocks_state;

Quoted 2 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 459

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
-		else
-			clk_mgr->max_clks_state =

DM_PP_CLOCKS_STATE_NOMINAL;

Quoted 1 line

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 460

Quoted 1 line
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -1
-		clk_mgr->cur_min_clks_state =

DM_PP_CLOCKS_STATE_INVALID;

Quoted 20 lines
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
-	}
-
 
   	base->clks.max_supported_dispclk_khz =

clk_mgr-

max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk

Quoted 13 lines
   		_khz;

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c index 48393c69735b6..0f3f8df4df96a 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -0
@@ -89,13 +89,6 @@ int dce112_set_clock(struct clk_mgr *clk_mgr_base, int

requested_clk_khz)>

   	bp->funcs->set_dce_clock(bp, &dce_clk_params);
   	actual_clock = dce_clk_params.target_clock_frequency;
Quoted 2 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -2
-	/*
-	 * from power down, we need mark the clock state as

ClocksStateNominal

Quoted 1 line

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c

Quoted 1 line
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -1
-	 * from HWReset, so when resume we will call pplib voltage

regulator.

Quoted 3 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -3
-	 */
-	if (requested_clk_khz == 0)
-		clk_mgr_dce->cur_min_clks_state =

DM_PP_CLOCKS_STATE_NOMINAL;

Quoted 6 lines
Quoted 6 lines

-

   	/*Program DP ref Clock*/
   	/*VBIOS will determine DPREFCLK frequency, so we don't set it*/
   	dce_clk_params.target_clock_frequency = 0;
Quoted 7 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c int dce112_set_dispclk(struct clk_mgr_internal · line 148

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -2
@@ -143,14 +136,6 @@ int dce112_set_dispclk(struct clk_mgr_internal
 *clk_mgr, int requested_clk_khz)>
   	bp->funcs->set_dce_clock(bp, &dce_clk_params);
   	actual_clock = dce_clk_params.target_clock_frequency;
 
-	/*
-	 * from power down, we need mark the clock state as

ClocksStateNominal

Quoted 1 line

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c int dce112_set_dispclk(struct clk_mgr_internal · line 149

Quoted 1 line
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -1
-	 * from HWReset, so when resume we will call pplib voltage

regulator.

Quoted 3 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -3
-	 */
-	if (requested_clk_khz == 0)
-		clk_mgr->cur_min_clks_state =

DM_PP_CLOCKS_STATE_NOMINAL;

Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -2
-
-
 
   	if (dmcu && dmcu->funcs->is_dmcu_initialized(dmcu)) {
   	
   		if (clk_mgr->dfs_bypass_disp_clk != actual_clock)
   		
   			dmcu->funcs->set_psr_wait_loop(dmcu,
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h index c69ccfcebeb5a..e01bf6bd7f3f4 100644

drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +0 -2
@@ -477,8 +477,6 @@ struct clk_mgr_internal {
 
   	 */
 
   	int dprefclk_ss_divider;
 
-	enum dm_pp_clocks_state max_clks_state;
-	enum dm_pp_clocks_state cur_min_clks_state;
 
   	bool periodic_retraining_disabled;
   	
   	unsigned int cur_phyclk_req_table[MAX_LINKS];
#11 lore raw

PATCH 4/14 drm/amd/display: Delete max_clocks_state from dm_pp_static_clock_info

In reply to Timur Kristóf

It's not used by anything anymore.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  | 28 -------------------
 .../drm/amd/display/dc/dm_services_types.h    |  3 --
 2 files changed, 31 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -28
index 17f42201ab862..2247969aa9acb 100644
@@ -183,33 +183,6 @@ static enum amd_pp_clock_type dc_to_pp_clock_type(
 	return amd_pp_clk_type;
 }
 
-static enum dm_pp_clocks_state pp_to_dc_powerlevel_state(
-			enum PP_DAL_POWERLEVEL max_clocks_state)
-{
-	switch (max_clocks_state) {
-	case PP_DAL_POWERLEVEL_0:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_0;
-	case PP_DAL_POWERLEVEL_1:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_1;
-	case PP_DAL_POWERLEVEL_2:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_2;
-	case PP_DAL_POWERLEVEL_3:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_3;
-	case PP_DAL_POWERLEVEL_4:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_4;
-	case PP_DAL_POWERLEVEL_5:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_5;
-	case PP_DAL_POWERLEVEL_6:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_6;
-	case PP_DAL_POWERLEVEL_7:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_7;
-	default:
-		DRM_ERROR("DM_PPLIB: invalid powerlevel state: %d!\n",
-				max_clocks_state);
-		return DM_PP_CLOCKS_STATE_INVALID;
-	}
-}
-
 static void pp_to_dc_clock_levels(
 		const struct amd_pp_clocks *pp_clks,
 		struct dm_pp_clock_levels *dc_clks,
@@ -448,7 +421,6 @@ bool dm_pp_get_static_clocks(
 	if (amdgpu_dpm_get_current_clocks(adev, &pp_clk_info))
 		return false;
 
-	static_clk_info->max_clocks_state = pp_to_dc_powerlevel_state(pp_clk_info.max_clocks_state);
 	static_clk_info->max_mclk_khz = pp_clk_info.max_memory_clock * 10;
 	static_clk_info->max_sclk_khz = pp_clk_info.max_engine_clock * 10;
 
drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -3
index 3b093b8699abd..44aa8d213d386 100644
@@ -258,9 +258,6 @@ struct dm_pp_clock_for_voltage_req {
 struct dm_pp_static_clock_info {
 	uint32_t max_sclk_khz;
 	uint32_t max_mclk_khz;
-
-	/* max possible display block clocks state */
-	enum dm_pp_clocks_state max_clocks_state;
 };
 
 struct dtn_min_clk_info {
Signature · 1 line
2.53.0
Reviewed-by on v1 4/14
#12 lore raw

Re: [PATCH 04/14] drm/amd/display: Delete max_clocks_state from dm_pp_static_clock_info

Quoted 1 line · Timur Kristóf

It's not used by anything anymore.

Quoted 67 lines
---
  .../amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c  | 28 -------------------
  .../drm/amd/display/dc/dm_services_types.h    |  3 --
  2 files changed, 31 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -28
index 17f42201ab862..2247969aa9acb 100644
@@ -183,33 +183,6 @@ static enum amd_pp_clock_type dc_to_pp_clock_type(
  	return amd_pp_clk_type;
  }
 
-static enum dm_pp_clocks_state pp_to_dc_powerlevel_state(
-			enum PP_DAL_POWERLEVEL max_clocks_state)
-{
-	switch (max_clocks_state) {
-	case PP_DAL_POWERLEVEL_0:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_0;
-	case PP_DAL_POWERLEVEL_1:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_1;
-	case PP_DAL_POWERLEVEL_2:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_2;
-	case PP_DAL_POWERLEVEL_3:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_3;
-	case PP_DAL_POWERLEVEL_4:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_4;
-	case PP_DAL_POWERLEVEL_5:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_5;
-	case PP_DAL_POWERLEVEL_6:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_6;
-	case PP_DAL_POWERLEVEL_7:
-		return DM_PP_CLOCKS_DPM_STATE_LEVEL_7;
-	default:
-		DRM_ERROR("DM_PPLIB: invalid powerlevel state: %d!\n",
-				max_clocks_state);
-		return DM_PP_CLOCKS_STATE_INVALID;
-	}
-}
-
  static void pp_to_dc_clock_levels(
  		const struct amd_pp_clocks *pp_clks,
  		struct dm_pp_clock_levels *dc_clks,
@@ -448,7 +421,6 @@ bool dm_pp_get_static_clocks(
  	if (amdgpu_dpm_get_current_clocks(adev, &pp_clk_info))
  		return false;
 
-	static_clk_info->max_clocks_state = pp_to_dc_powerlevel_state(pp_clk_info.max_clocks_state);
  	static_clk_info->max_mclk_khz = pp_clk_info.max_memory_clock * 10;
  	static_clk_info->max_sclk_khz = pp_clk_info.max_engine_clock * 10;
 
drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -3
index 3b093b8699abd..44aa8d213d386 100644
@@ -258,9 +258,6 @@ struct dm_pp_clock_for_voltage_req {
  struct dm_pp_static_clock_info {
  	uint32_t max_sclk_khz;
  	uint32_t max_mclk_khz;
-
-	/* max possible display block clocks state */
-	enum dm_pp_clocks_state max_clocks_state;
  };
 
  struct dtn_min_clk_info {
#13 lore raw

PATCH 5/14 drm/amd/display: Set max supported display clock without max_clks_by_state

In reply to Timur Kristóf

The max_clks_by_state was based on hardcoded values, which are not really used anywhere, only to know the maximum clock. Just hardcode the same maximum clock for each DCE version.

---
 .../amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c  | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +11 -5
index 2ba341df7fffd..bef9a72f3382f 100644
@@ -391,9 +391,7 @@ static void dce_update_clocks(struct clk_mgr *clk_mgr_base,
 			struct dc_state *context,
 			bool safe_to_lower)
 {
-	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	const int max_disp_clk =
-		clk_mgr_dce->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
+	const int max_disp_clk = clk_mgr_base->clks.max_supported_dispclk_khz;
 	int patched_disp_clk = MIN(max_disp_clk, context->bw_ctx.bw.dce.dispclk_khz);
 
 	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
@@ -445,8 +443,16 @@ void dce_clk_mgr_construct(
 	clk_mgr->dprefclk_ss_divider = 1000;
 	clk_mgr->ss_on_dprefclk = false;
 
-	base->clks.max_supported_dispclk_khz =
-		clk_mgr->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
+	if (ctx->dce_version >= DCE_VERSION_12_0)
+		base->clks.max_supported_dispclk_khz = 1133000;
+	else if (ctx->dce_version >= DCE_VERSION_11_2)
+		base->clks.max_supported_dispclk_khz = 1108000;
+	else if (ctx->dce_version >= DCE_VERSION_11_0)
+		base->clks.max_supported_dispclk_khz = 643000;
+	else if (ctx->dce_version >= DCE_VERSION_8_0)
+		base->clks.max_supported_dispclk_khz = 625000;
+	else
+		base->clks.max_supported_dispclk_khz = 600000;
 
 	dce_clock_read_integrated_info(clk_mgr);
 	dce_clock_read_ss_info(clk_mgr);
Signature · 1 line
2.53.0
Reviewed-by on v1 5/14
#14 lore raw

Re: [PATCH 05/14] drm/amd/display: Set max supported display clock without max_clks_by_state

Quoted 25 lines · Timur Kristóf

The max_clks_by_state was based on hardcoded values, which are not really used anywhere, only to know the maximum clock. Just hardcode the same maximum clock for each DCE version.

---
  .../amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c  | 16 +++++++++++-----
  1 file changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +1 -3
index 2ba341df7fffd..bef9a72f3382f 100644
@@ -391,9 +391,7 @@ static void dce_update_clocks(struct clk_mgr *clk_mgr_base,
  			struct dc_state *context,
  			bool safe_to_lower)
  {
-	struct clk_mgr_internal *clk_mgr_dce = TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	const int max_disp_clk =
-		clk_mgr_dce->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
+	const int max_disp_clk = clk_mgr_base->clks.max_supported_dispclk_khz;
  	int patched_disp_clk = MIN(max_disp_clk, context->bw_ctx.bw.dce.dispclk_khz);
 
  	if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 449

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +4 -2
@@ -445,8 +443,16 @@ void dce_clk_mgr_construct(
  	clk_mgr->dprefclk_ss_divider = 1000;
  	clk_mgr->ss_on_dprefclk = false;
 
-	base->clks.max_supported_dispclk_khz =
-		clk_mgr->max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_khz;
+	if (ctx->dce_version >= DCE_VERSION_12_0)
+		base->clks.max_supported_dispclk_khz = 1133000;
+	else if (ctx->dce_version >= DCE_VERSION_11_2)
+		base->clks.max_supported_dispclk_khz = 1108000;

For DCE 11.2, I see ClocksStatePerformance is 1132000 instead of 1108000, right?

With the value fixed, this is:

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +6 -0
+	else if (ctx->dce_version >= DCE_VERSION_11_0)
+		base->clks.max_supported_dispclk_khz = 643000;
+	else if (ctx->dce_version >= DCE_VERSION_8_0)
+		base->clks.max_supported_dispclk_khz = 625000;
+	else
+		base->clks.max_supported_dispclk_khz = 600000;
 
  	dce_clock_read_integrated_info(clk_mgr);
  	dce_clock_read_ss_info(clk_mgr);
#15 lore raw

Re: [PATCH 05/14] drm/amd/display: Set max supported display clock without max_clks_by_state

Quoted 43 lines · On 2026. április 29., szerda 22:24:38 közép-európai nyári idő Melissa Wen wrote:
Quoted 16 lines · Timur Kristóf

The max_clks_by_state was based on hardcoded values, which are not really used anywhere, only to know the maximum clock. Just hardcode the same maximum clock for each DCE version.

---

  .../amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c  | 16 +++++++++++-----
  1 file changed, 11 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c index 2ba341df7fffd..bef9a72f3382f 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c static void dce_update_clocks(struct clk_mgr

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -3
@@ -391,9 +391,7 @@ static void dce_update_clocks(struct clk_mgr
 *clk_mgr_base,> 
  			struct dc_state *context,
  			bool safe_to_lower)
 
  {
 
-	struct clk_mgr_internal *clk_mgr_dce =
 TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	const int max_disp_clk =
-		clk_mgr_dce-

max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_

Quoted 8 lines

clk_khz; + const int max_disp_clk =
clk_mgr_base->clks.max_supported_dispclk_khz;>
int patched_disp_clk = MIN(max_disp_clk,
context->bw_ctx.bw.dce.dispclk_khz);

if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {>

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 450

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
@@ -445,8 +443,16 @@ void dce_clk_mgr_construct(
 
  	clk_mgr->dprefclk_ss_divider = 1000;
  	clk_mgr->ss_on_dprefclk = false;
 
-	base->clks.max_supported_dispclk_khz =
-		clk_mgr-

max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_

Quoted 7 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 449

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +3 -0
 khz; +	if (ctx->dce_version >= DCE_VERSION_12_0)
+		base->clks.max_supported_dispclk_khz = 1133000;
+	else if (ctx->dce_version >= DCE_VERSION_11_2)
+		base->clks.max_supported_dispclk_khz = 1108000;

For DCE 11.2, I see ClocksStatePerformance is 1132000 instead of 1108000, right?

Hi Melissa,

For DCE11.2, nobody really knows what the maximum supported display clock is. There are different values hardcoded in different parts of the code base.

dce112_max_clks_by_state says it's 1132 MHz
bw_calcs says it's 1108 MHz
and dce112_update_clocks() adds 15%

In this patch, I chose to go for 1108 MHz to match bw_calcs, but I can edit that if you feel that 1132 MHz is better. What do you think?

Thanks,
Timur

Quoted 14 lines

With the value fixed, this is:

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +6 -0
+	else if (ctx->dce_version >= DCE_VERSION_11_0)
+		base->clks.max_supported_dispclk_khz = 643000;
+	else if (ctx->dce_version >= DCE_VERSION_8_0)
+		base->clks.max_supported_dispclk_khz = 625000;
+	else
+		base->clks.max_supported_dispclk_khz = 600000;
 
  	dce_clock_read_integrated_info(clk_mgr);
  	dce_clock_read_ss_info(clk_mgr);
#16 lore raw

Re: [PATCH 05/14] drm/amd/display: Set max supported display clock without max_clks_by_state

Quoted 56 lines · Timur Kristóf
Quoted 43 lines · On 2026. április 29., szerda 22:24:38 közép-európai nyári idő Melissa Wen wrote:
Quoted 16 lines · Timur Kristóf

The max_clks_by_state was based on hardcoded values, which are not really used anywhere, only to know the maximum clock. Just hardcode the same maximum clock for each DCE version.

---

   .../amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c  | 16 +++++++++++-----
   1 file changed, 11 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c index 2ba341df7fffd..bef9a72f3382f 100644

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c static void dce_update_clocks(struct clk_mgr

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -3
@@ -391,9 +391,7 @@ static void dce_update_clocks(struct clk_mgr
 *clk_mgr_base,>
   			struct dc_state *context,
   			bool safe_to_lower)
 
   {
 
-	struct clk_mgr_internal *clk_mgr_dce =
 TO_CLK_MGR_INTERNAL(clk_mgr_base);
-	const int max_disp_clk =
-		clk_mgr_dce-

max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_

Quoted 8 lines

clk_khz; + const int max_disp_clk =
clk_mgr_base->clks.max_supported_dispclk_khz;>
int patched_disp_clk = MIN(max_disp_clk,
context->bw_ctx.bw.dce.dispclk_khz);

if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {>

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 450

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -2
@@ -445,8 +443,16 @@ void dce_clk_mgr_construct(
 
   	clk_mgr->dprefclk_ss_divider = 1000;
   	clk_mgr->ss_on_dprefclk = false;
 
-	base->clks.max_supported_dispclk_khz =
-		clk_mgr-

max_clks_by_state[DM_PP_CLOCKS_STATE_PERFORMANCE].display_clk_

Quoted 6 lines

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c void dce_clk_mgr_construct( · line 449

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +3 -0
 khz; +	if (ctx->dce_version >= DCE_VERSION_12_0)
+		base->clks.max_supported_dispclk_khz = 1133000;
+	else if (ctx->dce_version >= DCE_VERSION_11_2)
+		base->clks.max_supported_dispclk_khz = 1108000;

For DCE 11.2, I see ClocksStatePerformance is 1132000 instead of 1108000, right?

Hi Melissa,

For DCE11.2, nobody really knows what the maximum supported display clock is. There are different values hardcoded in different parts of the code base.

Quoted 6 lines

dce112_max_clks_by_state says it's 1132 MHz
bw_calcs says it's 1108 MHz
and dce112_update_clocks() adds 15%

In this patch, I chose to go for 1108 MHz to match bw_calcs, but I can edit that if you feel that 1132 MHz is better. What do you think?

I see. I'd keep 1132000 for consistency with the next patch.
If you believe 1108000 is the right value, I'd add a separate patch fixing it before this one.

Melissa

Quoted 21 lines

Thanks,
Timur

Quoted 13 lines

With the value fixed, this is:

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +6 -0
+	else if (ctx->dce_version >= DCE_VERSION_11_0)
+		base->clks.max_supported_dispclk_khz = 643000;
+	else if (ctx->dce_version >= DCE_VERSION_8_0)
+		base->clks.max_supported_dispclk_khz = 625000;
+	else
+		base->clks.max_supported_dispclk_khz = 600000;
 
   	dce_clock_read_integrated_info(clk_mgr);
   	dce_clock_read_ss_info(clk_mgr);
#17 lore raw

PATCH 6/14 drm/amd/display: Delete max_clks_by_state from DCE clock manager

In reply to Timur Kristóf

It was not used by anything anymore.

Note that the parts of DC that need this information actually already query it from the pplib and don't use the hardcoded information from max_clks_by_state.

---
 .../display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 71 -------------------
 .../dc/clk_mgr/dce110/dce110_clk_mgr.c        | 16 -----
 .../dc/clk_mgr/dce112/dce112_clk_mgr.c        | 17 -----
 .../dc/clk_mgr/dce120/dce120_clk_mgr.c        | 16 -----
 .../amd/display/dc/inc/hw/clk_mgr_internal.h  |  2 -
 5 files changed, 122 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -71
index bef9a72f3382f..4303a42a7fe37 100644
@@ -62,32 +62,6 @@ static const struct clk_mgr_mask disp_clk_mask = {
 		CLK_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
 };
 
-/* Max clock values for each state indexed by "enum clocks_state": */
-static const struct state_dependent_clocks dce60_max_clks_by_state[] = {
-/* ClocksStateInvalid - should not be used */
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/* ClocksStateUltraLow - not expected to be used for DCE 6.0 */
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/* ClocksStateLow */
-{ .display_clk_khz = 352000, .pixel_clk_khz = 330000},
-/* ClocksStateNominal */
-{ .display_clk_khz = 600000, .pixel_clk_khz = 400000 },
-/* ClocksStatePerformance */
-{ .display_clk_khz = 600000, .pixel_clk_khz = 400000 } };
-
-/* Max clock values for each state indexed by "enum clocks_state": */
-static const struct state_dependent_clocks dce80_max_clks_by_state[] = {
-/* ClocksStateInvalid - should not be used */
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/* ClocksStateUltraLow - not expected to be used for DCE 8.0 */
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/* ClocksStateLow */
-{ .display_clk_khz = 352000, .pixel_clk_khz = 330000},
-/* ClocksStateNominal */
-{ .display_clk_khz = 625000, .pixel_clk_khz = 400000 },
-/* ClocksStatePerformance */
-{ .display_clk_khz = 625000, .pixel_clk_khz = 400000 } };
-
 int dentist_get_divider_from_did(int did)
 {
 	if (did < DENTIST_BASE_DID_1)
@@ -268,7 +242,6 @@ static void dce_clock_read_integrated_info(struct clk_mgr_internal *clk_mgr_dce)
 {
 	struct dc_debug_options *debug = &clk_mgr_dce->base.ctx->dc->debug;
 	struct dc_bios *bp = clk_mgr_dce->base.ctx->dc_bios;
-	int i;
 
 	if (bp->integrated_info)
 		clk_mgr_dce->base.dentist_vco_freq_khz = bp->integrated_info->dentist_vco_freq;
@@ -278,40 +251,6 @@ static void dce_clock_read_integrated_info(struct clk_mgr_internal *clk_mgr_dce)
 			clk_mgr_dce->base.dentist_vco_freq_khz = 3600000;
 	}
 
-	/*update the maximum display clock for each power state*/
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		enum dm_pp_clocks_state clk_state = DM_PP_CLOCKS_STATE_INVALID;
-
-		switch (i) {
-		case 0:
-			clk_state = DM_PP_CLOCKS_STATE_ULTRA_LOW;
-			break;
-
-		case 1:
-			clk_state = DM_PP_CLOCKS_STATE_LOW;
-			break;
-
-		case 2:
-			clk_state = DM_PP_CLOCKS_STATE_NOMINAL;
-			break;
-
-		case 3:
-			clk_state = DM_PP_CLOCKS_STATE_PERFORMANCE;
-			break;
-
-		default:
-			clk_state = DM_PP_CLOCKS_STATE_INVALID;
-			break;
-		}
-
-		/*Do not allow bad VBIOS/SBIOS to override with invalid values,
-		 * check for > 100MHz*/
-		if (bp->integrated_info)
-			if (bp->integrated_info->disp_clk_voltage[i].max_supported_clk >= 100000)
-				clk_mgr_dce->max_clks_by_state[clk_state].display_clk_khz =
-					bp->integrated_info->disp_clk_voltage[i].max_supported_clk;
-	}
-
 	if (!debug->disable_dfs_bypass && bp->integrated_info)
 		if (bp->integrated_info->gpu_cap_info & DFS_BYPASS_ENABLE)
 			clk_mgr_dce->dfs_bypass_enabled = true;
@@ -419,16 +358,6 @@ void dce_clk_mgr_construct(
 {
 	struct clk_mgr *base = &clk_mgr->base;
 
-	if (ctx->dce_version <= DCE_VERSION_6_4)
-		memcpy(clk_mgr->max_clks_by_state,
-			dce60_max_clks_by_state,
-			sizeof(dce60_max_clks_by_state));
-	else
-		memcpy(clk_mgr->max_clks_by_state,
-			dce80_max_clks_by_state,
-			sizeof(dce80_max_clks_by_state));
-
-
 	base->ctx = ctx;
 	base->funcs = &dce_funcs;
 
drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +0 -16
index ae922f1a31ff8..6144c03e14207 100644
@@ -51,18 +51,6 @@ static const struct clk_mgr_mask disp_clk_mask = {
 		CLK_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
 };
 
-static const struct state_dependent_clocks dce110_max_clks_by_state[] = {
-/*ClocksStateInvalid - should not be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
-{ .display_clk_khz = 352000, .pixel_clk_khz = 330000 },
-/*ClocksStateLow*/
-{ .display_clk_khz = 352000, .pixel_clk_khz = 330000 },
-/*ClocksStateNominal*/
-{ .display_clk_khz = 467000, .pixel_clk_khz = 400000 },
-/*ClocksStatePerformance*/
-{ .display_clk_khz = 643000, .pixel_clk_khz = 400000 } };
-
 static int determine_sclk_from_bounding_box(
 		const struct dc *dc,
 		int required_sclk)
@@ -281,10 +269,6 @@ void dce110_clk_mgr_construct(
 {
 	dce_clk_mgr_construct(ctx, clk_mgr);
 
-	memcpy(clk_mgr->max_clks_by_state,
-		dce110_max_clks_by_state,
-		sizeof(dce110_max_clks_by_state));
-
 	clk_mgr->regs = &disp_clk_regs;
 	clk_mgr->clk_mgr_shift = &disp_clk_shift;
 	clk_mgr->clk_mgr_mask = &disp_clk_mask;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -17
index 0f3f8df4df96a..08ed6f88025fa 100644
@@ -53,19 +53,6 @@ static const struct clk_mgr_mask disp_clk_mask = {
 		CLK_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
 };
 
-static const struct state_dependent_clocks dce112_max_clks_by_state[] = {
-/*ClocksStateInvalid - should not be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
-{ .display_clk_khz = 389189, .pixel_clk_khz = 346672 },
-/*ClocksStateLow*/
-{ .display_clk_khz = 459000, .pixel_clk_khz = 400000 },
-/*ClocksStateNominal*/
-{ .display_clk_khz = 667000, .pixel_clk_khz = 600000 },
-/*ClocksStatePerformance*/
-{ .display_clk_khz = 1132000, .pixel_clk_khz = 600000 } };
-
-
 //TODO: remove use the two broken down functions
 int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)
 {
@@ -202,10 +189,6 @@ void dce112_clk_mgr_construct(
 {
 	dce_clk_mgr_construct(ctx, clk_mgr);
 
-	memcpy(clk_mgr->max_clks_by_state,
-		dce112_max_clks_by_state,
-		sizeof(dce112_max_clks_by_state));
-
 	clk_mgr->regs = &disp_clk_regs;
 	clk_mgr->clk_mgr_shift = &disp_clk_shift;
 	clk_mgr->clk_mgr_mask = &disp_clk_mask;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce120/dce120_clk_mgr.c +0 -16
index c9ba7b3fd2c32..f8ef3a4710fc2 100644
@@ -32,18 +32,6 @@
 #include "dce100/dce_clk_mgr.h"
 #include "dce120/dce120_hwseq.h"
 
-static const struct state_dependent_clocks dce120_max_clks_by_state[] = {
-/*ClocksStateInvalid - should not be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateLow*/
-{ .display_clk_khz = 460000, .pixel_clk_khz = 400000 },
-/*ClocksStateNominal*/
-{ .display_clk_khz = 670000, .pixel_clk_khz = 600000 },
-/*ClocksStatePerformance*/
-{ .display_clk_khz = 1133000, .pixel_clk_khz = 600000 } };
-
 /**
  * dce121_clock_patch_xgmi_ss_info() - Save XGMI spread spectrum info
  * @clk_mgr_dce: clock manager internal structure
@@ -129,10 +117,6 @@ void dce120_clk_mgr_construct(struct dc_context *ctx, struct clk_mgr_internal *c
 {
 	dce_clk_mgr_construct(ctx, clk_mgr);
 
-	memcpy(clk_mgr->max_clks_by_state,
-		dce120_max_clks_by_state,
-		sizeof(dce120_max_clks_by_state));
-
 	clk_mgr->base.dprefclk_khz = 600000;
 	clk_mgr->base.funcs = &dce120_funcs;
 }
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +0 -2
index e01bf6bd7f3f4..5accf076a3747 100644
@@ -429,8 +429,6 @@ struct clk_mgr_internal {
 	const struct clk_mgr_shift *clk_mgr_shift;
 	const struct clk_mgr_mask *clk_mgr_mask;
 
-	struct state_dependent_clocks max_clks_by_state[DM_PP_CLOCKS_MAX_STATES];
-
 	/*TODO: figure out which of the below fields should be here vs in asic specific portion */
 	/* Cache the status of DFS-bypass feature*/
 	bool dfs_bypass_enabled;
Signature · 1 line
2.53.0
#18 lore raw

Re: [PATCH 06/14] drm/amd/display: Delete max_clks_by_state from DCE clock manager

Quoted 38 lines · Timur Kristóf

It was not used by anything anymore.

Note that the parts of DC that need this information actually already query it from the pplib and don't use the hardcoded information from max_clks_by_state.

---
  .../display/dc/clk_mgr/dce100/dce_clk_mgr.c   | 71 -------------------
  .../dc/clk_mgr/dce110/dce110_clk_mgr.c        | 16 -----
  .../dc/clk_mgr/dce112/dce112_clk_mgr.c        | 17 -----
  .../dc/clk_mgr/dce120/dce120_clk_mgr.c        | 16 -----
  .../amd/display/dc/inc/hw/clk_mgr_internal.h  |  2 -
  5 files changed, 122 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -15
index bef9a72f3382f..4303a42a7fe37 100644
@@ -62,32 +62,6 @@ static const struct clk_mgr_mask disp_clk_mask = {
  		CLK_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
  };
 
-/* Max clock values for each state indexed by "enum clocks_state": */
-static const struct state_dependent_clocks dce60_max_clks_by_state[] = {
-/* ClocksStateInvalid - should not be used */
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/* ClocksStateUltraLow - not expected to be used for DCE 6.0 */
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/* ClocksStateLow */
-{ .display_clk_khz = 352000, .pixel_clk_khz = 330000},
-/* ClocksStateNominal */
-{ .display_clk_khz = 600000, .pixel_clk_khz = 400000 },
-/* ClocksStatePerformance */
-{ .display_clk_khz = 600000, .pixel_clk_khz = 400000 } };
-
-/* Max clock values for each state indexed by "enum clocks_state": */
-static const struct state_dependent_clocks dce80_max_clks_by_state[] = {

drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c static const struct clk_mgr_mask disp_clk_mask = { · line 89

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -10
-/* ClocksStateInvalid - should not be used */
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/* ClocksStateUltraLow - not expected to be used for DCE 8.0 */
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/* ClocksStateLow */
-{ .display_clk_khz = 352000, .pixel_clk_khz = 330000},
-/* ClocksStateNominal */
-{ .display_clk_khz = 625000, .pixel_clk_khz = 400000 },
-/* ClocksStatePerformance */
-{ .display_clk_khz = 625000, .pixel_clk_khz = 400000 } };

Can you drop the whole struct state_dependent_clocks as well?

Quoted 186 lines
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +0 -46
-
  int dentist_get_divider_from_did(int did)
  {
  	if (did < DENTIST_BASE_DID_1)
@@ -268,7 +242,6 @@ static void dce_clock_read_integrated_info(struct clk_mgr_internal *clk_mgr_dce)
  {
  	struct dc_debug_options *debug = &clk_mgr_dce->base.ctx->dc->debug;
  	struct dc_bios *bp = clk_mgr_dce->base.ctx->dc_bios;
-	int i;
 
  	if (bp->integrated_info)
  		clk_mgr_dce->base.dentist_vco_freq_khz = bp->integrated_info->dentist_vco_freq;
@@ -278,40 +251,6 @@ static void dce_clock_read_integrated_info(struct clk_mgr_internal *clk_mgr_dce)
  			clk_mgr_dce->base.dentist_vco_freq_khz = 3600000;
  	}
 
-	/*update the maximum display clock for each power state*/
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		enum dm_pp_clocks_state clk_state = DM_PP_CLOCKS_STATE_INVALID;
-
-		switch (i) {
-		case 0:
-			clk_state = DM_PP_CLOCKS_STATE_ULTRA_LOW;
-			break;
-
-		case 1:
-			clk_state = DM_PP_CLOCKS_STATE_LOW;
-			break;
-
-		case 2:
-			clk_state = DM_PP_CLOCKS_STATE_NOMINAL;
-			break;
-
-		case 3:
-			clk_state = DM_PP_CLOCKS_STATE_PERFORMANCE;
-			break;
-
-		default:
-			clk_state = DM_PP_CLOCKS_STATE_INVALID;
-			break;
-		}
-
-		/*Do not allow bad VBIOS/SBIOS to override with invalid values,
-		 * check for > 100MHz*/
-		if (bp->integrated_info)
-			if (bp->integrated_info->disp_clk_voltage[i].max_supported_clk >= 100000)
-				clk_mgr_dce->max_clks_by_state[clk_state].display_clk_khz =
-					bp->integrated_info->disp_clk_voltage[i].max_supported_clk;
-	}
-
  	if (!debug->disable_dfs_bypass && bp->integrated_info)
  		if (bp->integrated_info->gpu_cap_info & DFS_BYPASS_ENABLE)
  			clk_mgr_dce->dfs_bypass_enabled = true;
@@ -419,16 +358,6 @@ void dce_clk_mgr_construct(
  {
  	struct clk_mgr *base = &clk_mgr->base;
 
-	if (ctx->dce_version <= DCE_VERSION_6_4)
-		memcpy(clk_mgr->max_clks_by_state,
-			dce60_max_clks_by_state,
-			sizeof(dce60_max_clks_by_state));
-	else
-		memcpy(clk_mgr->max_clks_by_state,
-			dce80_max_clks_by_state,
-			sizeof(dce80_max_clks_by_state));
-
-
  	base->ctx = ctx;
  	base->funcs = &dce_funcs;
 
drivers/gpu/drm/amd/display/dc/clk_mgr/dce110/dce110_clk_mgr.c +0 -16
index ae922f1a31ff8..6144c03e14207 100644
@@ -51,18 +51,6 @@ static const struct clk_mgr_mask disp_clk_mask = {
  		CLK_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
  };
 
-static const struct state_dependent_clocks dce110_max_clks_by_state[] = {
-/*ClocksStateInvalid - should not be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
-{ .display_clk_khz = 352000, .pixel_clk_khz = 330000 },
-/*ClocksStateLow*/
-{ .display_clk_khz = 352000, .pixel_clk_khz = 330000 },
-/*ClocksStateNominal*/
-{ .display_clk_khz = 467000, .pixel_clk_khz = 400000 },
-/*ClocksStatePerformance*/
-{ .display_clk_khz = 643000, .pixel_clk_khz = 400000 } };
-
  static int determine_sclk_from_bounding_box(
  		const struct dc *dc,
  		int required_sclk)
@@ -281,10 +269,6 @@ void dce110_clk_mgr_construct(
  {
  	dce_clk_mgr_construct(ctx, clk_mgr);
 
-	memcpy(clk_mgr->max_clks_by_state,
-		dce110_max_clks_by_state,
-		sizeof(dce110_max_clks_by_state));
-
  	clk_mgr->regs = &disp_clk_regs;
  	clk_mgr->clk_mgr_shift = &disp_clk_shift;
  	clk_mgr->clk_mgr_mask = &disp_clk_mask;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +0 -17
index 0f3f8df4df96a..08ed6f88025fa 100644
@@ -53,19 +53,6 @@ static const struct clk_mgr_mask disp_clk_mask = {
  		CLK_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK)
  };
 
-static const struct state_dependent_clocks dce112_max_clks_by_state[] = {
-/*ClocksStateInvalid - should not be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
-{ .display_clk_khz = 389189, .pixel_clk_khz = 346672 },
-/*ClocksStateLow*/
-{ .display_clk_khz = 459000, .pixel_clk_khz = 400000 },
-/*ClocksStateNominal*/
-{ .display_clk_khz = 667000, .pixel_clk_khz = 600000 },
-/*ClocksStatePerformance*/
-{ .display_clk_khz = 1132000, .pixel_clk_khz = 600000 } };
-
-
  //TODO: remove use the two broken down functions
  int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz)
  {
@@ -202,10 +189,6 @@ void dce112_clk_mgr_construct(
  {
  	dce_clk_mgr_construct(ctx, clk_mgr);
 
-	memcpy(clk_mgr->max_clks_by_state,
-		dce112_max_clks_by_state,
-		sizeof(dce112_max_clks_by_state));
-
  	clk_mgr->regs = &disp_clk_regs;
  	clk_mgr->clk_mgr_shift = &disp_clk_shift;
  	clk_mgr->clk_mgr_mask = &disp_clk_mask;
drivers/gpu/drm/amd/display/dc/clk_mgr/dce120/dce120_clk_mgr.c +0 -16
index c9ba7b3fd2c32..f8ef3a4710fc2 100644
@@ -32,18 +32,6 @@
  #include "dce100/dce_clk_mgr.h"
  #include "dce120/dce120_hwseq.h"
 
-static const struct state_dependent_clocks dce120_max_clks_by_state[] = {
-/*ClocksStateInvalid - should not be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateLow*/
-{ .display_clk_khz = 460000, .pixel_clk_khz = 400000 },
-/*ClocksStateNominal*/
-{ .display_clk_khz = 670000, .pixel_clk_khz = 600000 },
-/*ClocksStatePerformance*/
-{ .display_clk_khz = 1133000, .pixel_clk_khz = 600000 } };
-
  /**
   * dce121_clock_patch_xgmi_ss_info() - Save XGMI spread spectrum info
   * @clk_mgr_dce: clock manager internal structure
@@ -129,10 +117,6 @@ void dce120_clk_mgr_construct(struct dc_context *ctx, struct clk_mgr_internal *c
  {
  	dce_clk_mgr_construct(ctx, clk_mgr);
 
-	memcpy(clk_mgr->max_clks_by_state,
-		dce120_max_clks_by_state,
-		sizeof(dce120_max_clks_by_state));
-
  	clk_mgr->base.dprefclk_khz = 600000;
  	clk_mgr->base.funcs = &dce120_funcs;
  }
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +0 -2
index e01bf6bd7f3f4..5accf076a3747 100644
@@ -429,8 +429,6 @@ struct clk_mgr_internal {
  	const struct clk_mgr_shift *clk_mgr_shift;
  	const struct clk_mgr_mask *clk_mgr_mask;
 
-	struct state_dependent_clocks max_clks_by_state[DM_PP_CLOCKS_MAX_STATES];
-
  	/*TODO: figure out which of the below fields should be here vs in asic specific portion */
  	/* Cache the status of DFS-bypass feature*/
  	bool dfs_bypass_enabled;
#19 lore raw

PATCH 7/14 drm/amd/display: Delete disp_clk_voltage from integrated info

In reply to Timur Kristóf

Only DCE 11.0 relies on this information and even that didn't use this field, because it queries the information from the pplib. It also filled the field incorrectly on that version.

On newer GPUs, the VIOS integrated info no longer contains display clock voltage dependencies, so we don't need it.

---
 .../gpu/drm/amd/display/dc/bios/bios_parser.c | 36 -------------------
 .../drm/amd/display/dc/bios/bios_parser2.c    |  9 -----
 .../display/include/grph_object_ctrl_defs.h   |  9 -----
 3 files changed, 54 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -36
index 25c94962e1415..298a70852c1a8 100644
@@ -2348,15 +2348,6 @@ static enum bp_result get_integrated_info_v8(
 	info->dentist_vco_freq = le32_to_cpu(info_v8->ulDentistVCOFreq) * 10;
 	info->boot_up_uma_clock = le32_to_cpu(info_v8->ulBootUpUMAClock) * 10;
 
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		/* Convert [10KHz] into [KHz] */
-		info->disp_clk_voltage[i].max_supported_clk =
-			le32_to_cpu(info_v8->sDISPCLK_Voltage[i].
-				    ulMaximumSupportedCLK) * 10;
-		info->disp_clk_voltage[i].voltage_index =
-			le32_to_cpu(info_v8->sDISPCLK_Voltage[i].ulVoltageIndex);
-	}
-
 	info->boot_up_req_display_vector =
 		le32_to_cpu(info_v8->ulBootUpReqDisplayVector);
 	info->gpu_cap_info =
@@ -2499,14 +2490,6 @@ static enum bp_result get_integrated_info_v9(
 	info->dentist_vco_freq = le32_to_cpu(info_v9->ulDentistVCOFreq) * 10;
 	info->boot_up_uma_clock = le32_to_cpu(info_v9->ulBootUpUMAClock) * 10;
 
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		/* Convert [10KHz] into [KHz] */
-		info->disp_clk_voltage[i].max_supported_clk =
-			le32_to_cpu(info_v9->sDISPCLK_Voltage[i].ulMaximumSupportedCLK) * 10;
-		info->disp_clk_voltage[i].voltage_index =
-			le32_to_cpu(info_v9->sDISPCLK_Voltage[i].ulVoltageIndex);
-	}
-
 	info->boot_up_req_display_vector =
 		le32_to_cpu(info_v9->ulBootUpReqDisplayVector);
 	info->gpu_cap_info = le32_to_cpu(info_v9->ulGPUCapInfo);
@@ -2648,25 +2631,6 @@ static enum bp_result construct_integrated_info(
 		}
 	}
 
-	/* Sort voltage table from low to high*/
-	if (result == BP_RESULT_OK) {
-		int32_t i;
-		int32_t j;
-
-		for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-			for (j = i; j > 0; --j) {
-				if (
-						info->disp_clk_voltage[j].max_supported_clk <
-						info->disp_clk_voltage[j-1].max_supported_clk) {
-					/* swap j and j - 1*/
-					swap(info->disp_clk_voltage[j - 1],
-					     info->disp_clk_voltage[j]);
-				}
-			}
-		}
-
-	}
-
 	return result;
 }
 
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -9
index b4dd8219b8f09..0e7250f1d3f73 100644
@@ -3023,7 +3023,6 @@ static enum bp_result construct_integrated_info(
 	struct atom_data_revision revision;
 
 	int32_t i;
-	int32_t j;
 
 	if (!info)
 		return result;
@@ -3125,14 +3124,6 @@ static enum bp_result construct_integrated_info(
 			DC_LOG_BIOS("driver forced fixdpvoltageswing = %d\n", info->ext_disp_conn_info.fixdpvoltageswing);
 		}
 	}
-	/* Sort voltage table from low to high*/
-	for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		for (j = i; j > 0; --j) {
-			if (info->disp_clk_voltage[j].max_supported_clk <
-			    info->disp_clk_voltage[j-1].max_supported_clk)
-				swap(info->disp_clk_voltage[j-1], info->disp_clk_voltage[j]);
-		}
-	}
 
 	return result;
 }
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +0 -9
index 38a77fa9b4afd..130d377f4f1d2 100644
@@ -269,7 +269,6 @@ struct transmitter_configuration {
 #define NUMBER_OF_UCHAR_FOR_GUID 16
 #define MAX_NUMBER_OF_EXT_DISPLAY_PATH 7
 #define NUMBER_OF_CSR_M3_ARB 10
-#define NUMBER_OF_DISP_CLK_VOLTAGE 4
 #define NUMBER_OF_AVAILABLE_SCLK 5
 
 struct i2c_reg_info {
@@ -298,14 +297,6 @@ struct edp_info {
 
 /* V6 */
 struct integrated_info {
-	struct clock_voltage_caps {
-		/* The Voltage Index indicated by FUSE, same voltage index
-		shared with SCLK DPM fuse table */
-		uint32_t voltage_index;
-		/* Maximum clock supported with specified voltage index */
-		uint32_t max_supported_clk; /* in KHz */
-	} disp_clk_voltage[NUMBER_OF_DISP_CLK_VOLTAGE];
-
 	struct display_connection_info {
 		struct external_display_path {
 			/* A bit vector to show what devices are supported */
Signature · 1 line
2.53.0
#20 lore raw

Re: [PATCH 07/14] drm/amd/display: Delete disp_clk_voltage from integrated info

Quoted 90 lines · Timur Kristóf

Only DCE 11.0 relies on this information and even that didn't use this field, because it queries the information from the pplib. It also filled the field incorrectly on that version.

On newer GPUs, the VIOS integrated info no longer contains display clock voltage dependencies, so we don't need it.

---
  .../gpu/drm/amd/display/dc/bios/bios_parser.c | 36 -------------------
  .../drm/amd/display/dc/bios/bios_parser2.c    |  9 -----
  .../display/include/grph_object_ctrl_defs.h   |  9 -----
  3 files changed, 54 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -36
index 25c94962e1415..298a70852c1a8 100644
@@ -2348,15 +2348,6 @@ static enum bp_result get_integrated_info_v8(
  	info->dentist_vco_freq = le32_to_cpu(info_v8->ulDentistVCOFreq) * 10;
  	info->boot_up_uma_clock = le32_to_cpu(info_v8->ulBootUpUMAClock) * 10;
 
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		/* Convert [10KHz] into [KHz] */
-		info->disp_clk_voltage[i].max_supported_clk =
-			le32_to_cpu(info_v8->sDISPCLK_Voltage[i].
-				    ulMaximumSupportedCLK) * 10;
-		info->disp_clk_voltage[i].voltage_index =
-			le32_to_cpu(info_v8->sDISPCLK_Voltage[i].ulVoltageIndex);
-	}
-
  	info->boot_up_req_display_vector =
  		le32_to_cpu(info_v8->ulBootUpReqDisplayVector);
  	info->gpu_cap_info =
@@ -2499,14 +2490,6 @@ static enum bp_result get_integrated_info_v9(
  	info->dentist_vco_freq = le32_to_cpu(info_v9->ulDentistVCOFreq) * 10;
  	info->boot_up_uma_clock = le32_to_cpu(info_v9->ulBootUpUMAClock) * 10;
 
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		/* Convert [10KHz] into [KHz] */
-		info->disp_clk_voltage[i].max_supported_clk =
-			le32_to_cpu(info_v9->sDISPCLK_Voltage[i].ulMaximumSupportedCLK) * 10;
-		info->disp_clk_voltage[i].voltage_index =
-			le32_to_cpu(info_v9->sDISPCLK_Voltage[i].ulVoltageIndex);
-	}
-
  	info->boot_up_req_display_vector =
  		le32_to_cpu(info_v9->ulBootUpReqDisplayVector);
  	info->gpu_cap_info = le32_to_cpu(info_v9->ulGPUCapInfo);
@@ -2648,25 +2631,6 @@ static enum bp_result construct_integrated_info(
  		}
  	}
 
-	/* Sort voltage table from low to high*/
-	if (result == BP_RESULT_OK) {
-		int32_t i;
-		int32_t j;
-
-		for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-			for (j = i; j > 0; --j) {
-				if (
-						info->disp_clk_voltage[j].max_supported_clk <
-						info->disp_clk_voltage[j-1].max_supported_clk) {
-					/* swap j and j - 1*/
-					swap(info->disp_clk_voltage[j - 1],
-					     info->disp_clk_voltage[j]);
-				}
-			}
-		}
-
-	}
-
  	return result;
  }
 
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -1
index b4dd8219b8f09..0e7250f1d3f73 100644
@@ -3023,7 +3023,6 @@ static enum bp_result construct_integrated_info(
  	struct atom_data_revision revision;
 
  	int32_t i;
-	int32_t j;
 
  	if (!info)
  		return result;
@@ -3125,14 +3124,6 @@ static enum bp_result construct_integrated_info(
  			DC_LOG_BIOS("driver forced fixdpvoltageswing = %d\n", info->ext_disp_conn_info.fixdpvoltageswing);

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c static enum bp_result construct_integrated_info( · line 3135

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -8
  		}
  	}
-	/* Sort voltage table from low to high*/
-	for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		for (j = i; j > 0; --j) {
-			if (info->disp_clk_voltage[j].max_supported_clk <
-			    info->disp_clk_voltage[j-1].max_supported_clk)
-				swap(info->disp_clk_voltage[j-1], info->disp_clk_voltage[j]);
-		}
-	}

I see in get_integrated_info_v11() a big portion of very old unused code guarded by a #if 0 that uses NUMBER_OF_DISP_CLK_VOLTAGE but probably doesn't make sense anymore. How about removing it too?

Quoted 30 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -0
  	return result;
  }
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +0 -9
index 38a77fa9b4afd..130d377f4f1d2 100644
@@ -269,7 +269,6 @@ struct transmitter_configuration {
  #define NUMBER_OF_UCHAR_FOR_GUID 16
  #define MAX_NUMBER_OF_EXT_DISPLAY_PATH 7
  #define NUMBER_OF_CSR_M3_ARB 10
-#define NUMBER_OF_DISP_CLK_VOLTAGE 4
  #define NUMBER_OF_AVAILABLE_SCLK 5
 
  struct i2c_reg_info {
@@ -298,14 +297,6 @@ struct edp_info {
 
  /* V6 */
  struct integrated_info {
-	struct clock_voltage_caps {
-		/* The Voltage Index indicated by FUSE, same voltage index
-		shared with SCLK DPM fuse table */
-		uint32_t voltage_index;
-		/* Maximum clock supported with specified voltage index */
-		uint32_t max_supported_clk; /* in KHz */
-	} disp_clk_voltage[NUMBER_OF_DISP_CLK_VOLTAGE];
-
  	struct display_connection_info {
  		struct external_display_path {
  			/* A bit vector to show what devices are supported */
#21 lore raw

Re: [PATCH 07/14] drm/amd/display: Delete disp_clk_voltage from integrated info

Quoted 17 lines · On 2026. április 29., szerda 22:35:16 közép-európai nyári idő Melissa Wen wrote:
Quoted 16 lines · Timur Kristóf

Only DCE 11.0 relies on this information and even that didn't use this field, because it queries the information from the pplib. It also filled the field incorrectly on that version.

On newer GPUs, the VIOS integrated info no longer contains display clock voltage dependencies, so we don't need it.

---

  .../gpu/drm/amd/display/dc/bios/bios_parser.c | 36 -------------------
  .../drm/amd/display/dc/bios/bios_parser2.c    |  9 -----
  .../display/include/grph_object_ctrl_defs.h   |  9 -----
  3 files changed, 54 deletions(-)
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result get_integrated_info_v8( · line 2349

Quoted 8 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/bios/bios_parser.c index 25c94962e1415..298a70852c1a8 100644

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -0
@@ -2348,15 +2348,6 @@ static enum bp_result get_integrated_info_v8(
 
  	info->dentist_vco_freq = le32_to_cpu(info_v8->ulDentistVCOFreq) * 

10;

Quoted 1 line

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result get_integrated_info_v8( · line 2350

Quoted 1 line
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -0
  	info->boot_up_uma_clock = le32_to_cpu(info_v8->ulBootUpUMAClock) 

* 10;

Quoted 14 lines

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result get_integrated_info_v8(

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -7
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		/* Convert [10KHz] into [KHz] */
-		info->disp_clk_voltage[i].max_supported_clk =
-			le32_to_cpu(info_v8->sDISPCLK_Voltage[i].
-				    ulMaximumSupportedCLK) * 10;
-		info->disp_clk_voltage[i].voltage_index =
-			le32_to_cpu(info_v8-

sDISPCLK_Voltage[i].ulVoltageIndex);

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -2
-	}
-
 
  	info->boot_up_req_display_vector =
 
Quoted 7 lines

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result get_integrated_info_v9( · line 2491

Quoted 7 lines
  		le32_to_cpu(info_v8->ulBootUpReqDisplayVector);

info->gpu_cap_info =

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -0
@@ -2499,14 +2490,6 @@ static enum bp_result get_integrated_info_v9(
 
  	info->dentist_vco_freq = le32_to_cpu(info_v9->ulDentistVCOFreq) * 

10;

Quoted 1 line

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result get_integrated_info_v9( · line 2492

Quoted 1 line
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -0
  	info->boot_up_uma_clock = le32_to_cpu(info_v9->ulBootUpUMAClock) 

* 10;

Quoted 65 lines

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result get_integrated_info_v8(

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -4
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		/* Convert [10KHz] into [KHz] */
-		info->disp_clk_voltage[i].max_supported_clk =
-			le32_to_cpu(info_v9-

sDISPCLK_Voltage[i].ulMaximumSupportedCLK) * 10;

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result get_integrated_info_v9( · line 2507

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -2
-		info->disp_clk_voltage[i].voltage_index =
-			le32_to_cpu(info_v9-

sDISPCLK_Voltage[i].ulVoltageIndex);

Quoted 14 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -2
-	}
-
 
  	info->boot_up_req_display_vector =
 
  		le32_to_cpu(info_v9->ulBootUpReqDisplayVector);
  	
  	info->gpu_cap_info = le32_to_cpu(info_v9->ulGPUCapInfo);
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -0
@@ -2648,25 +2631,6 @@ static enum bp_result construct_integrated_info(
 
  		}
 
  	}

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result construct_integrated_info( · line 2661

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -9
 
-	/* Sort voltage table from low to high*/
-	if (result == BP_RESULT_OK) {
-		int32_t i;
-		int32_t j;
-
-		for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-			for (j = i; j > 0; --j) {
-				if (
-						info-

disp_clk_voltage[j].max_supported_clk <

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result construct_integrated_info( · line 2662

Quoted 1 line
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -1
-						info-

disp_clk_voltage[j-1].max_supported_clk) {

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result construct_integrated_info( · line 2664

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -2
-					/* swap j and j - 1*/
-					swap(info-

disp_clk_voltage[j - 1],

drivers/gpu/drm/amd/display/dc/bios/bios_parser.c static enum bp_result construct_integrated_info( · line 2665

Quoted 1 line
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -1
-					     info-

disp_clk_voltage[j]);

Quoted 24 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -6
-				}
-			}
-		}
-
-	}
-
 

return result;

  }
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c index b4dd8219b8f09..0e7250f1d3f73 100644

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -1
@@ -3023,7 +3023,6 @@ static enum bp_result construct_integrated_info(
 
  	struct atom_data_revision revision;
 
  	int32_t i;
 
-	int32_t j;
 
Quoted 7 lines

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c static enum bp_result construct_integrated_info( · line 3125

Quoted 7 lines

if (!info)

return result;

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -0
@@ -3125,14 +3124,6 @@ static enum bp_result construct_integrated_info(
 
  			DC_LOG_BIOS("driver forced fixdpvoltageswing 

= %d\n",

Quoted 6 lines

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c static enum bp_result construct_integrated_info( · line 3126

Quoted 1 line
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -0
  			info-

ext_disp_conn_info.fixdpvoltageswing);>

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -0
  		}
 
  	}
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c static enum bp_result construct_integrated_info( · line 3134

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -4
-	/* Sort voltage table from low to high*/
-	for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		for (j = i; j > 0; --j) {
-			if (info-

disp_clk_voltage[j].max_supported_clk <

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c static enum bp_result construct_integrated_info( · line 3135

Quoted 1 line
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -1
-			    info-

disp_clk_voltage[j-1].max_supported_clk)

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c static enum bp_result construct_integrated_info( · line 3136

Quoted 1 line
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -1
-				swap(info->disp_clk_voltage[j-1], 

info->disp_clk_voltage[j]);

Quoted 7 lines

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c static enum bp_result construct_integrated_info( · line 3138

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +0 -2
-		}
-	}

I see in get_integrated_info_v11() a big portion of very old unused code guarded by a #if 0 that uses NUMBER_OF_DISP_CLK_VOLTAGE but probably doesn't make sense anymore.
How about removing it too?

As far as I understand, the VBIOS on newer GPUs doesn't have this information in the integrated info. I don't know what was the intention of that "#if 0". I can remove it if there are no objections from anyone here.

Quoted 22 lines
Quoted 22 lines

return result;

  }
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h index 38a77fa9b4afd..130d377f4f1d2 100644

drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +0 -1
@@ -269,7 +269,6 @@ struct transmitter_configuration {
 
  #define NUMBER_OF_UCHAR_FOR_GUID 16
  #define MAX_NUMBER_OF_EXT_DISPLAY_PATH 7
  #define NUMBER_OF_CSR_M3_ARB 10
 
-#define NUMBER_OF_DISP_CLK_VOLTAGE 4
 
  #define NUMBER_OF_AVAILABLE_SCLK 5
  
  struct i2c_reg_info {
Quoted 7 lines

drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h struct edp_info { · line 303

Quoted 7 lines
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +0 -2
@@ -298,14 +297,6 @@ struct edp_info {
 
  /* V6 */
  struct integrated_info {
 
-	struct clock_voltage_caps {
-		/* The Voltage Index indicated by FUSE, same voltage 

index

Quoted 3 lines

drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h struct edp_info {

Quoted 3 lines
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +0 -3
-		shared with SCLK DPM fuse table */
-		uint32_t voltage_index;
-		/* Maximum clock supported with specified voltage index 

*/

Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h +0 -3
-		uint32_t max_supported_clk; /* in KHz */
-	} disp_clk_voltage[NUMBER_OF_DISP_CLK_VOLTAGE];
-
 
  	struct display_connection_info {
  	
  		struct external_display_path {

/* A bit vector to show what devices are

supported */

#22 lore raw

PATCH 8/14 drm/amd/display: Delete dm_pp_clocks_state

In reply to Timur Kristóf

It isn't used by anything anymore.

---
 .../drm/amd/display/dc/dm_services_types.h    | 27 -------------------
 1 file changed, 27 deletions(-)
drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -27
index 44aa8d213d386..b3505d93503fd 100644
@@ -36,30 +36,7 @@ struct dm_pp_clock_range {
 	int max_khz;
 };
 
-enum dm_pp_clocks_state {
-	DM_PP_CLOCKS_STATE_INVALID,
-	DM_PP_CLOCKS_STATE_ULTRA_LOW,
-	DM_PP_CLOCKS_STATE_LOW,
-	DM_PP_CLOCKS_STATE_NOMINAL,
-	DM_PP_CLOCKS_STATE_PERFORMANCE,
-
-	/* Starting from DCE11, Max 8 levels of DPM state supported. */
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_INVALID = DM_PP_CLOCKS_STATE_INVALID,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_0,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_1,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_2,
-	/* to be backward compatible */
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_3,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_4,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_5,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_6,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_7,
-
-	DM_PP_CLOCKS_MAX_STATES
-};
-
 struct dm_pp_gpu_clock_range {
-	enum dm_pp_clocks_state clock_state;
 	struct dm_pp_clock_range sclk;
 	struct dm_pp_clock_range mclk;
 	struct dm_pp_clock_range eclk;
@@ -246,10 +223,6 @@ enum dm_acpi_display_type {
 	AcpiDisplayType_DFP6 = 12
 };
 
-struct dm_pp_power_level_change_request {
-	enum dm_pp_clocks_state power_level;
-};
-
 struct dm_pp_clock_for_voltage_req {
 	enum dm_pp_clock_type clk_type;
 	uint32_t clocks_in_khz;
Signature · 1 line
2.53.0
Reviewed-by on v1 8/14
#23 lore raw

Re: [PATCH 08/14] drm/amd/display: Delete dm_pp_clocks_state

Quoted 43 lines · Timur Kristóf

It isn't used by anything anymore.

---
  .../drm/amd/display/dc/dm_services_types.h    | 27 -------------------
  1 file changed, 27 deletions(-)
drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -23
index 44aa8d213d386..b3505d93503fd 100644
@@ -36,30 +36,7 @@ struct dm_pp_clock_range {
  	int max_khz;
  };
 
-enum dm_pp_clocks_state {
-	DM_PP_CLOCKS_STATE_INVALID,
-	DM_PP_CLOCKS_STATE_ULTRA_LOW,
-	DM_PP_CLOCKS_STATE_LOW,
-	DM_PP_CLOCKS_STATE_NOMINAL,
-	DM_PP_CLOCKS_STATE_PERFORMANCE,
-
-	/* Starting from DCE11, Max 8 levels of DPM state supported. */
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_INVALID = DM_PP_CLOCKS_STATE_INVALID,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_0,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_1,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_2,
-	/* to be backward compatible */
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_3,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_4,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_5,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_6,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_7,
-
-	DM_PP_CLOCKS_MAX_STATES
-};
-
  struct dm_pp_gpu_clock_range {
-	enum dm_pp_clocks_state clock_state;
  	struct dm_pp_clock_range sclk;
  	struct dm_pp_clock_range mclk;
  	struct dm_pp_clock_range eclk;

drivers/gpu/drm/amd/display/dc/dm_services_types.h enum dm_acpi_display_type { · line 251

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -3
@@ -246,10 +223,6 @@ enum dm_acpi_display_type {
  	AcpiDisplayType_DFP6 = 12
  };
 
-struct dm_pp_power_level_change_request {
-	enum dm_pp_clocks_state power_level;
-};

Ah, okay, here is the dm_pp_power_level_change_request removal. I think it should be removed earlier.

Apart from that,

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -1
-
  struct dm_pp_clock_for_voltage_req {
  	enum dm_pp_clock_type clk_type;
  	uint32_t clocks_in_khz;
#24 lore raw

Re: [PATCH 08/14] drm/amd/display: Delete dm_pp_clocks_state

Quoted 55 lines · On 2026. április 29., szerda 22:37:38 közép-európai nyári idő Melissa Wen wrote:
Quoted 54 lines · Timur Kristóf

It isn't used by anything anymore.

---

  .../drm/amd/display/dc/dm_services_types.h    | 27 -------------------
  1 file changed, 27 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/dm_services_types.h index 44aa8d213d386..b3505d93503fd 100644

drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -23
@@ -36,30 +36,7 @@ struct dm_pp_clock_range {
 
  	int max_khz;
 
  };
 
-enum dm_pp_clocks_state {
-	DM_PP_CLOCKS_STATE_INVALID,
-	DM_PP_CLOCKS_STATE_ULTRA_LOW,
-	DM_PP_CLOCKS_STATE_LOW,
-	DM_PP_CLOCKS_STATE_NOMINAL,
-	DM_PP_CLOCKS_STATE_PERFORMANCE,
-
-	/* Starting from DCE11, Max 8 levels of DPM state supported. */
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_INVALID = DM_PP_CLOCKS_STATE_INVALID,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_0,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_1,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_2,
-	/* to be backward compatible */
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_3,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_4,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_5,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_6,
-	DM_PP_CLOCKS_DPM_STATE_LEVEL_7,
-
-	DM_PP_CLOCKS_MAX_STATES
-};
-
 
  struct dm_pp_gpu_clock_range {
 
-	enum dm_pp_clocks_state clock_state;
 
  	struct dm_pp_clock_range sclk;
  	struct dm_pp_clock_range mclk;
  	struct dm_pp_clock_range eclk;
@@ -246,10 +223,6 @@ enum dm_acpi_display_type {
 
  	AcpiDisplayType_DFP6 = 12
 
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/dm_services_types.h enum dm_acpi_display_type { · line 251

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -3
  };
 
-struct dm_pp_power_level_change_request {
-	enum dm_pp_clocks_state power_level;
-};

Ah, okay, here is the dm_pp_power_level_change_request removal. I think it should be removed earlier.

Thanks. In the next version of the series I will move it to earlier.

Quoted 11 lines

Apart from that,

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dm_services_types.h +0 -1
-
 
  struct dm_pp_clock_for_voltage_req {

enum dm_pp_clock_type clk_type;
uint32_t clocks_in_khz;

#25 lore raw

PATCH 9/14 drm/amd/pm: Delete unused get_display_power_level() function

In reply to Timur Kristóf

Was not called from anywhere.

---
 drivers/gpu/drm/amd/include/kgd_pp_interface.h   |  2 --
 drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 12 ------------
 2 files changed, 14 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +0 -2
index 1bbf531de5ed7..ac05a12e71bdf 100644
@@ -476,8 +476,6 @@ struct amd_pm_funcs {
 	u32 (*get_mclk)(void *handle, bool low);
 	int (*display_configuration_change)(void *handle,
 		const struct amd_pp_display_configuration *input);
-	int (*get_display_power_level)(void *handle,
-		struct amd_pp_simple_clock_info *output);
 	int (*get_current_clocks)(void *handle,
 		struct amd_pp_clock_info *clocks);
 	int (*get_clock_by_type)(void *handle,
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +0 -12
index 0bbb89788335e..4c2c40e8123bf 100644
@@ -1020,17 +1020,6 @@ static int pp_display_configuration_change(void *handle,
 	return 0;
 }
 
-static int pp_get_display_power_level(void *handle,
-		struct amd_pp_simple_clock_info *output)
-{
-	struct pp_hwmgr *hwmgr = handle;
-
-	if (!hwmgr || !hwmgr->pm_en || !output)
-		return -EINVAL;
-
-	return phm_get_dal_power_level(hwmgr, output);
-}
-
 static int pp_get_current_clocks(void *handle,
 		struct amd_pp_clock_info *clocks)
 {
@@ -1588,7 +1577,6 @@ static const struct amd_pm_funcs pp_dpm_funcs = {
 	.get_sclk = pp_dpm_get_sclk,
 	.get_mclk = pp_dpm_get_mclk,
 	.display_configuration_change = pp_display_configuration_change,
-	.get_display_power_level = pp_get_display_power_level,
 	.get_current_clocks = pp_get_current_clocks,
 	.get_clock_by_type = pp_get_clock_by_type,
 	.get_clock_by_type_with_latency = pp_get_clock_by_type_with_latency,
Signature · 1 line
2.53.0
Reviewed-by on v1 9/14
#26 lore raw

Re: [PATCH 09/14] drm/amd/pm: Delete unused get_display_power_level() function

Quoted 1 line · Timur Kristóf

Was not called from anywhere.

LGTM.

Quoted 50 lines
---
  drivers/gpu/drm/amd/include/kgd_pp_interface.h   |  2 --
  drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 12 ------------
  2 files changed, 14 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +0 -2
index 1bbf531de5ed7..ac05a12e71bdf 100644
@@ -476,8 +476,6 @@ struct amd_pm_funcs {
  	u32 (*get_mclk)(void *handle, bool low);
  	int (*display_configuration_change)(void *handle,
  		const struct amd_pp_display_configuration *input);
-	int (*get_display_power_level)(void *handle,
-		struct amd_pp_simple_clock_info *output);
  	int (*get_current_clocks)(void *handle,
  		struct amd_pp_clock_info *clocks);
  	int (*get_clock_by_type)(void *handle,
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +0 -12
index 0bbb89788335e..4c2c40e8123bf 100644
@@ -1020,17 +1020,6 @@ static int pp_display_configuration_change(void *handle,
  	return 0;
  }
 
-static int pp_get_display_power_level(void *handle,
-		struct amd_pp_simple_clock_info *output)
-{
-	struct pp_hwmgr *hwmgr = handle;
-
-	if (!hwmgr || !hwmgr->pm_en || !output)
-		return -EINVAL;
-
-	return phm_get_dal_power_level(hwmgr, output);
-}
-
  static int pp_get_current_clocks(void *handle,
  		struct amd_pp_clock_info *clocks)
  {
@@ -1588,7 +1577,6 @@ static const struct amd_pm_funcs pp_dpm_funcs = {
  	.get_sclk = pp_dpm_get_sclk,
  	.get_mclk = pp_dpm_get_mclk,
  	.display_configuration_change = pp_display_configuration_change,
-	.get_display_power_level = pp_get_display_power_level,
  	.get_current_clocks = pp_get_current_clocks,
  	.get_clock_by_type = pp_get_clock_by_type,
  	.get_clock_by_type_with_latency = pp_get_clock_by_type_with_latency,
#27 lore raw

PATCH 10/14 drm/amd/pm: Delete dummy get_dal_power_level implementations

In reply to Timur Kristóf

These implementations did not actually return
the DAL power level, so they were effectively
a no-op.

---
 .../drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c    |  7 -------
 .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c   | 15 ---------------
 .../drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c   | 16 ----------------
 .../drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c   | 17 -----------------
 4 files changed, 55 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +0 -7
index 8de8d66df95f4..5be6f82ecc6f5 100644
@@ -963,12 +963,6 @@ static int smu10_store_cc6_data(struct pp_hwmgr *hwmgr, uint32_t separation_time
 	return 0;
 }
 
-static int smu10_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-	return -EINVAL;
-}
-
 static int smu10_force_clock_level(struct pp_hwmgr *hwmgr,
 		enum pp_clock_type type, uint32_t mask)
 {
@@ -1664,7 +1658,6 @@ static const struct pp_hwmgr_func smu10_hwmgr_funcs = {
 	.store_cc6_data = smu10_store_cc6_data,
 	.force_clock_level = smu10_force_clock_level,
 	.emit_clock_levels = smu10_emit_clock_levels,
-	.get_dal_power_level = smu10_get_dal_power_level,
 	.get_performance_level = smu10_get_performance_level,
 	.get_current_shallow_sleep_clocks = smu10_get_current_shallow_sleep_clocks,
 	.get_clock_by_type_with_latency = smu10_get_clock_by_type_with_latency,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +0 -15
index 1b8a57d987597..12f47ec87997d 100644
@@ -4387,20 +4387,6 @@ static uint32_t vega10_get_fan_control_mode(struct pp_hwmgr *hwmgr)
 		return AMD_FAN_CTRL_AUTO;
 }
 
-static int vega10_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-	struct phm_ppt_v2_information *table_info =
-			(struct phm_ppt_v2_information *)hwmgr->pptable;
-	struct phm_clock_and_voltage_limits *max_limits =
-			&table_info->max_clock_voltage_on_ac;
-
-	info->engine_max_clock = max_limits->sclk;
-	info->memory_max_clock = max_limits->mclk;
-
-	return 0;
-}
-
 static void vega10_get_sclks(struct pp_hwmgr *hwmgr,
 		struct pp_clock_levels_with_latency *clocks)
 {
@@ -5645,7 +5631,6 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
 	.set_fan_control_mode = vega10_set_fan_control_mode,
 	.get_fan_control_mode = vega10_get_fan_control_mode,
 	.read_sensor = vega10_read_sensor,
-	.get_dal_power_level = vega10_get_dal_power_level,
 	.get_clock_by_type_with_latency = vega10_get_clock_by_type_with_latency,
 	.get_clock_by_type_with_voltage = vega10_get_clock_by_type_with_voltage,
 	.set_watermarks_for_clocks_ranges = vega10_set_watermarks_for_clocks_ranges,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +0 -16
index 5a987a535e73e..6f2bb8fe0317e 100644
@@ -1822,21 +1822,6 @@ static uint32_t vega12_get_fan_control_mode(struct pp_hwmgr *hwmgr)
 		return AMD_FAN_CTRL_AUTO;
 }
 
-static int vega12_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-#if 0
-	struct phm_ppt_v2_information *table_info =
-			(struct phm_ppt_v2_information *)hwmgr->pptable;
-	struct phm_clock_and_voltage_limits *max_limits =
-			&table_info->max_clock_voltage_on_ac;
-
-	info->engine_max_clock = max_limits->sclk;
-	info->memory_max_clock = max_limits->mclk;
-#endif
-	return 0;
-}
-
 static int vega12_get_clock_ranges(struct pp_hwmgr *hwmgr,
 		uint32_t *clock,
 		PPCLK_e clock_select,
@@ -2963,7 +2948,6 @@ static const struct pp_hwmgr_func vega12_hwmgr_funcs = {
 	.set_fan_control_mode = vega12_set_fan_control_mode,
 	.get_fan_control_mode = vega12_get_fan_control_mode,
 	.read_sensor = vega12_read_sensor,
-	.get_dal_power_level = vega12_get_dal_power_level,
 	.get_clock_by_type_with_latency = vega12_get_clock_by_type_with_latency,
 	.get_clock_by_type_with_voltage = vega12_get_clock_by_type_with_voltage,
 	.set_watermarks_for_clocks_ranges = vega12_set_watermarks_for_clocks_ranges,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +0 -17
index 5193b7d0e11be..2a06d3e0253fb 100644
@@ -2796,22 +2796,6 @@ static void vega20_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
 	}
 }
 
-static int vega20_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-#if 0
-	struct phm_ppt_v2_information *table_info =
-			(struct phm_ppt_v2_information *)hwmgr->pptable;
-	struct phm_clock_and_voltage_limits *max_limits =
-			&table_info->max_clock_voltage_on_ac;
-
-	info->engine_max_clock = max_limits->sclk;
-	info->memory_max_clock = max_limits->mclk;
-#endif
-	return 0;
-}
-
-
 static int vega20_get_sclks(struct pp_hwmgr *hwmgr,
 		struct pp_clock_levels_with_latency *clocks)
 {
@@ -4446,7 +4430,6 @@ static const struct pp_hwmgr_func vega20_hwmgr_funcs = {
 	/* export to DAL */
 	.get_sclk = vega20_dpm_get_sclk,
 	.get_mclk = vega20_dpm_get_mclk,
-	.get_dal_power_level = vega20_get_dal_power_level,
 	.get_clock_by_type_with_latency = vega20_get_clock_by_type_with_latency,
 	.get_clock_by_type_with_voltage = vega20_get_clock_by_type_with_voltage,
 	.set_watermarks_for_clocks_ranges = vega20_set_watermarks_for_clocks_ranges,
Signature · 1 line
2.53.0
Reviewed-by on v1 10/14
#28 lore raw

Re: [PATCH 10/14] drm/amd/pm: Delete dummy get_dal_power_level implementations

Quoted 3 lines · Timur Kristóf

These implementations did not actually return
the DAL power level, so they were effectively
a no-op.

Nice catch!

Quoted 136 lines
---
  .../drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c    |  7 -------
  .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c   | 15 ---------------
  .../drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c   | 16 ----------------
  .../drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c   | 17 -----------------
  4 files changed, 55 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +0 -7
index 8de8d66df95f4..5be6f82ecc6f5 100644
@@ -963,12 +963,6 @@ static int smu10_store_cc6_data(struct pp_hwmgr *hwmgr, uint32_t separation_time
  	return 0;
  }
 
-static int smu10_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-	return -EINVAL;
-}
-
  static int smu10_force_clock_level(struct pp_hwmgr *hwmgr,
  		enum pp_clock_type type, uint32_t mask)
  {
@@ -1664,7 +1658,6 @@ static const struct pp_hwmgr_func smu10_hwmgr_funcs = {
  	.store_cc6_data = smu10_store_cc6_data,
  	.force_clock_level = smu10_force_clock_level,
  	.emit_clock_levels = smu10_emit_clock_levels,
-	.get_dal_power_level = smu10_get_dal_power_level,
  	.get_performance_level = smu10_get_performance_level,
  	.get_current_shallow_sleep_clocks = smu10_get_current_shallow_sleep_clocks,
  	.get_clock_by_type_with_latency = smu10_get_clock_by_type_with_latency,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +0 -15
index 1b8a57d987597..12f47ec87997d 100644
@@ -4387,20 +4387,6 @@ static uint32_t vega10_get_fan_control_mode(struct pp_hwmgr *hwmgr)
  		return AMD_FAN_CTRL_AUTO;
  }
 
-static int vega10_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-	struct phm_ppt_v2_information *table_info =
-			(struct phm_ppt_v2_information *)hwmgr->pptable;
-	struct phm_clock_and_voltage_limits *max_limits =
-			&table_info->max_clock_voltage_on_ac;
-
-	info->engine_max_clock = max_limits->sclk;
-	info->memory_max_clock = max_limits->mclk;
-
-	return 0;
-}
-
  static void vega10_get_sclks(struct pp_hwmgr *hwmgr,
  		struct pp_clock_levels_with_latency *clocks)
  {
@@ -5645,7 +5631,6 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
  	.set_fan_control_mode = vega10_set_fan_control_mode,
  	.get_fan_control_mode = vega10_get_fan_control_mode,
  	.read_sensor = vega10_read_sensor,
-	.get_dal_power_level = vega10_get_dal_power_level,
  	.get_clock_by_type_with_latency = vega10_get_clock_by_type_with_latency,
  	.get_clock_by_type_with_voltage = vega10_get_clock_by_type_with_voltage,
  	.set_watermarks_for_clocks_ranges = vega10_set_watermarks_for_clocks_ranges,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +0 -16
index 5a987a535e73e..6f2bb8fe0317e 100644
@@ -1822,21 +1822,6 @@ static uint32_t vega12_get_fan_control_mode(struct pp_hwmgr *hwmgr)
  		return AMD_FAN_CTRL_AUTO;
  }
 
-static int vega12_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-#if 0
-	struct phm_ppt_v2_information *table_info =
-			(struct phm_ppt_v2_information *)hwmgr->pptable;
-	struct phm_clock_and_voltage_limits *max_limits =
-			&table_info->max_clock_voltage_on_ac;
-
-	info->engine_max_clock = max_limits->sclk;
-	info->memory_max_clock = max_limits->mclk;
-#endif
-	return 0;
-}
-
  static int vega12_get_clock_ranges(struct pp_hwmgr *hwmgr,
  		uint32_t *clock,
  		PPCLK_e clock_select,
@@ -2963,7 +2948,6 @@ static const struct pp_hwmgr_func vega12_hwmgr_funcs = {
  	.set_fan_control_mode = vega12_set_fan_control_mode,
  	.get_fan_control_mode = vega12_get_fan_control_mode,
  	.read_sensor = vega12_read_sensor,
-	.get_dal_power_level = vega12_get_dal_power_level,
  	.get_clock_by_type_with_latency = vega12_get_clock_by_type_with_latency,
  	.get_clock_by_type_with_voltage = vega12_get_clock_by_type_with_voltage,
  	.set_watermarks_for_clocks_ranges = vega12_set_watermarks_for_clocks_ranges,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +0 -17
index 5193b7d0e11be..2a06d3e0253fb 100644
@@ -2796,22 +2796,6 @@ static void vega20_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
  	}
  }
 
-static int vega20_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-#if 0
-	struct phm_ppt_v2_information *table_info =
-			(struct phm_ppt_v2_information *)hwmgr->pptable;
-	struct phm_clock_and_voltage_limits *max_limits =
-			&table_info->max_clock_voltage_on_ac;
-
-	info->engine_max_clock = max_limits->sclk;
-	info->memory_max_clock = max_limits->mclk;
-#endif
-	return 0;
-}
-
-
  static int vega20_get_sclks(struct pp_hwmgr *hwmgr,
  		struct pp_clock_levels_with_latency *clocks)
  {
@@ -4446,7 +4430,6 @@ static const struct pp_hwmgr_func vega20_hwmgr_funcs = {
  	/* export to DAL */
  	.get_sclk = vega20_dpm_get_sclk,
  	.get_mclk = vega20_dpm_get_mclk,
-	.get_dal_power_level = vega20_get_dal_power_level,
  	.get_clock_by_type_with_latency = vega20_get_clock_by_type_with_latency,
  	.get_clock_by_type_with_voltage = vega20_get_clock_by_type_with_voltage,
  	.set_watermarks_for_clocks_ranges = vega20_set_watermarks_for_clocks_ranges,
#29 lore raw

PATCH 11/14 drm/amd/pm: Delete non-functional SMU8 get_dal_power_level implementation

In reply to Timur Kristóf

This function was effectively a no-op because it always returned the maximum possible power level, because the maximum voltage is in millivolts while the dependency table didn't contain actual voltages.

---
 .../drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c   | 22 -------------------
 1 file changed, 22 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +0 -22
index 736e5a8af4779..8a37c745cb117 100644
@@ -1522,27 +1522,6 @@ static int smu8_store_cc6_data(struct pp_hwmgr *hwmgr, uint32_t separation_time,
 	return 0;
 }
 
-static int smu8_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-	uint32_t i;
-	const struct phm_clock_voltage_dependency_table *table =
-			hwmgr->dyn_state.vddc_dep_on_dal_pwrl;
-	const struct phm_clock_and_voltage_limits *limits =
-			&hwmgr->dyn_state.max_clock_voltage_on_ac;
-
-	info->engine_max_clock = limits->sclk;
-	info->memory_max_clock = limits->mclk;
-
-	for (i = table->count - 1; i > 0; i--) {
-		if (limits->vddc >= table->entries[i].v) {
-			info->level = table->entries[i].clk;
-			return 0;
-		}
-	}
-	return -EINVAL;
-}
-
 static int smu8_force_clock_level(struct pp_hwmgr *hwmgr,
 		enum pp_clock_type type, uint32_t mask)
 {
@@ -2063,7 +2042,6 @@ static const struct pp_hwmgr_func smu8_hwmgr_funcs = {
 	.store_cc6_data = smu8_store_cc6_data,
 	.force_clock_level = smu8_force_clock_level,
 	.emit_clock_levels = smu8_emit_clock_levels,
-	.get_dal_power_level = smu8_get_dal_power_level,
 	.get_performance_level = smu8_get_performance_level,
 	.get_current_shallow_sleep_clocks = smu8_get_current_shallow_sleep_clocks,
 	.get_clock_by_type = smu8_get_clock_by_type,
Signature · 1 line
2.53.0
Reviewed-by on v1 11/14
#30 lore raw

Re: [PATCH 11/14] drm/amd/pm: Delete non-functional SMU8 get_dal_power_level implementation

Quoted 4 lines · Timur Kristóf

This function was effectively a no-op because it always returned the maximum possible power level, because the maximum voltage is in millivolts while the dependency table didn't contain actual voltages.

Quoted 46 lines
---
  .../drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c   | 22 -------------------
  1 file changed, 22 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +0 -22
index 736e5a8af4779..8a37c745cb117 100644
@@ -1522,27 +1522,6 @@ static int smu8_store_cc6_data(struct pp_hwmgr *hwmgr, uint32_t separation_time,
  	return 0;
  }
 
-static int smu8_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-	uint32_t i;
-	const struct phm_clock_voltage_dependency_table *table =
-			hwmgr->dyn_state.vddc_dep_on_dal_pwrl;
-	const struct phm_clock_and_voltage_limits *limits =
-			&hwmgr->dyn_state.max_clock_voltage_on_ac;
-
-	info->engine_max_clock = limits->sclk;
-	info->memory_max_clock = limits->mclk;
-
-	for (i = table->count - 1; i > 0; i--) {
-		if (limits->vddc >= table->entries[i].v) {
-			info->level = table->entries[i].clk;
-			return 0;
-		}
-	}
-	return -EINVAL;
-}
-
  static int smu8_force_clock_level(struct pp_hwmgr *hwmgr,
  		enum pp_clock_type type, uint32_t mask)
  {
@@ -2063,7 +2042,6 @@ static const struct pp_hwmgr_func smu8_hwmgr_funcs = {
  	.store_cc6_data = smu8_store_cc6_data,
  	.force_clock_level = smu8_force_clock_level,
  	.emit_clock_levels = smu8_emit_clock_levels,
-	.get_dal_power_level = smu8_get_dal_power_level,
  	.get_performance_level = smu8_get_performance_level,
  	.get_current_shallow_sleep_clocks = smu8_get_current_shallow_sleep_clocks,
  	.get_clock_by_type = smu8_get_clock_by_type,
#31 lore raw

PATCH 12/14 drm/amd/pm: Delete vddc_dep_on_dal_pwrl

In reply to Timur Kristóf

It was not used by anything anymore.

---
 .../amd/pm/powerplay/hwmgr/processpptables.c  |  1 -
 .../drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c  | 41 ------------------
 .../drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c   | 42 -------------------
 .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c |  3 --
 drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h  |  2 -
 5 files changed, 89 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/processpptables.c +0 -1
index f06b29e33ba45..00e8f1be87e76 100644
@@ -1324,7 +1324,6 @@ static int init_clock_voltage_dependency(struct pp_hwmgr *hwmgr,
 	hwmgr->dyn_state.vddc_dependency_on_sclk = NULL;
 	hwmgr->dyn_state.vddci_dependency_on_mclk = NULL;
 	hwmgr->dyn_state.vddc_dependency_on_mclk = NULL;
-	hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
 	hwmgr->dyn_state.mvdd_dependency_on_mclk = NULL;
 	hwmgr->dyn_state.vce_clock_voltage_dependency_table = NULL;
 	hwmgr->dyn_state.uvd_clock_voltage_dependency_table = NULL;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +0 -41

59 lines not on this page · raw message

drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +0 -42

60 lines not on this page · raw message

drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +0 -3
index 12f47ec87997d..8b8c4e8998784 100644
@@ -814,9 +814,6 @@ static int vega10_set_private_data_based_on_pptable(struct pp_hwmgr *hwmgr)
 
 static int vega10_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
 {
-	kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
-	hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
-
 	kfree(hwmgr->backend);
 	hwmgr->backend = NULL;
 
drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h +0 -2
index 3ae45eac0c5ca..1ee7e3044272d 100644
@@ -540,7 +540,6 @@ struct phm_ppt_v1_information {
 	struct phm_clock_array *valid_dcefclk_values;
 	struct phm_clock_and_voltage_limits max_clock_voltage_on_dc;
 	struct phm_clock_and_voltage_limits max_clock_voltage_on_ac;
-	struct phm_clock_voltage_dependency_table *vddc_dep_on_dal_pwrl;
 	struct phm_ppm_table *ppm_parameter_table;
 	struct phm_cac_tdp_table *cac_dtp_table;
 	struct phm_tdp_table *tdp_table;
@@ -632,7 +631,6 @@ struct phm_dynamic_state_info {
 	struct phm_clock_voltage_dependency_table *vddc_dependency_on_mclk;
 	struct phm_clock_voltage_dependency_table *mvdd_dependency_on_mclk;
 	struct phm_clock_voltage_dependency_table *vddc_dependency_on_display_clock;
-	struct phm_clock_voltage_dependency_table *vddc_dep_on_dal_pwrl;
 	struct phm_clock_array                    *valid_sclk_values;
 	struct phm_clock_array                    *valid_mclk_values;
 	struct phm_clock_and_voltage_limits       max_clock_voltage_on_dc;
Signature · 1 line
2.53.0
Reviewed-by on v1 12/14
#32 lore raw

Re: [PATCH 12/14] drm/amd/pm: Delete vddc_dep_on_dal_pwrl

Quoted 1 line · Timur Kristóf

It was not used by anything anymore.

Quoted 189 lines
---
  .../amd/pm/powerplay/hwmgr/processpptables.c  |  1 -
  .../drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c  | 41 ------------------
  .../drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c   | 42 -------------------
  .../drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c |  3 --
  drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h  |  2 -
  5 files changed, 89 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/processpptables.c +0 -1
index f06b29e33ba45..00e8f1be87e76 100644
@@ -1324,7 +1324,6 @@ static int init_clock_voltage_dependency(struct pp_hwmgr *hwmgr,
  	hwmgr->dyn_state.vddc_dependency_on_sclk = NULL;
  	hwmgr->dyn_state.vddci_dependency_on_mclk = NULL;
  	hwmgr->dyn_state.vddc_dependency_on_mclk = NULL;
-	hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
  	hwmgr->dyn_state.mvdd_dependency_on_mclk = NULL;
  	hwmgr->dyn_state.vce_clock_voltage_dependency_table = NULL;
  	hwmgr->dyn_state.uvd_clock_voltage_dependency_table = NULL;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +0 -41
index 5be6f82ecc6f5..f5c1f483dec87 100644
@@ -127,42 +127,6 @@ static int smu10_construct_max_power_limits_table(struct pp_hwmgr *hwmgr,
  	return 0;
  }
 
-static int smu10_init_dynamic_state_adjustment_rule_settings(
-							struct pp_hwmgr *hwmgr)
-{
-	int count = 8;
-	struct phm_clock_voltage_dependency_table *table_clk_vlt;
-
-	table_clk_vlt = kzalloc(struct_size(table_clk_vlt, entries, count),
-				GFP_KERNEL);
-
-	if (NULL == table_clk_vlt) {
-		pr_err("Can not allocate memory!\n");
-		return -ENOMEM;
-	}
-
-	table_clk_vlt->count = count;
-	table_clk_vlt->entries[0].clk = PP_DAL_POWERLEVEL_0;
-	table_clk_vlt->entries[0].v = 0;
-	table_clk_vlt->entries[1].clk = PP_DAL_POWERLEVEL_1;
-	table_clk_vlt->entries[1].v = 1;
-	table_clk_vlt->entries[2].clk = PP_DAL_POWERLEVEL_2;
-	table_clk_vlt->entries[2].v = 2;
-	table_clk_vlt->entries[3].clk = PP_DAL_POWERLEVEL_3;
-	table_clk_vlt->entries[3].v = 3;
-	table_clk_vlt->entries[4].clk = PP_DAL_POWERLEVEL_4;
-	table_clk_vlt->entries[4].v = 4;
-	table_clk_vlt->entries[5].clk = PP_DAL_POWERLEVEL_5;
-	table_clk_vlt->entries[5].v = 5;
-	table_clk_vlt->entries[6].clk = PP_DAL_POWERLEVEL_6;
-	table_clk_vlt->entries[6].v = 6;
-	table_clk_vlt->entries[7].clk = PP_DAL_POWERLEVEL_7;
-	table_clk_vlt->entries[7].v = 7;
-	hwmgr->dyn_state.vddc_dep_on_dal_pwrl = table_clk_vlt;
-
-	return 0;
-}
-
  static int smu10_get_system_info_data(struct pp_hwmgr *hwmgr)
  {
  	struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)hwmgr->backend;
@@ -176,8 +140,6 @@ static int smu10_get_system_info_data(struct pp_hwmgr *hwmgr)
  	smu10_construct_max_power_limits_table (hwmgr,
  				    &hwmgr->dyn_state.max_clock_voltage_on_ac);
 
-	smu10_init_dynamic_state_adjustment_rule_settings(hwmgr);
-
  	return 0;
  }
 
@@ -612,9 +574,6 @@ static int smu10_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
  	kfree(pinfo->vdd_dep_on_phyclk);
  	pinfo->vdd_dep_on_phyclk = NULL;
 
-	kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
-	hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
-
  	kfree(hwmgr->backend);
  	hwmgr->backend = NULL;
 
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +0 -42
index 8a37c745cb117..63a1e3748e5cd 100644
@@ -270,42 +270,6 @@ static int smu8_construct_max_power_limits_table(struct pp_hwmgr *hwmgr,
  	return 0;
  }
 
-static int smu8_init_dynamic_state_adjustment_rule_settings(
-			struct pp_hwmgr *hwmgr,
-			ATOM_CLK_VOLT_CAPABILITY *disp_voltage_table)
-{
-	struct phm_clock_voltage_dependency_table *table_clk_vlt;
-
-	table_clk_vlt = kzalloc(struct_size(table_clk_vlt, entries, 8),
-				GFP_KERNEL);
-
-	if (NULL == table_clk_vlt) {
-		pr_err("Can not allocate memory!\n");
-		return -ENOMEM;
-	}
-
-	table_clk_vlt->count = 8;
-	table_clk_vlt->entries[0].clk = PP_DAL_POWERLEVEL_0;
-	table_clk_vlt->entries[0].v = 0;
-	table_clk_vlt->entries[1].clk = PP_DAL_POWERLEVEL_1;
-	table_clk_vlt->entries[1].v = 1;
-	table_clk_vlt->entries[2].clk = PP_DAL_POWERLEVEL_2;
-	table_clk_vlt->entries[2].v = 2;
-	table_clk_vlt->entries[3].clk = PP_DAL_POWERLEVEL_3;
-	table_clk_vlt->entries[3].v = 3;
-	table_clk_vlt->entries[4].clk = PP_DAL_POWERLEVEL_4;
-	table_clk_vlt->entries[4].v = 4;
-	table_clk_vlt->entries[5].clk = PP_DAL_POWERLEVEL_5;
-	table_clk_vlt->entries[5].v = 5;
-	table_clk_vlt->entries[6].clk = PP_DAL_POWERLEVEL_6;
-	table_clk_vlt->entries[6].v = 6;
-	table_clk_vlt->entries[7].clk = PP_DAL_POWERLEVEL_7;
-	table_clk_vlt->entries[7].v = 7;
-	hwmgr->dyn_state.vddc_dep_on_dal_pwrl = table_clk_vlt;
-
-	return 0;
-}
-
  static int smu8_get_system_info_data(struct pp_hwmgr *hwmgr)
  {
  	struct smu8_hwmgr *data = hwmgr->backend;
@@ -404,9 +368,6 @@ static int smu8_get_system_info_data(struct pp_hwmgr *hwmgr)
  	smu8_construct_max_power_limits_table (hwmgr,
  				    &hwmgr->dyn_state.max_clock_voltage_on_ac);
 
-	smu8_init_dynamic_state_adjustment_rule_settings(hwmgr,
-				    &info->sDISPCLK_Voltage[0]);
-
  	return result;
  }
 
@@ -1150,9 +1111,6 @@ static int smu8_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
  static int smu8_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
  {
  	if (hwmgr != NULL) {
-		kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
-		hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
-
  		kfree(hwmgr->backend);
  		hwmgr->backend = NULL;
  	}
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +0 -3
index 12f47ec87997d..8b8c4e8998784 100644
@@ -814,9 +814,6 @@ static int vega10_set_private_data_based_on_pptable(struct pp_hwmgr *hwmgr)
 
  static int vega10_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
  {
-	kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl);
-	hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
-
  	kfree(hwmgr->backend);
  	hwmgr->backend = NULL;
 
drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h +0 -2
index 3ae45eac0c5ca..1ee7e3044272d 100644
@@ -540,7 +540,6 @@ struct phm_ppt_v1_information {
  	struct phm_clock_array *valid_dcefclk_values;
  	struct phm_clock_and_voltage_limits max_clock_voltage_on_dc;
  	struct phm_clock_and_voltage_limits max_clock_voltage_on_ac;
-	struct phm_clock_voltage_dependency_table *vddc_dep_on_dal_pwrl;
  	struct phm_ppm_table *ppm_parameter_table;
  	struct phm_cac_tdp_table *cac_dtp_table;
  	struct phm_tdp_table *tdp_table;
@@ -632,7 +631,6 @@ struct phm_dynamic_state_info {
  	struct phm_clock_voltage_dependency_table *vddc_dependency_on_mclk;
  	struct phm_clock_voltage_dependency_table *mvdd_dependency_on_mclk;
  	struct phm_clock_voltage_dependency_table *vddc_dependency_on_display_clock;
-	struct phm_clock_voltage_dependency_table *vddc_dep_on_dal_pwrl;
  	struct phm_clock_array                    *valid_sclk_values;
  	struct phm_clock_array                    *valid_mclk_values;
  	struct phm_clock_and_voltage_limits       max_clock_voltage_on_dc;
#33 lore raw

PATCH 13/14 drm/amd/pm: Delete get_dal_power_level

In reply to Timur Kristóf

Not needed anymore.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c   |  3 ---
 drivers/gpu/drm/amd/include/dm_pp_interface.h          |  1 -
 drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c       | 10 ----------
 .../gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c   | 10 ----------
 drivers/gpu/drm/amd/pm/powerplay/inc/hardwaremanager.h |  3 ---
 drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h           |  2 --
 6 files changed, 29 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -3
index 2247969aa9acb..90f79d70874cd 100644
@@ -288,7 +288,6 @@ bool dm_pp_get_clock_levels_by_type(
 		DRM_INFO("DM_PPLIB: Warning: using default validation clocks!\n");
 		validation_clks.engine_max_clock = 72000;
 		validation_clks.memory_max_clock = 80000;
-		validation_clks.level = 0;
 	}
 
 	DRM_INFO("DM_PPLIB: Validation clocks:\n");
@@ -296,8 +295,6 @@ bool dm_pp_get_clock_levels_by_type(
 			validation_clks.engine_max_clock);
 	DRM_INFO("DM_PPLIB:    memory_max_clock: %d\n",
 			validation_clks.memory_max_clock);
-	DRM_INFO("DM_PPLIB:    level           : %d\n",
-			validation_clks.level);
 
 	/* Translate 10 kHz to kHz. */
 	validation_clks.engine_max_clock *= 10;
drivers/gpu/drm/amd/include/dm_pp_interface.h +0 -1
index 349544504c93c..10747a1ceda9a 100644
@@ -113,7 +113,6 @@ struct amd_pp_display_configuration {
 struct amd_pp_simple_clock_info {
 	uint32_t	engine_max_clock;
 	uint32_t	memory_max_clock;
-	uint32_t	level;
 };
 
 enum PP_DAL_POWERLEVEL {
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +0 -10
index 4c2c40e8123bf..a53577a83f1b3 100644
@@ -1023,7 +1023,6 @@ static int pp_display_configuration_change(void *handle,
 static int pp_get_current_clocks(void *handle,
 		struct amd_pp_clock_info *clocks)
 {
-	struct amd_pp_simple_clock_info simple_clocks = { 0 };
 	struct pp_clock_info hw_clocks;
 	struct pp_hwmgr *hwmgr = handle;
 	int ret = 0;
@@ -1031,8 +1030,6 @@ static int pp_get_current_clocks(void *handle,
 	if (!hwmgr || !hwmgr->pm_en)
 		return -EINVAL;
 
-	phm_get_dal_power_level(hwmgr, &simple_clocks);
-
 	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
 					PHM_PlatformCaps_PowerContainment))
 		ret = phm_get_clock_info(hwmgr, &hwmgr->current_ps->hardware,
@@ -1057,11 +1054,6 @@ static int pp_get_current_clocks(void *handle,
 	clocks->max_engine_clock_in_sr = hw_clocks.max_eng_clk;
 	clocks->min_engine_clock_in_sr = hw_clocks.min_eng_clk;
 
-	if (simple_clocks.level == 0)
-		clocks->max_clocks_state = PP_DAL_POWERLEVEL_7;
-	else
-		clocks->max_clocks_state = simple_clocks.level;
-
 	if (0 == phm_get_current_shallow_sleep_clocks(hwmgr, &hwmgr->current_ps->hardware, &hw_clocks)) {
 		clocks->max_engine_clock_in_sr = hw_clocks.max_eng_clk;
 		clocks->min_engine_clock_in_sr = hw_clocks.min_eng_clk;
@@ -1138,8 +1130,6 @@ static int pp_get_display_mode_validation_clocks(void *handle,
 	if (!hwmgr || !hwmgr->pm_en || !clocks)
 		return -EINVAL;
 
-	clocks->level = PP_DAL_POWERLEVEL_7;
-
 	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_DynamicPatchPowerState))
 		ret = phm_get_max_high_clocks(hwmgr, clocks);
 
drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c +0 -10
index a59677cf8dfc8..72c2d3b69a038 100644
@@ -328,16 +328,6 @@ int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
 	return 0;
 }
 
-int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-	PHM_FUNC_CHECK(hwmgr);
-
-	if (info == NULL || hwmgr->hwmgr_func->get_dal_power_level == NULL)
-		return -EINVAL;
-	return hwmgr->hwmgr_func->get_dal_power_level(hwmgr, info);
-}
-
 int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr)
 {
 	PHM_FUNC_CHECK(hwmgr);
drivers/gpu/drm/amd/pm/powerplay/inc/hardwaremanager.h +0 -3
index 915f1b8e4dbad..36dcad065faeb 100644
@@ -426,9 +426,6 @@ extern int phm_check_states_equal(struct pp_hwmgr *hwmgr,
 extern int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
 		const struct amd_pp_display_configuration *display_config);
 
-extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info);
-
 extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr);
 
 extern int phm_power_down_asic(struct pp_hwmgr *hwmgr);
drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h +0 -2
index 1ee7e3044272d..fc1ffe1b2c97f 100644
@@ -292,8 +292,6 @@ struct pp_hwmgr_func {
 	int (*store_cc6_data)(struct pp_hwmgr *hwmgr, uint32_t separation_time,
 				bool cc6_disable, bool pstate_disable,
 				bool pstate_switch_disable);
-	int (*get_dal_power_level)(struct pp_hwmgr *hwmgr,
-			struct amd_pp_simple_clock_info *info);
 	int (*get_performance_level)(struct pp_hwmgr *, const struct pp_hw_power_state *,
 			PHM_PerformanceLevelDesignation, uint32_t, PHM_PerformanceLevel *);
 	int (*get_current_shallow_sleep_clocks)(struct pp_hwmgr *hwmgr,
Signature · 1 line
2.53.0
Reviewed-by on v1 13/14
#34 lore raw

Re: [PATCH 13/14] drm/amd/pm: Delete get_dal_power_level

Quoted 1 line · Timur Kristóf

Not needed anymore.

Quoted 134 lines
---
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c   |  3 ---
  drivers/gpu/drm/amd/include/dm_pp_interface.h          |  1 -
  drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c       | 10 ----------
  .../gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c   | 10 ----------
  drivers/gpu/drm/amd/pm/powerplay/inc/hardwaremanager.h |  3 ---
  drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h           |  2 --
  6 files changed, 29 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +0 -3
index 2247969aa9acb..90f79d70874cd 100644
@@ -288,7 +288,6 @@ bool dm_pp_get_clock_levels_by_type(
  		DRM_INFO("DM_PPLIB: Warning: using default validation clocks!\n");
  		validation_clks.engine_max_clock = 72000;
  		validation_clks.memory_max_clock = 80000;
-		validation_clks.level = 0;
  	}
 
  	DRM_INFO("DM_PPLIB: Validation clocks:\n");
@@ -296,8 +295,6 @@ bool dm_pp_get_clock_levels_by_type(
  			validation_clks.engine_max_clock);
  	DRM_INFO("DM_PPLIB:    memory_max_clock: %d\n",
  			validation_clks.memory_max_clock);
-	DRM_INFO("DM_PPLIB:    level           : %d\n",
-			validation_clks.level);
 
  	/* Translate 10 kHz to kHz. */
  	validation_clks.engine_max_clock *= 10;
drivers/gpu/drm/amd/include/dm_pp_interface.h +0 -1
index 349544504c93c..10747a1ceda9a 100644
@@ -113,7 +113,6 @@ struct amd_pp_display_configuration {
  struct amd_pp_simple_clock_info {
  	uint32_t	engine_max_clock;
  	uint32_t	memory_max_clock;
-	uint32_t	level;
  };
 
  enum PP_DAL_POWERLEVEL {
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +0 -10
index 4c2c40e8123bf..a53577a83f1b3 100644
@@ -1023,7 +1023,6 @@ static int pp_display_configuration_change(void *handle,
  static int pp_get_current_clocks(void *handle,
  		struct amd_pp_clock_info *clocks)
  {
-	struct amd_pp_simple_clock_info simple_clocks = { 0 };
  	struct pp_clock_info hw_clocks;
  	struct pp_hwmgr *hwmgr = handle;
  	int ret = 0;
@@ -1031,8 +1030,6 @@ static int pp_get_current_clocks(void *handle,
  	if (!hwmgr || !hwmgr->pm_en)
  		return -EINVAL;
 
-	phm_get_dal_power_level(hwmgr, &simple_clocks);
-
  	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
  					PHM_PlatformCaps_PowerContainment))
  		ret = phm_get_clock_info(hwmgr, &hwmgr->current_ps->hardware,
@@ -1057,11 +1054,6 @@ static int pp_get_current_clocks(void *handle,
  	clocks->max_engine_clock_in_sr = hw_clocks.max_eng_clk;
  	clocks->min_engine_clock_in_sr = hw_clocks.min_eng_clk;
 
-	if (simple_clocks.level == 0)
-		clocks->max_clocks_state = PP_DAL_POWERLEVEL_7;
-	else
-		clocks->max_clocks_state = simple_clocks.level;
-
  	if (0 == phm_get_current_shallow_sleep_clocks(hwmgr, &hwmgr->current_ps->hardware, &hw_clocks)) {
  		clocks->max_engine_clock_in_sr = hw_clocks.max_eng_clk;
  		clocks->min_engine_clock_in_sr = hw_clocks.min_eng_clk;
@@ -1138,8 +1130,6 @@ static int pp_get_display_mode_validation_clocks(void *handle,
  	if (!hwmgr || !hwmgr->pm_en || !clocks)
  		return -EINVAL;
 
-	clocks->level = PP_DAL_POWERLEVEL_7;
-
  	if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_DynamicPatchPowerState))
  		ret = phm_get_max_high_clocks(hwmgr, clocks);
 
drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c +0 -10
index a59677cf8dfc8..72c2d3b69a038 100644
@@ -328,16 +328,6 @@ int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
  	return 0;
  }
 
-int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info)
-{
-	PHM_FUNC_CHECK(hwmgr);
-
-	if (info == NULL || hwmgr->hwmgr_func->get_dal_power_level == NULL)
-		return -EINVAL;
-	return hwmgr->hwmgr_func->get_dal_power_level(hwmgr, info);
-}
-
  int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr)
  {
  	PHM_FUNC_CHECK(hwmgr);
drivers/gpu/drm/amd/pm/powerplay/inc/hardwaremanager.h +0 -3
index 915f1b8e4dbad..36dcad065faeb 100644
@@ -426,9 +426,6 @@ extern int phm_check_states_equal(struct pp_hwmgr *hwmgr,
  extern int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
  		const struct amd_pp_display_configuration *display_config);
 
-extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
-		struct amd_pp_simple_clock_info *info);
-
  extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr);
 
  extern int phm_power_down_asic(struct pp_hwmgr *hwmgr);
drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h +0 -2
index 1ee7e3044272d..fc1ffe1b2c97f 100644
@@ -292,8 +292,6 @@ struct pp_hwmgr_func {
  	int (*store_cc6_data)(struct pp_hwmgr *hwmgr, uint32_t separation_time,
  				bool cc6_disable, bool pstate_disable,
  				bool pstate_switch_disable);
-	int (*get_dal_power_level)(struct pp_hwmgr *hwmgr,
-			struct amd_pp_simple_clock_info *info);
  	int (*get_performance_level)(struct pp_hwmgr *, const struct pp_hw_power_state *,
  			PHM_PerformanceLevelDesignation, uint32_t, PHM_PerformanceLevel *);
  	int (*get_current_shallow_sleep_clocks)(struct pp_hwmgr *hwmgr,
#35 lore raw

PATCH 14/14 drm/amd/pm: Delete PP_DAL_POWERLEVEL

In reply to Timur Kristóf

Not used and not needed anymore.

---
 drivers/gpu/drm/amd/include/dm_pp_interface.h | 18 ------------------
 1 file changed, 18 deletions(-)
drivers/gpu/drm/amd/include/dm_pp_interface.h +0 -18
index 10747a1ceda9a..e3d40fb371039 100644
@@ -115,23 +115,6 @@ struct amd_pp_simple_clock_info {
 	uint32_t	memory_max_clock;
 };
 
-enum PP_DAL_POWERLEVEL {
-	PP_DAL_POWERLEVEL_INVALID = 0,
-	PP_DAL_POWERLEVEL_ULTRALOW,
-	PP_DAL_POWERLEVEL_LOW,
-	PP_DAL_POWERLEVEL_NOMINAL,
-	PP_DAL_POWERLEVEL_PERFORMANCE,
-
-	PP_DAL_POWERLEVEL_0 = PP_DAL_POWERLEVEL_ULTRALOW,
-	PP_DAL_POWERLEVEL_1 = PP_DAL_POWERLEVEL_LOW,
-	PP_DAL_POWERLEVEL_2 = PP_DAL_POWERLEVEL_NOMINAL,
-	PP_DAL_POWERLEVEL_3 = PP_DAL_POWERLEVEL_PERFORMANCE,
-	PP_DAL_POWERLEVEL_4 = PP_DAL_POWERLEVEL_3+1,
-	PP_DAL_POWERLEVEL_5 = PP_DAL_POWERLEVEL_4+1,
-	PP_DAL_POWERLEVEL_6 = PP_DAL_POWERLEVEL_5+1,
-	PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,
-};
-
 struct amd_pp_clock_info {
 	uint32_t min_engine_clock;
 	uint32_t max_engine_clock;
@@ -141,7 +124,6 @@ struct amd_pp_clock_info {
 	uint32_t max_bus_bandwidth;
 	uint32_t max_engine_clock_in_sr;
 	uint32_t min_engine_clock_in_sr;
-	enum PP_DAL_POWERLEVEL max_clocks_state;
 };
 
 enum amd_pp_clock_type {
Signature · 1 line
2.53.0
Reviewed-by on v1 14/14
#36 lore raw

Re: [PATCH 14/14] drm/amd/pm: Delete PP_DAL_POWERLEVEL

Quoted 1 line · Timur Kristóf

Not used and not needed anymore.

Quoted 42 lines
---
  drivers/gpu/drm/amd/include/dm_pp_interface.h | 18 ------------------
  1 file changed, 18 deletions(-)
drivers/gpu/drm/amd/include/dm_pp_interface.h +0 -18
index 10747a1ceda9a..e3d40fb371039 100644
@@ -115,23 +115,6 @@ struct amd_pp_simple_clock_info {
  	uint32_t	memory_max_clock;
  };
 
-enum PP_DAL_POWERLEVEL {
-	PP_DAL_POWERLEVEL_INVALID = 0,
-	PP_DAL_POWERLEVEL_ULTRALOW,
-	PP_DAL_POWERLEVEL_LOW,
-	PP_DAL_POWERLEVEL_NOMINAL,
-	PP_DAL_POWERLEVEL_PERFORMANCE,
-
-	PP_DAL_POWERLEVEL_0 = PP_DAL_POWERLEVEL_ULTRALOW,
-	PP_DAL_POWERLEVEL_1 = PP_DAL_POWERLEVEL_LOW,
-	PP_DAL_POWERLEVEL_2 = PP_DAL_POWERLEVEL_NOMINAL,
-	PP_DAL_POWERLEVEL_3 = PP_DAL_POWERLEVEL_PERFORMANCE,
-	PP_DAL_POWERLEVEL_4 = PP_DAL_POWERLEVEL_3+1,
-	PP_DAL_POWERLEVEL_5 = PP_DAL_POWERLEVEL_4+1,
-	PP_DAL_POWERLEVEL_6 = PP_DAL_POWERLEVEL_5+1,
-	PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,
-};
-
  struct amd_pp_clock_info {
  	uint32_t min_engine_clock;
  	uint32_t max_engine_clock;
@@ -141,7 +124,6 @@ struct amd_pp_clock_info {
  	uint32_t max_bus_bandwidth;
  	uint32_t max_engine_clock_in_sr;
  	uint32_t min_engine_clock_in_sr;
-	enum PP_DAL_POWERLEVEL max_clocks_state;
  };
 
  enum amd_pp_clock_type {