* [PATCH 0/2] radeon/drm: dpm cleanups @ 2014-10-14 16:25 Michele Curti 2014-10-14 16:25 ` [PATCH 1/2] drm/radeon: reduce sparse false positive warnings Michele Curti 2014-10-14 16:25 ` [PATCH 2/2] drm/radeon: remove never called dpm functions Michele Curti 0 siblings, 2 replies; 5+ messages in thread From: Michele Curti @ 2014-10-14 16:25 UTC (permalink / raw) To: alexander.deucher, christian.koenig; +Cc: Michele Curti, dri-devel Hi, the first patch reduces the sparse warnings and the second removes unused code. I think the patches could be applied independently but both act on the dpm files, so here's why the series. I'm not sure about the patches but at least I experiment with git send-email.. Please don't kill me if you can :p Michele Michele Curti (2): drm/radeon: reduce sparse false positive warnings drm/radeon: remove never called dpm functions drivers/gpu/drm/radeon/btc_dpm.c | 9 +------- drivers/gpu/drm/radeon/ci_dpm.c | 40 +----------------------------------- drivers/gpu/drm/radeon/cypress_dpm.c | 7 +------ drivers/gpu/drm/radeon/kv_dpm.c | 21 ------------------- drivers/gpu/drm/radeon/ni_dpm.c | 7 +------ drivers/gpu/drm/radeon/r600_dpm.c | 1 + drivers/gpu/drm/radeon/rs780_dpm.c | 1 + drivers/gpu/drm/radeon/rv6xx_dpm.c | 1 + drivers/gpu/drm/radeon/rv770_dpm.c | 14 +------------ drivers/gpu/drm/radeon/si_dpm.c | 15 +------------- drivers/gpu/drm/radeon/sumo_dpm.c | 13 +----------- drivers/gpu/drm/radeon/trinity_dpm.c | 17 +-------------- 12 files changed, 11 insertions(+), 135 deletions(-) -- 2.1.2 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] drm/radeon: reduce sparse false positive warnings 2014-10-14 16:25 [PATCH 0/2] radeon/drm: dpm cleanups Michele Curti @ 2014-10-14 16:25 ` Michele Curti 2014-10-16 14:34 ` Alex Deucher 2014-10-14 16:25 ` [PATCH 2/2] drm/radeon: remove never called dpm functions Michele Curti 1 sibling, 1 reply; 5+ messages in thread From: Michele Curti @ 2014-10-14 16:25 UTC (permalink / raw) To: alexander.deucher, christian.koenig; +Cc: Michele Curti, dri-devel include radeon_asic.h header file in the various xxx_dpm.c files to reduce sparse false positive warnings. Not so great patch in itself, but reducing warning count from 391 to 258 may help to see real problems.. Signed-off-by: Michele Curti <michele.curti@gmail.com> --- drivers/gpu/drm/radeon/btc_dpm.c | 1 + drivers/gpu/drm/radeon/ci_dpm.c | 1 + drivers/gpu/drm/radeon/cypress_dpm.c | 1 + drivers/gpu/drm/radeon/ni_dpm.c | 1 + drivers/gpu/drm/radeon/r600_dpm.c | 1 + drivers/gpu/drm/radeon/rs780_dpm.c | 1 + drivers/gpu/drm/radeon/rv6xx_dpm.c | 1 + drivers/gpu/drm/radeon/rv770_dpm.c | 1 + drivers/gpu/drm/radeon/si_dpm.c | 1 + drivers/gpu/drm/radeon/sumo_dpm.c | 1 + drivers/gpu/drm/radeon/trinity_dpm.c | 1 + 11 files changed, 11 insertions(+) diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c index 300d971..d6243f1 100644 --- a/drivers/gpu/drm/radeon/btc_dpm.c +++ b/drivers/gpu/drm/radeon/btc_dpm.c @@ -24,6 +24,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "btcd.h" #include "r600_dpm.h" #include "cypress_dpm.h" diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index f5c8c04..11a55e9 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -24,6 +24,7 @@ #include <linux/firmware.h> #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "radeon_ucode.h" #include "cikd.h" #include "r600_dpm.h" diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c index 47d31e9..9aad032 100644 --- a/drivers/gpu/drm/radeon/cypress_dpm.c +++ b/drivers/gpu/drm/radeon/cypress_dpm.c @@ -24,6 +24,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "evergreend.h" #include "r600_dpm.h" #include "cypress_dpm.h" diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index 715b181..6d2f16c 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -23,6 +23,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "nid.h" #include "r600_dpm.h" #include "ni_dpm.h" diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c index 9c61b74..f6309bd 100644 --- a/drivers/gpu/drm/radeon/r600_dpm.c +++ b/drivers/gpu/drm/radeon/r600_dpm.c @@ -24,6 +24,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "r600d.h" #include "r600_dpm.h" #include "atom.h" diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c index 02f7710..9031f4b 100644 --- a/drivers/gpu/drm/radeon/rs780_dpm.c +++ b/drivers/gpu/drm/radeon/rs780_dpm.c @@ -24,6 +24,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "rs780d.h" #include "r600_dpm.h" #include "rs780_dpm.h" diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c index e7045b0..6a5c233 100644 --- a/drivers/gpu/drm/radeon/rv6xx_dpm.c +++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c @@ -24,6 +24,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "rv6xxd.h" #include "r600_dpm.h" #include "rv6xx_dpm.h" diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c index 3c76e1d..755a8f9 100644 --- a/drivers/gpu/drm/radeon/rv770_dpm.c +++ b/drivers/gpu/drm/radeon/rv770_dpm.c @@ -24,6 +24,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "rv770d.h" #include "r600_dpm.h" #include "rv770_dpm.h" diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index 9e4d5d7..267949a 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c @@ -23,6 +23,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "sid.h" #include "r600_dpm.h" #include "si_dpm.h" diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c index 3f0e8d7..1f8a883 100644 --- a/drivers/gpu/drm/radeon/sumo_dpm.c +++ b/drivers/gpu/drm/radeon/sumo_dpm.c @@ -23,6 +23,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "sumod.h" #include "r600_dpm.h" #include "cypress_dpm.h" diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index 57f7800..b4ec5c4 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c @@ -23,6 +23,7 @@ #include "drmP.h" #include "radeon.h" +#include "radeon_asic.h" #include "trinityd.h" #include "r600_dpm.h" #include "trinity_dpm.h" -- 2.1.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] drm/radeon: reduce sparse false positive warnings 2014-10-14 16:25 ` [PATCH 1/2] drm/radeon: reduce sparse false positive warnings Michele Curti @ 2014-10-16 14:34 ` Alex Deucher 0 siblings, 0 replies; 5+ messages in thread From: Alex Deucher @ 2014-10-16 14:34 UTC (permalink / raw) To: Michele Curti Cc: Deucher, Alexander, Christian Koenig, Maling list - DRI developers On Tue, Oct 14, 2014 at 12:25 PM, Michele Curti <michele.curti@gmail.com> wrote: > include radeon_asic.h header file in the various xxx_dpm.c files > to reduce sparse false positive warnings. Not so great patch > in itself, but reducing warning count from 391 to 258 may help > to see real problems.. > > Signed-off-by: Michele Curti <michele.curti@gmail.com> Applied. thanks! Alex > --- > drivers/gpu/drm/radeon/btc_dpm.c | 1 + > drivers/gpu/drm/radeon/ci_dpm.c | 1 + > drivers/gpu/drm/radeon/cypress_dpm.c | 1 + > drivers/gpu/drm/radeon/ni_dpm.c | 1 + > drivers/gpu/drm/radeon/r600_dpm.c | 1 + > drivers/gpu/drm/radeon/rs780_dpm.c | 1 + > drivers/gpu/drm/radeon/rv6xx_dpm.c | 1 + > drivers/gpu/drm/radeon/rv770_dpm.c | 1 + > drivers/gpu/drm/radeon/si_dpm.c | 1 + > drivers/gpu/drm/radeon/sumo_dpm.c | 1 + > drivers/gpu/drm/radeon/trinity_dpm.c | 1 + > 11 files changed, 11 insertions(+) > > diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c > index 300d971..d6243f1 100644 > --- a/drivers/gpu/drm/radeon/btc_dpm.c > +++ b/drivers/gpu/drm/radeon/btc_dpm.c > @@ -24,6 +24,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "btcd.h" > #include "r600_dpm.h" > #include "cypress_dpm.h" > diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c > index f5c8c04..11a55e9 100644 > --- a/drivers/gpu/drm/radeon/ci_dpm.c > +++ b/drivers/gpu/drm/radeon/ci_dpm.c > @@ -24,6 +24,7 @@ > #include <linux/firmware.h> > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "radeon_ucode.h" > #include "cikd.h" > #include "r600_dpm.h" > diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c > index 47d31e9..9aad032 100644 > --- a/drivers/gpu/drm/radeon/cypress_dpm.c > +++ b/drivers/gpu/drm/radeon/cypress_dpm.c > @@ -24,6 +24,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "evergreend.h" > #include "r600_dpm.h" > #include "cypress_dpm.h" > diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c > index 715b181..6d2f16c 100644 > --- a/drivers/gpu/drm/radeon/ni_dpm.c > +++ b/drivers/gpu/drm/radeon/ni_dpm.c > @@ -23,6 +23,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "nid.h" > #include "r600_dpm.h" > #include "ni_dpm.h" > diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c > index 9c61b74..f6309bd 100644 > --- a/drivers/gpu/drm/radeon/r600_dpm.c > +++ b/drivers/gpu/drm/radeon/r600_dpm.c > @@ -24,6 +24,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "r600d.h" > #include "r600_dpm.h" > #include "atom.h" > diff --git a/drivers/gpu/drm/radeon/rs780_dpm.c b/drivers/gpu/drm/radeon/rs780_dpm.c > index 02f7710..9031f4b 100644 > --- a/drivers/gpu/drm/radeon/rs780_dpm.c > +++ b/drivers/gpu/drm/radeon/rs780_dpm.c > @@ -24,6 +24,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "rs780d.h" > #include "r600_dpm.h" > #include "rs780_dpm.h" > diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c > index e7045b0..6a5c233 100644 > --- a/drivers/gpu/drm/radeon/rv6xx_dpm.c > +++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c > @@ -24,6 +24,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "rv6xxd.h" > #include "r600_dpm.h" > #include "rv6xx_dpm.h" > diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c > index 3c76e1d..755a8f9 100644 > --- a/drivers/gpu/drm/radeon/rv770_dpm.c > +++ b/drivers/gpu/drm/radeon/rv770_dpm.c > @@ -24,6 +24,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "rv770d.h" > #include "r600_dpm.h" > #include "rv770_dpm.h" > diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c > index 9e4d5d7..267949a 100644 > --- a/drivers/gpu/drm/radeon/si_dpm.c > +++ b/drivers/gpu/drm/radeon/si_dpm.c > @@ -23,6 +23,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "sid.h" > #include "r600_dpm.h" > #include "si_dpm.h" > diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c > index 3f0e8d7..1f8a883 100644 > --- a/drivers/gpu/drm/radeon/sumo_dpm.c > +++ b/drivers/gpu/drm/radeon/sumo_dpm.c > @@ -23,6 +23,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "sumod.h" > #include "r600_dpm.h" > #include "cypress_dpm.h" > diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c > index 57f7800..b4ec5c4 100644 > --- a/drivers/gpu/drm/radeon/trinity_dpm.c > +++ b/drivers/gpu/drm/radeon/trinity_dpm.c > @@ -23,6 +23,7 @@ > > #include "drmP.h" > #include "radeon.h" > +#include "radeon_asic.h" > #include "trinityd.h" > #include "r600_dpm.h" > #include "trinity_dpm.h" > -- > 2.1.2 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] drm/radeon: remove never called dpm functions 2014-10-14 16:25 [PATCH 0/2] radeon/drm: dpm cleanups Michele Curti 2014-10-14 16:25 ` [PATCH 1/2] drm/radeon: reduce sparse false positive warnings Michele Curti @ 2014-10-14 16:25 ` Michele Curti 2014-10-16 14:34 ` Alex Deucher 1 sibling, 1 reply; 5+ messages in thread From: Michele Curti @ 2014-10-14 16:25 UTC (permalink / raw) To: alexander.deucher, christian.koenig; +Cc: Michele Curti, dri-devel remove some dpm functions never called, mostly xxx_dpm_reset_asic functions. Here the list: * btc_dpm_reset_asic * ci_power_control_set_level * ci_set_boot_state * ci_dpm_power_control_set_level * ci_dpm_reset_asic * cypress_dpm_reset_asic * kv_dpm_reset_asic * ni_dpm_reset_asic * rv770_dpm_reset_asic * si_set_boot_state * si_dpm_reset_asic * sumo_dpm_reset_asic * trinity_dpm_reset_asic Signed-off-by: Michele Curti <michele.curti@gmail.com> --- drivers/gpu/drm/radeon/btc_dpm.c | 8 -------- drivers/gpu/drm/radeon/ci_dpm.c | 39 ------------------------------------ drivers/gpu/drm/radeon/cypress_dpm.c | 6 ------ drivers/gpu/drm/radeon/kv_dpm.c | 21 ------------------- drivers/gpu/drm/radeon/ni_dpm.c | 6 ------ drivers/gpu/drm/radeon/rv770_dpm.c | 13 ------------ drivers/gpu/drm/radeon/si_dpm.c | 14 ------------- drivers/gpu/drm/radeon/sumo_dpm.c | 12 ----------- drivers/gpu/drm/radeon/trinity_dpm.c | 16 --------------- 9 files changed, 135 deletions(-) diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c index d6243f1..b3f1919 100644 --- a/drivers/gpu/drm/radeon/btc_dpm.c +++ b/drivers/gpu/drm/radeon/btc_dpm.c @@ -2260,14 +2260,6 @@ static void btc_update_requested_ps(struct radeon_device *rdev, eg_pi->requested_rps.ps_priv = &eg_pi->requested_ps; } -void btc_dpm_reset_asic(struct radeon_device *rdev) -{ - rv770_restrict_performance_levels_before_switch(rdev); - btc_disable_ulv(rdev); - btc_set_boot_state_timing(rdev); - rv770_set_boot_state(rdev); -} - int btc_dpm_pre_set_power_state(struct radeon_device *rdev) { struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index 11a55e9..75e9622 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -690,30 +690,6 @@ static int ci_enable_smc_cac(struct radeon_device *rdev, bool enable) return ret; } -static int ci_power_control_set_level(struct radeon_device *rdev) -{ - struct ci_power_info *pi = ci_get_pi(rdev); - struct radeon_cac_tdp_table *cac_tdp_table = - rdev->pm.dpm.dyn_state.cac_tdp_table; - s32 adjust_percent; - s32 target_tdp; - int ret = 0; - bool adjust_polarity = false; /* ??? */ - - if (pi->caps_power_containment && - (pi->power_containment_features & POWERCONTAINMENT_FEATURE_BAPM)) { - adjust_percent = adjust_polarity ? - rdev->pm.dpm.tdp_adjustment : (-1 * rdev->pm.dpm.tdp_adjustment); - target_tdp = ((100 + adjust_percent) * - (s32)cac_tdp_table->configurable_tdp) / 100; - target_tdp *= 256; - - ret = ci_set_overdrive_target_tdp(rdev, (u32)target_tdp); - } - - return ret; -} - void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate) { struct ci_power_info *pi = ci_get_pi(rdev); @@ -1313,11 +1289,6 @@ static int ci_set_overdrive_target_tdp(struct radeon_device *rdev, return 0; } -static int ci_set_boot_state(struct radeon_device *rdev) -{ - return ci_enable_sclk_mclk_dpm(rdev, false); -} - static u32 ci_get_average_sclk_freq(struct radeon_device *rdev) { u32 sclk_freq; @@ -4804,16 +4775,6 @@ int ci_dpm_set_power_state(struct radeon_device *rdev) return 0; } -int ci_dpm_power_control_set_level(struct radeon_device *rdev) -{ - return ci_power_control_set_level(rdev); -} - -void ci_dpm_reset_asic(struct radeon_device *rdev) -{ - ci_set_boot_state(rdev); -} - void ci_dpm_display_configuration_changed(struct radeon_device *rdev) { ci_program_display_gap(rdev); diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c index 9aad032..d3f8208 100644 --- a/drivers/gpu/drm/radeon/cypress_dpm.c +++ b/drivers/gpu/drm/radeon/cypress_dpm.c @@ -2005,12 +2005,6 @@ int cypress_dpm_set_power_state(struct radeon_device *rdev) return 0; } -void cypress_dpm_reset_asic(struct radeon_device *rdev) -{ - rv770_restrict_performance_levels_before_switch(rdev); - rv770_set_boot_state(rdev); -} - void cypress_dpm_display_configuration_changed(struct radeon_device *rdev) { cypress_program_display_gap(rdev); diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index 1dd976f..6889a79 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c @@ -1925,27 +1925,6 @@ void kv_dpm_setup_asic(struct radeon_device *rdev) kv_init_sclk_t(rdev); } -void kv_dpm_reset_asic(struct radeon_device *rdev) -{ - struct kv_power_info *pi = kv_get_pi(rdev); - - if (rdev->family == CHIP_KABINI || rdev->family == CHIP_MULLINS) { - kv_force_lowest_valid(rdev); - kv_init_graphics_levels(rdev); - kv_program_bootup_state(rdev); - kv_upload_dpm_settings(rdev); - kv_force_lowest_valid(rdev); - kv_unforce_levels(rdev); - } else { - kv_init_graphics_levels(rdev); - kv_program_bootup_state(rdev); - kv_freeze_sclk_dpm(rdev, true); - kv_upload_dpm_settings(rdev); - kv_freeze_sclk_dpm(rdev, false); - kv_set_enabled_level(rdev, pi->graphics_boot_level); - } -} - //XXX use sumo_dpm_display_configuration_changed static void kv_construct_max_power_limits_table(struct radeon_device *rdev, diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index 6d2f16c..dcd5568 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -3862,12 +3862,6 @@ void ni_dpm_post_set_power_state(struct radeon_device *rdev) ni_update_current_ps(rdev, new_ps); } -void ni_dpm_reset_asic(struct radeon_device *rdev) -{ - ni_restrict_performance_levels_before_switch(rdev); - rv770_set_boot_state(rdev); -} - union power_info { struct _ATOM_POWERPLAY_INFO info; struct _ATOM_POWERPLAY_INFO_V2 info_2; diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c index 755a8f9..8ee6ff5 100644 --- a/drivers/gpu/drm/radeon/rv770_dpm.c +++ b/drivers/gpu/drm/radeon/rv770_dpm.c @@ -2075,19 +2075,6 @@ int rv770_dpm_set_power_state(struct radeon_device *rdev) return 0; } -void rv770_dpm_reset_asic(struct radeon_device *rdev) -{ - struct rv7xx_power_info *pi = rv770_get_pi(rdev); - struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps; - - rv770_restrict_performance_levels_before_switch(rdev); - if (pi->dcodt) - rv770_program_dcodt_before_state_switch(rdev, boot_ps, boot_ps); - rv770_set_boot_state(rdev); - if (pi->dcodt) - rv770_program_dcodt_after_state_switch(rdev, boot_ps, boot_ps); -} - void rv770_dpm_setup_asic(struct radeon_device *rdev) { struct rv7xx_power_info *pi = rv770_get_pi(rdev); diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index 267949a..f06c6f9 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c @@ -3296,12 +3296,6 @@ int si_dpm_force_performance_level(struct radeon_device *rdev, return 0; } -static int si_set_boot_state(struct radeon_device *rdev) -{ - return (si_send_msg_to_smc(rdev, PPSMC_MSG_SwitchToInitialState) == PPSMC_Result_OK) ? - 0 : -EINVAL; -} - static int si_set_sw_state(struct radeon_device *rdev) { return (si_send_msg_to_smc(rdev, PPSMC_MSG_SwitchToSwState) == PPSMC_Result_OK) ? @@ -6129,14 +6123,6 @@ void si_dpm_post_set_power_state(struct radeon_device *rdev) ni_update_current_ps(rdev, new_ps); } - -void si_dpm_reset_asic(struct radeon_device *rdev) -{ - si_restrict_performance_levels_before_switch(rdev); - si_disable_ulv(rdev); - si_set_boot_state(rdev); -} - void si_dpm_display_configuration_changed(struct radeon_device *rdev) { si_program_display_gap(rdev); diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c index 1f8a883..698e785 100644 --- a/drivers/gpu/drm/radeon/sumo_dpm.c +++ b/drivers/gpu/drm/radeon/sumo_dpm.c @@ -1338,18 +1338,6 @@ void sumo_dpm_post_set_power_state(struct radeon_device *rdev) sumo_update_current_ps(rdev, new_ps); } -void sumo_dpm_reset_asic(struct radeon_device *rdev) -{ - sumo_program_bootup_state(rdev); - sumo_enable_power_level_0(rdev); - sumo_set_forced_level_0(rdev); - sumo_set_forced_mode_enabled(rdev); - sumo_wait_for_level_0(rdev); - sumo_set_forced_mode_disabled(rdev); - sumo_set_forced_mode_enabled(rdev); - sumo_set_forced_mode_disabled(rdev); -} - void sumo_dpm_setup_asic(struct radeon_device *rdev) { struct sumo_power_info *pi = sumo_get_pi(rdev); diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index b4ec5c4..7428da0 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c @@ -1269,22 +1269,6 @@ void trinity_dpm_setup_asic(struct radeon_device *rdev) trinity_release_mutex(rdev); } -void trinity_dpm_reset_asic(struct radeon_device *rdev) -{ - struct trinity_power_info *pi = trinity_get_pi(rdev); - - trinity_acquire_mutex(rdev); - if (pi->enable_dpm) { - trinity_enable_power_level_0(rdev); - trinity_force_level_0(rdev); - trinity_wait_for_level_0(rdev); - trinity_program_bootup_state(rdev); - trinity_force_level_0(rdev); - trinity_unforce_levels(rdev); - } - trinity_release_mutex(rdev); -} - static u16 trinity_convert_voltage_index_to_value(struct radeon_device *rdev, u32 vid_2bit) { -- 2.1.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] drm/radeon: remove never called dpm functions 2014-10-14 16:25 ` [PATCH 2/2] drm/radeon: remove never called dpm functions Michele Curti @ 2014-10-16 14:34 ` Alex Deucher 0 siblings, 0 replies; 5+ messages in thread From: Alex Deucher @ 2014-10-16 14:34 UTC (permalink / raw) To: Michele Curti Cc: Deucher, Alexander, Christian Koenig, Maling list - DRI developers On Tue, Oct 14, 2014 at 12:25 PM, Michele Curti <michele.curti@gmail.com> wrote: > remove some dpm functions never called, mostly xxx_dpm_reset_asic > functions. Here the list: > * btc_dpm_reset_asic > * ci_power_control_set_level > * ci_set_boot_state > * ci_dpm_power_control_set_level > * ci_dpm_reset_asic > * cypress_dpm_reset_asic > * kv_dpm_reset_asic > * ni_dpm_reset_asic > * rv770_dpm_reset_asic > * si_set_boot_state > * si_dpm_reset_asic > * sumo_dpm_reset_asic > * trinity_dpm_reset_asic > > Signed-off-by: Michele Curti <michele.curti@gmail.com> I'd like to keep the code around for reference. Thanks! Alex > --- > drivers/gpu/drm/radeon/btc_dpm.c | 8 -------- > drivers/gpu/drm/radeon/ci_dpm.c | 39 ------------------------------------ > drivers/gpu/drm/radeon/cypress_dpm.c | 6 ------ > drivers/gpu/drm/radeon/kv_dpm.c | 21 ------------------- > drivers/gpu/drm/radeon/ni_dpm.c | 6 ------ > drivers/gpu/drm/radeon/rv770_dpm.c | 13 ------------ > drivers/gpu/drm/radeon/si_dpm.c | 14 ------------- > drivers/gpu/drm/radeon/sumo_dpm.c | 12 ----------- > drivers/gpu/drm/radeon/trinity_dpm.c | 16 --------------- > 9 files changed, 135 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c > index d6243f1..b3f1919 100644 > --- a/drivers/gpu/drm/radeon/btc_dpm.c > +++ b/drivers/gpu/drm/radeon/btc_dpm.c > @@ -2260,14 +2260,6 @@ static void btc_update_requested_ps(struct radeon_device *rdev, > eg_pi->requested_rps.ps_priv = &eg_pi->requested_ps; > } > > -void btc_dpm_reset_asic(struct radeon_device *rdev) > -{ > - rv770_restrict_performance_levels_before_switch(rdev); > - btc_disable_ulv(rdev); > - btc_set_boot_state_timing(rdev); > - rv770_set_boot_state(rdev); > -} > - > int btc_dpm_pre_set_power_state(struct radeon_device *rdev) > { > struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev); > diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c > index 11a55e9..75e9622 100644 > --- a/drivers/gpu/drm/radeon/ci_dpm.c > +++ b/drivers/gpu/drm/radeon/ci_dpm.c > @@ -690,30 +690,6 @@ static int ci_enable_smc_cac(struct radeon_device *rdev, bool enable) > return ret; > } > > -static int ci_power_control_set_level(struct radeon_device *rdev) > -{ > - struct ci_power_info *pi = ci_get_pi(rdev); > - struct radeon_cac_tdp_table *cac_tdp_table = > - rdev->pm.dpm.dyn_state.cac_tdp_table; > - s32 adjust_percent; > - s32 target_tdp; > - int ret = 0; > - bool adjust_polarity = false; /* ??? */ > - > - if (pi->caps_power_containment && > - (pi->power_containment_features & POWERCONTAINMENT_FEATURE_BAPM)) { > - adjust_percent = adjust_polarity ? > - rdev->pm.dpm.tdp_adjustment : (-1 * rdev->pm.dpm.tdp_adjustment); > - target_tdp = ((100 + adjust_percent) * > - (s32)cac_tdp_table->configurable_tdp) / 100; > - target_tdp *= 256; > - > - ret = ci_set_overdrive_target_tdp(rdev, (u32)target_tdp); > - } > - > - return ret; > -} > - > void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate) > { > struct ci_power_info *pi = ci_get_pi(rdev); > @@ -1313,11 +1289,6 @@ static int ci_set_overdrive_target_tdp(struct radeon_device *rdev, > return 0; > } > > -static int ci_set_boot_state(struct radeon_device *rdev) > -{ > - return ci_enable_sclk_mclk_dpm(rdev, false); > -} > - > static u32 ci_get_average_sclk_freq(struct radeon_device *rdev) > { > u32 sclk_freq; > @@ -4804,16 +4775,6 @@ int ci_dpm_set_power_state(struct radeon_device *rdev) > return 0; > } > > -int ci_dpm_power_control_set_level(struct radeon_device *rdev) > -{ > - return ci_power_control_set_level(rdev); > -} > - > -void ci_dpm_reset_asic(struct radeon_device *rdev) > -{ > - ci_set_boot_state(rdev); > -} > - > void ci_dpm_display_configuration_changed(struct radeon_device *rdev) > { > ci_program_display_gap(rdev); > diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c > index 9aad032..d3f8208 100644 > --- a/drivers/gpu/drm/radeon/cypress_dpm.c > +++ b/drivers/gpu/drm/radeon/cypress_dpm.c > @@ -2005,12 +2005,6 @@ int cypress_dpm_set_power_state(struct radeon_device *rdev) > return 0; > } > > -void cypress_dpm_reset_asic(struct radeon_device *rdev) > -{ > - rv770_restrict_performance_levels_before_switch(rdev); > - rv770_set_boot_state(rdev); > -} > - > void cypress_dpm_display_configuration_changed(struct radeon_device *rdev) > { > cypress_program_display_gap(rdev); > diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c > index 1dd976f..6889a79 100644 > --- a/drivers/gpu/drm/radeon/kv_dpm.c > +++ b/drivers/gpu/drm/radeon/kv_dpm.c > @@ -1925,27 +1925,6 @@ void kv_dpm_setup_asic(struct radeon_device *rdev) > kv_init_sclk_t(rdev); > } > > -void kv_dpm_reset_asic(struct radeon_device *rdev) > -{ > - struct kv_power_info *pi = kv_get_pi(rdev); > - > - if (rdev->family == CHIP_KABINI || rdev->family == CHIP_MULLINS) { > - kv_force_lowest_valid(rdev); > - kv_init_graphics_levels(rdev); > - kv_program_bootup_state(rdev); > - kv_upload_dpm_settings(rdev); > - kv_force_lowest_valid(rdev); > - kv_unforce_levels(rdev); > - } else { > - kv_init_graphics_levels(rdev); > - kv_program_bootup_state(rdev); > - kv_freeze_sclk_dpm(rdev, true); > - kv_upload_dpm_settings(rdev); > - kv_freeze_sclk_dpm(rdev, false); > - kv_set_enabled_level(rdev, pi->graphics_boot_level); > - } > -} > - > //XXX use sumo_dpm_display_configuration_changed > > static void kv_construct_max_power_limits_table(struct radeon_device *rdev, > diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c > index 6d2f16c..dcd5568 100644 > --- a/drivers/gpu/drm/radeon/ni_dpm.c > +++ b/drivers/gpu/drm/radeon/ni_dpm.c > @@ -3862,12 +3862,6 @@ void ni_dpm_post_set_power_state(struct radeon_device *rdev) > ni_update_current_ps(rdev, new_ps); > } > > -void ni_dpm_reset_asic(struct radeon_device *rdev) > -{ > - ni_restrict_performance_levels_before_switch(rdev); > - rv770_set_boot_state(rdev); > -} > - > union power_info { > struct _ATOM_POWERPLAY_INFO info; > struct _ATOM_POWERPLAY_INFO_V2 info_2; > diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c > index 755a8f9..8ee6ff5 100644 > --- a/drivers/gpu/drm/radeon/rv770_dpm.c > +++ b/drivers/gpu/drm/radeon/rv770_dpm.c > @@ -2075,19 +2075,6 @@ int rv770_dpm_set_power_state(struct radeon_device *rdev) > return 0; > } > > -void rv770_dpm_reset_asic(struct radeon_device *rdev) > -{ > - struct rv7xx_power_info *pi = rv770_get_pi(rdev); > - struct radeon_ps *boot_ps = rdev->pm.dpm.boot_ps; > - > - rv770_restrict_performance_levels_before_switch(rdev); > - if (pi->dcodt) > - rv770_program_dcodt_before_state_switch(rdev, boot_ps, boot_ps); > - rv770_set_boot_state(rdev); > - if (pi->dcodt) > - rv770_program_dcodt_after_state_switch(rdev, boot_ps, boot_ps); > -} > - > void rv770_dpm_setup_asic(struct radeon_device *rdev) > { > struct rv7xx_power_info *pi = rv770_get_pi(rdev); > diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c > index 267949a..f06c6f9 100644 > --- a/drivers/gpu/drm/radeon/si_dpm.c > +++ b/drivers/gpu/drm/radeon/si_dpm.c > @@ -3296,12 +3296,6 @@ int si_dpm_force_performance_level(struct radeon_device *rdev, > return 0; > } > > -static int si_set_boot_state(struct radeon_device *rdev) > -{ > - return (si_send_msg_to_smc(rdev, PPSMC_MSG_SwitchToInitialState) == PPSMC_Result_OK) ? > - 0 : -EINVAL; > -} > - > static int si_set_sw_state(struct radeon_device *rdev) > { > return (si_send_msg_to_smc(rdev, PPSMC_MSG_SwitchToSwState) == PPSMC_Result_OK) ? > @@ -6129,14 +6123,6 @@ void si_dpm_post_set_power_state(struct radeon_device *rdev) > ni_update_current_ps(rdev, new_ps); > } > > - > -void si_dpm_reset_asic(struct radeon_device *rdev) > -{ > - si_restrict_performance_levels_before_switch(rdev); > - si_disable_ulv(rdev); > - si_set_boot_state(rdev); > -} > - > void si_dpm_display_configuration_changed(struct radeon_device *rdev) > { > si_program_display_gap(rdev); > diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c > index 1f8a883..698e785 100644 > --- a/drivers/gpu/drm/radeon/sumo_dpm.c > +++ b/drivers/gpu/drm/radeon/sumo_dpm.c > @@ -1338,18 +1338,6 @@ void sumo_dpm_post_set_power_state(struct radeon_device *rdev) > sumo_update_current_ps(rdev, new_ps); > } > > -void sumo_dpm_reset_asic(struct radeon_device *rdev) > -{ > - sumo_program_bootup_state(rdev); > - sumo_enable_power_level_0(rdev); > - sumo_set_forced_level_0(rdev); > - sumo_set_forced_mode_enabled(rdev); > - sumo_wait_for_level_0(rdev); > - sumo_set_forced_mode_disabled(rdev); > - sumo_set_forced_mode_enabled(rdev); > - sumo_set_forced_mode_disabled(rdev); > -} > - > void sumo_dpm_setup_asic(struct radeon_device *rdev) > { > struct sumo_power_info *pi = sumo_get_pi(rdev); > diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c > index b4ec5c4..7428da0 100644 > --- a/drivers/gpu/drm/radeon/trinity_dpm.c > +++ b/drivers/gpu/drm/radeon/trinity_dpm.c > @@ -1269,22 +1269,6 @@ void trinity_dpm_setup_asic(struct radeon_device *rdev) > trinity_release_mutex(rdev); > } > > -void trinity_dpm_reset_asic(struct radeon_device *rdev) > -{ > - struct trinity_power_info *pi = trinity_get_pi(rdev); > - > - trinity_acquire_mutex(rdev); > - if (pi->enable_dpm) { > - trinity_enable_power_level_0(rdev); > - trinity_force_level_0(rdev); > - trinity_wait_for_level_0(rdev); > - trinity_program_bootup_state(rdev); > - trinity_force_level_0(rdev); > - trinity_unforce_levels(rdev); > - } > - trinity_release_mutex(rdev); > -} > - > static u16 trinity_convert_voltage_index_to_value(struct radeon_device *rdev, > u32 vid_2bit) > { > -- > 2.1.2 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-16 14:34 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-10-14 16:25 [PATCH 0/2] radeon/drm: dpm cleanups Michele Curti 2014-10-14 16:25 ` [PATCH 1/2] drm/radeon: reduce sparse false positive warnings Michele Curti 2014-10-16 14:34 ` Alex Deucher 2014-10-14 16:25 ` [PATCH 2/2] drm/radeon: remove never called dpm functions Michele Curti 2014-10-16 14:34 ` Alex Deucher
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox