AMD gpu deadcoding (S more)
Subsystems (3)
cover AMD gpu deadcoding (S more)
From: "Dr. David Alan Gilbert" <[email protected]>
Hi,
A few more AMD deadcoding patches spinning out of the
questions I asked, and Kenneth answered.
Dave
Dr. David Alan Gilbert (3):
drm/amd/pm/smu13: Remove unused smu_v13_0_init_display_count drm/amd/pm: Remove unused smu_mode2_reset_is_support drm/amd/pm: Remove remainder of mode2_reset_is_support
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 13 ------------- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 5 ----- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 2 -- .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 6 ------ drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 6 ------ drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 12 ------------ .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 6 ------ 7 files changed, 50 deletions(-)
Signature · 1 line
2.49.0
PATCH 1/3 drm/amd/pm/smu13: Remove unused smu_v13_0_init_display_count
From: "Dr. David Alan Gilbert" <[email protected]>
smu_v13_0_init_display_count() was added in 2020 by
commit c05d1c401572 ("drm/amd/swsmu: add aldebaran smu13 ip support (v3)") but is unused.
See discussion on:
https://lore.kernel.org/all/DM4PR12MB5165D85BD85BC8FC8BF7A3B48E88A@DM4PR12MB5165.namprd12.prod.outlook.com/
that it really isn't neede.
Remove it.
--- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 2 -- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 12 ------------ 2 files changed, 14 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +0 -2
@@ -162,8 +162,6 @@ int smu_v13_0_notify_memory_pool_location(struct smu_context *smu);int smu_v13_0_system_features_control (struct smu_context *smu,bool en); -int smu_v13_0_init_display_count (struct smu_context *smu,uint32_t count); -int smu_v13_0_set_allowed_mask (struct smu_context *smu);int smu_v13_0_notify_display_change (struct smu_context *smu);
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0 -12
@@ -749,18 +749,6 @@ int smu_v13_0_set_tool_table_location(struct smu_context *smu)return ret; } -int smu_v13_0_init_display_count (struct smu_context *smu,uint32_t count) -{ -int ret =0 ; - -if (!smu->pm_enabled) -return ret; - - ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_NumOfDisplays, count,NULL ); - -return ret; -} -int smu_v13_0_set_allowed_mask (struct smu_context *smu) {struct smu_feature *feature = &smu->smu_feature;
Signature · 1 line
2.49.0
PATCH 2/3 drm/amd/pm: Remove unused smu_mode2_reset_is_support
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
smu_mode2_reset_is_support() was added in 2020 by
commit 5c03e5843e6b ("drm/amdgpu:add smu mode1/2 support for aldebaran") but has remained unused.
See discussion at:
https://lore.kernel.org/all/DM4PR12MB5165D85BD85BC8FC8BF7A3B48E88A@DM4PR12MB5165.namprd12.prod.outlook.com/
Remove it.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 13 ------------- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - 2 files changed, 14 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -13
@@ -3432,19 +3432,6 @@ bool smu_mode1_reset_is_support(struct smu_context *smu)return ret; } -bool smu_mode2_reset_is_support (struct smu_context *smu) -{ -bool ret = false; - -if (!smu->pm_enabled) -return false; - -if (smu->ppt_funcs && smu->ppt_funcs->mode2_reset_is_support) - ret = smu->ppt_funcs->mode2_reset_is_support (smu); - -return ret; -} -int smu_mode1_reset (struct smu_context *smu) {int ret =0 ;
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0 -1
@@ -1601,7 +1601,6 @@ int smu_get_power_limit(void *handle, enum pp_power_type pp_power_type);bool smu_mode1_reset_is_support (struct smu_context *smu); -bool smu_mode2_reset_is_support (struct smu_context *smu);int smu_mode1_reset (struct smu_context *smu);extern const struct amd_ip_funcs smu_ip_funcs;
Signature · 1 line
2.49.0
PATCH 3/3 drm/amd/pm: Remove remainder of mode2_reset_is_support
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
The previous patch removed smu_mode2_reset_is_support() which was the only function to call through the mode2_reset_is_support() method pointer.
Remove the remaining functions that were assigned to it and the pointer itself.
See discussion at:
https://lore.kernel.org/all/DM4PR12MB5165D85BD85BC8FC8BF7A3B48E88A@DM4PR12MB5165.namprd12.prod.outlook.com/
--- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 4 ---- drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 6 ------ drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 6 ------ drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 6 ------ 4 files changed, 22 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0 -4
@@ -1229,10 +1229,6 @@ struct pptable_funcs {* @mode1_reset_is_support: Check if GPU supports mode1 reset. */ bool (*mode1_reset_is_support)(struct smu_context *smu); -/** -* @mode2_reset_is_support: Check if GPU supports mode2 reset. -*/ -bool (*mode2_reset_is_support)(struct smu_context *smu);/** * @mode1_reset: Perform mode1 reset.
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0 -6
@@ -3089,11 +3089,6 @@ static int sienna_cichlid_stb_get_data_direct(struct smu_context *smu,return 0 ; } -static bool sienna_cichlid_is_mode2_reset_supported (struct smu_context *smu) -{ -return true; -} -static int sienna_cichlid_mode2_reset (struct smu_context *smu) {int ret =0 , index;
@@ -3229,7 +3224,6 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = { .get_default_config_table_settings = sienna_cichlid_get_default_config_table_settings, .set_config_table = sienna_cichlid_set_config_table, .get_unique_id = sienna_cichlid_get_unique_id, - .mode2_reset_is_support = sienna_cichlid_is_mode2_reset_supported, .mode2_reset = sienna_cichlid_mode2_reset, };
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +0 -6
@@ -1976,11 +1976,6 @@ static bool aldebaran_is_mode1_reset_supported(struct smu_context *smu)return true; } -static bool aldebaran_is_mode2_reset_supported (struct smu_context *smu) -{ -return true; -} -static int aldebaran_set_mp1_state (struct smu_context *smu,enum pp_mp1_state mp1_state) {
@@ -2086,7 +2081,6 @@ static const struct pptable_funcs aldebaran_ppt_funcs = { .set_pp_feature_mask = smu_cmn_set_pp_feature_mask, .get_gpu_metrics = aldebaran_get_gpu_metrics, .mode1_reset_is_support = aldebaran_is_mode1_reset_supported, - .mode2_reset_is_support = aldebaran_is_mode2_reset_supported, .smu_handle_passthrough_sbr = aldebaran_smu_handle_passthrough_sbr, .mode1_reset = aldebaran_mode1_reset, .set_mp1_state = aldebaran_set_mp1_state,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +0 -6
@@ -2849,11 +2849,6 @@ static bool smu_v13_0_6_is_mode1_reset_supported(struct smu_context *smu)return true; } -static bool smu_v13_0_6_is_mode2_reset_supported (struct smu_context *smu) -{ -return true; -} -static int smu_v13_0_6_smu_send_hbm_bad_page_num (struct smu_context *smu,uint32_t size) {
@@ -3586,7 +3581,6 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = { .get_pm_metrics = smu_v13_0_6_get_pm_metrics, .get_thermal_temperature_range = smu_v13_0_6_get_thermal_temperature_range, .mode1_reset_is_support = smu_v13_0_6_is_mode1_reset_supported, - .mode2_reset_is_support = smu_v13_0_6_is_mode2_reset_supported, .mode1_reset = smu_v13_0_6_mode1_reset, .mode2_reset = smu_v13_0_6_mode2_reset, .wait_for_event = smu_v13_0_wait_for_event,
Signature · 1 line
2.49.0
Re: [PATCH 3/3] drm/amd/pm: Remove remainder of mode2_reset_is_support
Applied the series.
Thanks!
Alex
Quoted 111 lines · On Wed, May 7, 2025 at 1:13 PM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
The previous patch removed
smu_mode2_reset_is_support()which was the only function to call through themode2_reset_is_support()method pointer.Remove the remaining functions that were assigned to it and the pointer itself.
See discussion at:
https://lore.kernel.org/all/DM4PR12MB5165D85BD85BC8FC8BF7A3B48E88A@DM4PR12MB5165.namprd12.prod.outlook.com/Signed-off-by Dr. David Alan Gilbert <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 4 ---- drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 6 ------ drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 6 ------ drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 6 ------ 4 files changed, 22 deletions(-)drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0
-4@@ -1229,10 +1229,6 @@ struct pptable_funcs {* @mode1_reset_is_support: Check if GPU supports mode1 reset. */ bool (*mode1_reset_is_support)(struct smu_context *smu); -/** -* @mode2_reset_is_support: Check if GPU supports mode2 reset. -*/ -bool (*mode2_reset_is_support)(struct smu_context *smu);/** * @mode1_reset: Perform mode1 reset. drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-6@@ -3089,11 +3089,6 @@ static int sienna_cichlid_stb_get_data_direct(struct smu_context *smu,return 0 ; } -static bool sienna_cichlid_is_mode2_reset_supported (struct smu_context *smu) -{ -return true; -} -static int sienna_cichlid_mode2_reset (struct smu_context *smu) {int ret =0 , index;@@ -3229,7 +3224,6 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = { .get_default_config_table_settings = sienna_cichlid_get_default_config_table_settings, .set_config_table = sienna_cichlid_set_config_table, .get_unique_id = sienna_cichlid_get_unique_id, - .mode2_reset_is_support = sienna_cichlid_is_mode2_reset_supported, .mode2_reset = sienna_cichlid_mode2_reset, };drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +0
-6@@ -1976,11 +1976,6 @@ static bool aldebaran_is_mode1_reset_supported(struct smu_context *smu)return true; } -static bool aldebaran_is_mode2_reset_supported (struct smu_context *smu) -{ -return true; -} -static int aldebaran_set_mp1_state (struct smu_context *smu,enum pp_mp1_state mp1_state) {@@ -2086,7 +2081,6 @@ static const struct pptable_funcs aldebaran_ppt_funcs = { .set_pp_feature_mask = smu_cmn_set_pp_feature_mask, .get_gpu_metrics = aldebaran_get_gpu_metrics, .mode1_reset_is_support = aldebaran_is_mode1_reset_supported, - .mode2_reset_is_support = aldebaran_is_mode2_reset_supported, .smu_handle_passthrough_sbr = aldebaran_smu_handle_passthrough_sbr, .mode1_reset = aldebaran_mode1_reset, .set_mp1_state = aldebaran_set_mp1_state,drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +0
-7@@ -2849,11 +2849,6 @@ static bool smu_v13_0_6_is_mode1_reset_supported(struct smu_context *smu)return true; } -static bool smu_v13_0_6_is_mode2_reset_supported (struct smu_context *smu) -{ -return true; -} -static int smu_v13_0_6_smu_send_hbm_bad_page_num (struct smu_context *smu,uint32_t size) {@@ -3586,7 +3581,6 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = { .get_pm_metrics = smu_v13_0_6_get_pm_metrics, .get_thermal_temperature_range = smu_v13_0_6_get_thermal_temperature_range, .mode1_reset_is_support = smu_v13_0_6_is_mode1_reset_supported, - .mode2_reset_is_support = smu_v13_0_6_is_mode2_reset_supported, .mode1_reset = smu_v13_0_6_mode1_reset, .mode2_reset = smu_v13_0_6_mode2_reset, .wait_for_event = smu_v13_0_wait_for_event, --2.49.0