diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-04-22 13:38:05 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 04:20:57 -0400 |
commit | bae6b5627387a950a8faf366d6027bd0a7a93078 (patch) | |
tree | b69ef13dcec3808efc53a7daf7041a88d3e6427a /drivers/gpu/drm/radeon/r600.c | |
parent | 03214bd5c6e59c83703238227254deef8810513d (diff) |
drm/radeon/kms/pm: add asic specific callbacks for setting power state (v2)
(v2) Add evergreen vbl checks
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 094c29dd96e3..c2d1946535ab 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -92,6 +92,43 @@ void r600_gpu_init(struct radeon_device *rdev); | |||
92 | void r600_fini(struct radeon_device *rdev); | 92 | void r600_fini(struct radeon_device *rdev); |
93 | void r600_irq_disable(struct radeon_device *rdev); | 93 | void r600_irq_disable(struct radeon_device *rdev); |
94 | 94 | ||
95 | void r600_set_power_state(struct radeon_device *rdev) | ||
96 | { | ||
97 | /* if *_clock_mode are the same, *_power_state are as well */ | ||
98 | if (rdev->pm.requested_clock_mode == rdev->pm.current_clock_mode) | ||
99 | return; | ||
100 | |||
101 | DRM_INFO("Setting: e: %d m: %d p: %d\n", | ||
102 | rdev->pm.requested_clock_mode->sclk, | ||
103 | rdev->pm.requested_clock_mode->mclk, | ||
104 | rdev->pm.requested_power_state->non_clock_info.pcie_lanes); | ||
105 | |||
106 | /* set pcie lanes */ | ||
107 | /* TODO */ | ||
108 | |||
109 | /* set voltage */ | ||
110 | /* TODO */ | ||
111 | |||
112 | /* set engine clock */ | ||
113 | radeon_sync_with_vblank(rdev); | ||
114 | radeon_pm_debug_check_in_vbl(rdev, false); | ||
115 | radeon_set_engine_clock(rdev, rdev->pm.requested_clock_mode->sclk); | ||
116 | radeon_pm_debug_check_in_vbl(rdev, true); | ||
117 | |||
118 | #if 0 | ||
119 | /* set memory clock */ | ||
120 | if (rdev->asic->set_memory_clock) { | ||
121 | radeon_sync_with_vblank(rdev); | ||
122 | radeon_pm_debug_check_in_vbl(rdev, false); | ||
123 | radeon_set_memory_clock(rdev, rdev->pm.requested_clock_mode->mclk); | ||
124 | radeon_pm_debug_check_in_vbl(rdev, true); | ||
125 | } | ||
126 | #endif | ||
127 | |||
128 | rdev->pm.current_power_state = rdev->pm.requested_power_state; | ||
129 | rdev->pm.current_clock_mode = rdev->pm.requested_clock_mode; | ||
130 | } | ||
131 | |||
95 | bool r600_gui_idle(struct radeon_device *rdev) | 132 | bool r600_gui_idle(struct radeon_device *rdev) |
96 | { | 133 | { |
97 | if (RREG32(GRBM_STATUS) & GUI_ACTIVE) | 134 | if (RREG32(GRBM_STATUS) & GUI_ACTIVE) |