aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r100.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-04-22 13:38:05 -0400
committerDave Airlie <airlied@redhat.com>2010-05-18 04:20:57 -0400
commitbae6b5627387a950a8faf366d6027bd0a7a93078 (patch)
treeb69ef13dcec3808efc53a7daf7041a88d3e6427a /drivers/gpu/drm/radeon/r100.c
parent03214bd5c6e59c83703238227254deef8810513d (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/r100.c')
-rw-r--r--drivers/gpu/drm/radeon/r100.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index d35298684f30..b076b96f8b6c 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -67,6 +67,43 @@ MODULE_FIRMWARE(FIRMWARE_R520);
67 * r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 67 * r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280
68 */ 68 */
69 69
70void r100_set_power_state(struct radeon_device *rdev)
71{
72 /* if *_clock_mode are the same, *_power_state are as well */
73 if (rdev->pm.requested_clock_mode == rdev->pm.current_clock_mode)
74 return;
75
76 DRM_INFO("Setting: e: %d m: %d p: %d\n",
77 rdev->pm.requested_clock_mode->sclk,
78 rdev->pm.requested_clock_mode->mclk,
79 rdev->pm.requested_power_state->non_clock_info.pcie_lanes);
80
81 /* set pcie lanes */
82 /* TODO */
83
84 /* set voltage */
85 /* TODO */
86
87 /* set engine clock */
88 radeon_sync_with_vblank(rdev);
89 radeon_pm_debug_check_in_vbl(rdev, false);
90 radeon_set_engine_clock(rdev, rdev->pm.requested_clock_mode->sclk);
91 radeon_pm_debug_check_in_vbl(rdev, true);
92
93#if 0
94 /* set memory clock */
95 if (rdev->asic->set_memory_clock) {
96 radeon_sync_with_vblank(rdev);
97 radeon_pm_debug_check_in_vbl(rdev, false);
98 radeon_set_memory_clock(rdev, rdev->pm.requested_clock_mode->mclk);
99 radeon_pm_debug_check_in_vbl(rdev, true);
100 }
101#endif
102
103 rdev->pm.current_power_state = rdev->pm.requested_power_state;
104 rdev->pm.current_clock_mode = rdev->pm.requested_clock_mode;
105}
106
70bool r100_gui_idle(struct radeon_device *rdev) 107bool r100_gui_idle(struct radeon_device *rdev)
71{ 108{
72 if (RREG32(RADEON_RBBM_STATUS) & RADEON_RBBM_ACTIVE) 109 if (RREG32(RADEON_RBBM_STATUS) & RADEON_RBBM_ACTIVE)