gpu: nvgpu: get voltage, current, power and temperature

Add ioctls to retrieve voltage, current, power and temperature.
Add flags in GPU characteristics to indicate if feature is supported.

Jira DNVGPU-166

Change-Id: Idd5a767326c9d43630e8289ca7d2c27bb96a9f14
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1241862
Tested-by: Thomas Fleury <tfleury@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1267153
This commit is contained in:
Thomas Fleury
2016-10-21 16:43:47 -07:00
committed by mobile promotions
parent 71ecc8f660
commit dfb061cbdb
3 changed files with 167 additions and 1 deletions

View File

@@ -721,6 +721,31 @@ struct nvgpu_gpu_get_fbp_l2_masks_args {
__u64 mask_buf_addr;
};
#define NVGPU_GPU_VOLTAGE_CORE 1
#define NVGPU_GPU_VOLTAGE_SRAM 2
#define NVGPU_GPU_VOLTAGE_BUS 3 /* input to regulator */
struct nvgpu_gpu_get_voltage_args {
__u64 reserved;
__u32 which; /* in: NVGPU_GPU_VOLTAGE_* */
__u32 voltage; /* uV */
};
struct nvgpu_gpu_get_current_args {
__u32 reserved[3];
__u32 currnt; /* mA */
};
struct nvgpu_gpu_get_power_args {
__u32 reserved[3];
__u32 power; /* mW */
};
struct nvgpu_gpu_get_temperature_args {
__u32 reserved[3];
__u32 temperature; /* mC */
};
#define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \
_IOR(NVGPU_GPU_IOCTL_MAGIC, 1, struct nvgpu_gpu_zcull_get_ctx_size_args)
#define NVGPU_GPU_IOCTL_ZCULL_GET_INFO \
@@ -792,6 +817,14 @@ struct nvgpu_gpu_get_fbp_l2_masks_args {
#define NVGPU_GPU_IOCTL_GET_MEMORY_STATE \
_IOWR(NVGPU_GPU_IOCTL_MAGIC, 33, \
struct nvgpu_gpu_get_memory_state_args)
#define NVGPU_GPU_IOCTL_GET_VOLTAGE \
_IOWR(NVGPU_GPU_IOCTL_MAGIC, 33, struct nvgpu_gpu_get_voltage_args)
#define NVGPU_GPU_IOCTL_GET_CURRENT \
_IOWR(NVGPU_GPU_IOCTL_MAGIC, 34, struct nvgpu_gpu_get_current_args)
#define NVGPU_GPU_IOCTL_GET_POWER \
_IOWR(NVGPU_GPU_IOCTL_MAGIC, 35, struct nvgpu_gpu_get_power_args)
#define NVGPU_GPU_IOCTL_GET_TEMPERATURE \
_IOWR(NVGPU_GPU_IOCTL_MAGIC, 36, struct nvgpu_gpu_get_temperature_args)
#define NVGPU_GPU_IOCTL_GET_FBP_L2_MASKS \
_IOWR(NVGPU_GPU_IOCTL_MAGIC, 38, struct nvgpu_gpu_get_fbp_l2_masks_args)
#define NVGPU_GPU_IOCTL_LAST \