diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/rv770.c')
-rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 6a7bf109197..836c15ab84d 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -42,6 +42,21 @@ | |||
42 | static void rv770_gpu_init(struct radeon_device *rdev); | 42 | static void rv770_gpu_init(struct radeon_device *rdev); |
43 | void rv770_fini(struct radeon_device *rdev); | 43 | void rv770_fini(struct radeon_device *rdev); |
44 | 44 | ||
45 | /* get temperature in millidegrees */ | ||
46 | u32 rv770_get_temp(struct radeon_device *rdev) | ||
47 | { | ||
48 | u32 temp = (RREG32(CG_MULT_THERMAL_STATUS) & ASIC_T_MASK) >> | ||
49 | ASIC_T_SHIFT; | ||
50 | u32 actual_temp = 0; | ||
51 | |||
52 | if ((temp >> 9) & 1) | ||
53 | actual_temp = 0; | ||
54 | else | ||
55 | actual_temp = (temp >> 1) & 0xff; | ||
56 | |||
57 | return actual_temp * 1000; | ||
58 | } | ||
59 | |||
45 | void rv770_pm_misc(struct radeon_device *rdev) | 60 | void rv770_pm_misc(struct radeon_device *rdev) |
46 | { | 61 | { |
47 | int req_ps_idx = rdev->pm.requested_power_state_index; | 62 | int req_ps_idx = rdev->pm.requested_power_state_index; |