Commit 9e9d9762 authored by Alex Deucher's avatar Alex Deucher

drm/radeon/dpm: add new callback for powergating UVD (v4)

Starting on CIK, multi-media blocks like UVD no longer
have special power state.  Rather they have their own
DPM implementation which adjusts their clocks dynamically
when active.  When they are not active, the blocks are
powergated to save power.

v2: add missing pm locks
v3: rebase on uvd state selection rework
v4: fix inverted logic typo noticed by Christian
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2b4c8022
...@@ -1730,6 +1730,7 @@ struct radeon_asic { ...@@ -1730,6 +1730,7 @@ struct radeon_asic {
void (*debugfs_print_current_performance_level)(struct radeon_device *rdev, struct seq_file *m); void (*debugfs_print_current_performance_level)(struct radeon_device *rdev, struct seq_file *m);
int (*force_performance_level)(struct radeon_device *rdev, enum radeon_dpm_forced_level level); int (*force_performance_level)(struct radeon_device *rdev, enum radeon_dpm_forced_level level);
bool (*vblank_too_short)(struct radeon_device *rdev); bool (*vblank_too_short)(struct radeon_device *rdev);
void (*powergate_uvd)(struct radeon_device *rdev, bool gate);
} dpm; } dpm;
/* pageflipping */ /* pageflipping */
struct { struct {
...@@ -2518,6 +2519,7 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v); ...@@ -2518,6 +2519,7 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v);
#define radeon_dpm_debugfs_print_current_performance_level(rdev, m) rdev->asic->dpm.debugfs_print_current_performance_level((rdev), (m)) #define radeon_dpm_debugfs_print_current_performance_level(rdev, m) rdev->asic->dpm.debugfs_print_current_performance_level((rdev), (m))
#define radeon_dpm_force_performance_level(rdev, l) rdev->asic->dpm.force_performance_level((rdev), (l)) #define radeon_dpm_force_performance_level(rdev, l) rdev->asic->dpm.force_performance_level((rdev), (l))
#define radeon_dpm_vblank_too_short(rdev) rdev->asic->dpm.vblank_too_short((rdev)) #define radeon_dpm_vblank_too_short(rdev) rdev->asic->dpm.vblank_too_short((rdev))
#define radeon_dpm_powergate_uvd(rdev, g) rdev->asic->dpm.powergate_uvd((rdev), (g))
/* Common functions */ /* Common functions */
/* AGP */ /* AGP */
......
...@@ -886,6 +886,12 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable) ...@@ -886,6 +886,12 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable)
{ {
enum radeon_pm_state_type dpm_state; enum radeon_pm_state_type dpm_state;
if (rdev->asic->dpm.powergate_uvd) {
mutex_lock(&rdev->pm.mutex);
/* enable/disable UVD */
radeon_dpm_powergate_uvd(rdev, !enable);
mutex_unlock(&rdev->pm.mutex);
} else {
if (enable) { if (enable) {
mutex_lock(&rdev->pm.mutex); mutex_lock(&rdev->pm.mutex);
rdev->pm.dpm.uvd_active = true; rdev->pm.dpm.uvd_active = true;
...@@ -908,6 +914,7 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable) ...@@ -908,6 +914,7 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable)
} }
radeon_pm_compute_clocks(rdev); radeon_pm_compute_clocks(rdev);
}
} }
static void radeon_pm_suspend_old(struct radeon_device *rdev) static void radeon_pm_suspend_old(struct radeon_device *rdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment