summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/hal_gp106.c
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2016-10-21 19:43:39 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:52 -0500
commit849c5317e8509b390da626bcb607e66cc5ef847f (patch)
treea50207bd32926991b1a482dd1de5a24c1d44b97f /drivers/gpu/nvgpu/gp106/hal_gp106.c
parent5ab254c6e84d741f56e9bcc93512f82eb7ce518c (diff)
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: Ifaafe2efdb6b09d7b28215b641814f28e894151e Signed-off-by: David Martinez Nieto <dmartineznie@nvidia.com> Reviewed-on: http://git-master/r/1241861 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/1267122
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/hal_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index dc27cdae..ee361953 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -187,6 +187,24 @@ static int gp106_get_litter_value(struct gk20a *g, int value)
187 return ret; 187 return ret;
188} 188}
189 189
190int gp106_init_gpu_characteristics(struct gk20a *g)
191{
192 struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics;
193
194 int err;
195
196 err = gk20a_init_gpu_characteristics(g);
197 if (err)
198 return err;
199
200 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_GET_VOLTAGE |
201 NVGPU_GPU_FLAGS_SUPPORT_GET_CURRENT |
202 NVGPU_GPU_FLAGS_SUPPORT_GET_POWER |
203 NVGPU_GPU_FLAGS_SUPPORT_GET_TEMPERATURE;
204
205 return 0;
206}
207
190int gp106_init_hal(struct gk20a *g) 208int gp106_init_hal(struct gk20a *g)
191{ 209{
192 struct gpu_ops *gops = &g->ops; 210 struct gpu_ops *gops = &g->ops;
@@ -224,7 +242,7 @@ int gp106_init_hal(struct gk20a *g)
224 242
225 gops->name = "gp10x"; 243 gops->name = "gp10x";
226 gops->get_litter_value = gp106_get_litter_value; 244 gops->get_litter_value = gp106_get_litter_value;
227 gops->chip_init_gpu_characteristics = gk20a_init_gpu_characteristics; 245 gops->chip_init_gpu_characteristics = gp106_init_gpu_characteristics;
228 gops->gr_ctx.use_dma_for_fw_bootstrap = true; 246 gops->gr_ctx.use_dma_for_fw_bootstrap = true;
229 gops->read_ptimer = gk20a_read_ptimer; 247 gops->read_ptimer = gk20a_read_ptimer;
230 248