summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
index 9ee06bf3..a7f61c8c 100644
--- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
@@ -1298,6 +1298,30 @@ static int nvgpu_gpu_get_temperature(struct gk20a *g,
1298} 1298}
1299#endif 1299#endif
1300 1300
1301static int nvgpu_gpu_set_therm_alert_limit(struct gk20a *g,
1302 struct nvgpu_gpu_set_therm_alert_limit_args *args)
1303{
1304 int err;
1305
1306 gk20a_dbg_fn("");
1307
1308 if (args->reserved[0] || args->reserved[1] || args->reserved[2])
1309 return -EINVAL;
1310
1311 if (!g->ops.therm.configure_therm_alert)
1312 return -EINVAL;
1313
1314 err = gk20a_busy(g->dev);
1315 if (err)
1316 return err;
1317
1318 err = g->ops.therm.configure_therm_alert(g, args->temp_f24_8);
1319
1320 gk20a_idle(g->dev);
1321
1322 return err;
1323}
1324
1301long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 1325long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1302{ 1326{
1303 struct gk20a_ctrl_priv *priv = filp->private_data; 1327 struct gk20a_ctrl_priv *priv = filp->private_data;
@@ -1606,6 +1630,11 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
1606 break; 1630 break;
1607#endif 1631#endif
1608 1632
1633 case NVGPU_GPU_IOCTL_SET_THERM_ALERT_LIMIT:
1634 err = nvgpu_gpu_set_therm_alert_limit(g,
1635 (struct nvgpu_gpu_set_therm_alert_limit_args *)buf);
1636 break;
1637
1609 default: 1638 default:
1610 dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd); 1639 dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd);
1611 err = -ENOTTY; 1640 err = -ENOTTY;