]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd/pm: Remove unneeded legacy DPM related code.
authorTimur Kristóf <timur.kristof@gmail.com>
Tue, 9 Sep 2025 14:17:52 +0000 (16:17 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Sep 2025 20:52:50 +0000 (16:52 -0400)
This code isn't needed anymore as we collect the same information
into pm_display_cfg instead.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm_internal.h
drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c

index c56839528843591882965bf825ff133dcd7bc1e1..adb4ea792c381c136bb3efa12465ec02019d255d 100644 (file)
@@ -434,7 +434,6 @@ struct amdgpu_clock {
        uint32_t default_mclk;
        uint32_t default_sclk;
        uint32_t default_dispclk;
-       uint32_t current_dispclk;
        uint32_t dp_extclk;
        uint32_t max_pixel_clock;
 };
index 9dfdc08cc8877699542e743b843ce242b6ff4c38..763f2b8dcf13a0db882dbf9cce0b9c8900a5073d 100644 (file)
@@ -706,7 +706,6 @@ int amdgpu_atombios_get_clock_info(struct amdgpu_device *adev)
                }
                adev->clock.dp_extclk =
                        le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq);
-               adev->clock.current_dispclk = adev->clock.default_dispclk;
 
                adev->clock.max_pixel_clock = le16_to_cpu(firmware_info->info.usMaxPixelClock);
                if (adev->clock.max_pixel_clock == 0)
index 9ef965e4a92ed1221657e112d748a88205c90956..b5e9c3ecf70320044034619e1154802903a95977 100644 (file)
 #include "amdgpu_smu.h"
 #include "amdgpu_dpm_internal.h"
 
-void amdgpu_dpm_get_active_displays(struct amdgpu_device *adev)
-{
-       struct drm_device *ddev = adev_to_drm(adev);
-       struct drm_crtc *crtc;
-       struct amdgpu_crtc *amdgpu_crtc;
-
-       adev->pm.dpm.new_active_crtcs = 0;
-       adev->pm.dpm.new_active_crtc_count = 0;
-       if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
-               list_for_each_entry(crtc,
-                                   &ddev->mode_config.crtc_list, head) {
-                       amdgpu_crtc = to_amdgpu_crtc(crtc);
-                       if (amdgpu_crtc->enabled) {
-                               adev->pm.dpm.new_active_crtcs |= (1 << amdgpu_crtc->crtc_id);
-                               adev->pm.dpm.new_active_crtc_count++;
-                       }
-               }
-       }
-}
-
-u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev)
-{
-       struct drm_device *dev = adev_to_drm(adev);
-       struct drm_crtc *crtc;
-       struct amdgpu_crtc *amdgpu_crtc;
-       u32 vblank_in_pixels;
-       u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */
-
-       if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
-               list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
-                       amdgpu_crtc = to_amdgpu_crtc(crtc);
-                       if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) {
-                               vblank_in_pixels =
-                                       amdgpu_crtc->hw_mode.crtc_htotal *
-                                       (amdgpu_crtc->hw_mode.crtc_vblank_end -
-                                       amdgpu_crtc->hw_mode.crtc_vdisplay +
-                                       (amdgpu_crtc->v_border * 2));
-
-                               vblank_time_us = vblank_in_pixels * 1000 / amdgpu_crtc->hw_mode.clock;
-
-                               /* we have issues with mclk switching with
-                                * refresh rates over 120 hz on the non-DC code.
-                                */
-                               if (drm_mode_vrefresh(&amdgpu_crtc->hw_mode) > 120)
-                                       vblank_time_us = 0;
-
-                               break;
-                       }
-               }
-       }
-
-       return vblank_time_us;
-}
-
-u32 amdgpu_dpm_get_vrefresh(struct amdgpu_device *adev)
-{
-       struct drm_device *dev = adev_to_drm(adev);
-       struct drm_crtc *crtc;
-       struct amdgpu_crtc *amdgpu_crtc;
-       u32 vrefresh = 0;
-
-       if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
-               list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
-                       amdgpu_crtc = to_amdgpu_crtc(crtc);
-                       if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) {
-                               vrefresh = drm_mode_vrefresh(&amdgpu_crtc->hw_mode);
-                               break;
-                       }
-               }
-       }
-
-       return vrefresh;
-}
-
 void amdgpu_dpm_get_display_cfg(struct amdgpu_device *adev)
 {
        struct drm_device *ddev = adev_to_drm(adev);
index 9748744133d961233dc44e352c71d0bc6b22a501..65c1d98af26c3b19eeb7c7444ab7b090ba55f6a1 100644 (file)
@@ -263,10 +263,6 @@ struct amdgpu_dpm {
        u32                     voltage_response_time;
        u32                     backbias_response_time;
        void                    *priv;
-       u32                     new_active_crtcs;
-       int                     new_active_crtc_count;
-       u32                     current_active_crtcs;
-       int                     current_active_crtc_count;
        struct amdgpu_dpm_dynamic_state dyn_state;
        struct amdgpu_dpm_fan fan;
        u32 tdp_limit;
index 8be11510cd923657f72eb982a7750c4cb306b6bf..cc6d7ba040e98d67ff5c5551df8412bbbc6a31aa 100644 (file)
 #ifndef __AMDGPU_DPM_INTERNAL_H__
 #define __AMDGPU_DPM_INTERNAL_H__
 
-void amdgpu_dpm_get_active_displays(struct amdgpu_device *adev);
-
-u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev);
-
-u32 amdgpu_dpm_get_vrefresh(struct amdgpu_device *adev);
-
 void amdgpu_dpm_get_display_cfg(struct amdgpu_device *adev);
 
 #endif
index 6ebe3d0f5b8779de6be10f6660d176ba53316693..c7ed0b45712930c2eee4bf025a66843ab99d9b65 100644 (file)
@@ -944,9 +944,6 @@ static int amdgpu_dpm_change_power_state_locked(struct amdgpu_device *adev)
 
        amdgpu_dpm_post_set_power_state(adev);
 
-       adev->pm.dpm.current_active_crtcs = adev->pm.dpm.new_active_crtcs;
-       adev->pm.dpm.current_active_crtc_count = adev->pm.dpm.new_active_crtc_count;
-
        if (pp_funcs->force_performance_level) {
                if (adev->pm.dpm.thermal_active) {
                        enum amd_dpm_forced_level level = adev->pm.dpm.forced_level;