mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
drm/amd/pm: Remove unneeded legacy DPM related code.
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>
This commit is contained in:
parent
9d73b107a6
commit
156db7d353
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -27,80 +27,6 @@
|
|||
#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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -23,12 +23,6 @@
|
|||
#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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user