* [PATCH 0/3] AMD gpu deadcoding (S more)
@ 2025-05-07 17:01 linux
2025-05-07 17:01 ` [PATCH 1/3] drm/amd/pm/smu13: Remove unused smu_v13_0_init_display_count linux
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: linux @ 2025-05-07 17:01 UTC (permalink / raw)
To: alexander.deucher, kenneth.feng, christian.koenig
Cc: airlied, simona, amd-gfx, dri-devel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
Hi,
A few more AMD deadcoding patches spinning out of the
questions I asked, and Kenneth answered.
See:
https://lore.kernel.org/all/DM4PR12MB5165D85BD85BC8FC8BF7A3B48E88A@DM4PR12MB5165.namprd12.prod.outlook.com/
Dave
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
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(-)
--
2.49.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/3] drm/amd/pm/smu13: Remove unused smu_v13_0_init_display_count 2025-05-07 17:01 [PATCH 0/3] AMD gpu deadcoding (S more) linux @ 2025-05-07 17:01 ` linux 2025-05-07 17:01 ` [PATCH 2/3] drm/amd/pm: Remove unused smu_mode2_reset_is_support linux 2025-05-07 17:01 ` [PATCH 3/3] drm/amd/pm: Remove remainder of mode2_reset_is_support linux 2 siblings, 0 replies; 5+ messages in thread From: linux @ 2025-05-07 17:01 UTC (permalink / raw) To: alexander.deucher, kenneth.feng, christian.koenig Cc: airlied, simona, amd-gfx, dri-devel, linux-kernel, Dr. David Alan Gilbert From: "Dr. David Alan Gilbert" <linux@treblig.org> 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. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> --- 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(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h index 6f74783472e5..1b4a46126a04 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h @@ -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); diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c index 03242f65e262..9893657dfa61 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c @@ -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; -- 2.49.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] drm/amd/pm: Remove unused smu_mode2_reset_is_support 2025-05-07 17:01 [PATCH 0/3] AMD gpu deadcoding (S more) linux 2025-05-07 17:01 ` [PATCH 1/3] drm/amd/pm/smu13: Remove unused smu_v13_0_init_display_count linux @ 2025-05-07 17:01 ` linux 2025-05-07 17:01 ` [PATCH 3/3] drm/amd/pm: Remove remainder of mode2_reset_is_support linux 2 siblings, 0 replies; 5+ messages in thread From: linux @ 2025-05-07 17:01 UTC (permalink / raw) To: alexander.deucher, kenneth.feng, christian.koenig Cc: airlied, simona, amd-gfx, dri-devel, linux-kernel, Dr. David Alan Gilbert From: "Dr. David Alan Gilbert" <linux@treblig.org> 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. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> --- 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(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 46cce1d2aaf3..04bbeeac98a3 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -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; diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h index dd6d0e7aa242..a5ba37f57650 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h @@ -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; -- 2.49.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] drm/amd/pm: Remove remainder of mode2_reset_is_support 2025-05-07 17:01 [PATCH 0/3] AMD gpu deadcoding (S more) linux 2025-05-07 17:01 ` [PATCH 1/3] drm/amd/pm/smu13: Remove unused smu_v13_0_init_display_count linux 2025-05-07 17:01 ` [PATCH 2/3] drm/amd/pm: Remove unused smu_mode2_reset_is_support linux @ 2025-05-07 17:01 ` linux 2025-05-08 14:05 ` Alex Deucher 2 siblings, 1 reply; 5+ messages in thread From: linux @ 2025-05-07 17:01 UTC (permalink / raw) To: alexander.deucher, kenneth.feng, christian.koenig Cc: airlied, simona, amd-gfx, dri-devel, linux-kernel, Dr. David Alan Gilbert From: "Dr. David Alan Gilbert" <linux@treblig.org> 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/ Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> --- 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(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h index a5ba37f57650..eb0a97dde71c 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h @@ -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. diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index 19a25fdc2f5b..115e3fa456bc 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -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, }; diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index 83163d7c7f00..38fbe0ddc4e6 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c @@ -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, diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c index c478b3be37af..c529859c83ab 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c @@ -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 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] drm/amd/pm: Remove remainder of mode2_reset_is_support 2025-05-07 17:01 ` [PATCH 3/3] drm/amd/pm: Remove remainder of mode2_reset_is_support linux @ 2025-05-08 14:05 ` Alex Deucher 0 siblings, 0 replies; 5+ messages in thread From: Alex Deucher @ 2025-05-08 14:05 UTC (permalink / raw) To: linux Cc: alexander.deucher, kenneth.feng, christian.koenig, airlied, simona, amd-gfx, dri-devel, linux-kernel Applied the series. Thanks! Alex On Wed, May 7, 2025 at 1:13 PM <linux@treblig.org> wrote: > > From: "Dr. David Alan Gilbert" <linux@treblig.org> > > 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/ > > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> > --- > 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(-) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h > index a5ba37f57650..eb0a97dde71c 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h > +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h > @@ -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. > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c > index 19a25fdc2f5b..115e3fa456bc 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c > @@ -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, > }; > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c > index 83163d7c7f00..38fbe0ddc4e6 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c > @@ -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, > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c > index c478b3be37af..c529859c83ab 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c > @@ -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 > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-05-08 14:06 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-05-07 17:01 [PATCH 0/3] AMD gpu deadcoding (S more) linux 2025-05-07 17:01 ` [PATCH 1/3] drm/amd/pm/smu13: Remove unused smu_v13_0_init_display_count linux 2025-05-07 17:01 ` [PATCH 2/3] drm/amd/pm: Remove unused smu_mode2_reset_is_support linux 2025-05-07 17:01 ` [PATCH 3/3] drm/amd/pm: Remove remainder of mode2_reset_is_support linux 2025-05-08 14:05 ` Alex Deucher
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox