mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-27 05:10:51 +07:00
drm/radeon: add INFO query for GPU temperature
Useful for profiling. Tested-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
b9729b17a4
commit
d6d2a1882a
@ -547,6 +547,13 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file
|
||||
else
|
||||
*value = 1;
|
||||
break;
|
||||
case RADEON_INFO_CURRENT_GPU_TEMP:
|
||||
/* get temperature in millidegrees C */
|
||||
if (rdev->asic->pm.get_temperature)
|
||||
*value = radeon_get_temperature(rdev);
|
||||
else
|
||||
*value = 0;
|
||||
break;
|
||||
default:
|
||||
DRM_DEBUG_KMS("Invalid request %d\n", info->request);
|
||||
return -EINVAL;
|
||||
|
@ -1034,6 +1034,7 @@ struct drm_radeon_cs {
|
||||
#define RADEON_INFO_VRAM_USAGE 0x1e
|
||||
#define RADEON_INFO_GTT_USAGE 0x1f
|
||||
#define RADEON_INFO_ACTIVE_CU_COUNT 0x20
|
||||
#define RADEON_INFO_CURRENT_GPU_TEMP 0x21
|
||||
|
||||
struct drm_radeon_info {
|
||||
uint32_t request;
|
||||
|
Loading…
Reference in New Issue
Block a user