diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-07-02 12:58:16 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-01 20:00:00 -0400 |
commit | 21a8122ad38c60d73fe5dc51051414c3564d174a (patch) | |
tree | b20f2bb711e3230fdc3195042c901596de4677e2 /drivers/gpu/drm/radeon/r600.c | |
parent | d7a2952f1adec32018a78ec0c2f504dd72f38e25 (diff) |
drm/radeon/kms: add support for internal thermal sensors (v3)
rv6xx/rv7xx/evergreen families supported; older asics did
not have an internal thermal sensor.
Note, not all oems use the internal thermal sensor, so it's
only exposed in cases where it is used.
Note also, that most laptops use an oem specific ACPI solution for
GPU thermal information rather than using the internal thermal
sensor directly.
v2: export millidegrees celsius, use hwmon device properly.
v3: fix Kconfig
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 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index a73a6e17588d..15fe6c214034 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -92,6 +92,21 @@ 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 | /* get temperature in millidegrees */ | ||
96 | u32 rv6xx_get_temp(struct radeon_device *rdev) | ||
97 | { | ||
98 | u32 temp = (RREG32(CG_THERMAL_STATUS) & ASIC_T_MASK) >> | ||
99 | ASIC_T_SHIFT; | ||
100 | u32 actual_temp = 0; | ||
101 | |||
102 | if ((temp >> 7) & 1) | ||
103 | actual_temp = 0; | ||
104 | else | ||
105 | actual_temp = (temp >> 1) & 0xff; | ||
106 | |||
107 | return actual_temp * 1000; | ||
108 | } | ||
109 | |||
95 | void r600_pm_get_dynpm_state(struct radeon_device *rdev) | 110 | void r600_pm_get_dynpm_state(struct radeon_device *rdev) |
96 | { | 111 | { |
97 | int i; | 112 | int i; |