summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c4
-rw-r--r--include/uapi/linux/nvgpu.h5
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
index 23fbdce0..6768dbeb 100644
--- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
@@ -1278,9 +1278,7 @@ static int nvgpu_gpu_get_temperature(struct gk20a *g,
1278 1278
1279 gk20a_idle(g->dev); 1279 gk20a_idle(g->dev);
1280 1280
1281 /* Convert from standard S24.8 fixed point to mC */ 1281 args->temp_f24_8 = (s32)temp_f24_8;
1282 if (!err)
1283 args->temperature = (temp_f24_8 * 1000) / 256;
1284 1282
1285 return err; 1283 return err;
1286} 1284}
diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h
index 16aa51b2..0aeea4f0 100644
--- a/include/uapi/linux/nvgpu.h
+++ b/include/uapi/linux/nvgpu.h
@@ -743,7 +743,10 @@ struct nvgpu_gpu_get_power_args {
743 743
744struct nvgpu_gpu_get_temperature_args { 744struct nvgpu_gpu_get_temperature_args {
745 __u32 reserved[3]; 745 __u32 reserved[3];
746 __u32 temperature; /* mC */ 746 /* Temperature in signed fixed point format SFXP24.8
747 * Celsius = temp_f24_8 / 256.
748 */
749 __s32 temp_f24_8;
747}; 750};
748 751
749#define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \ 752#define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \