diff options
author | Lakshmanan M <lm@nvidia.com> | 2016-11-08 00:45:56 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-10 06:54:56 -0500 |
commit | 8a63a431c4ab42e8531614fd69e460b7fdc5e31f (patch) | |
tree | 65dcee38d779bcf57bce6a41e49e44b46efb3f69 /drivers/gpu/nvgpu/gk20a | |
parent | eaeb5ff20f7663738cea2a415a7d923febf7ff85 (diff) |
gpu: nvgpu: Add thermal alert limit IOCTL for UMD
Added the thermal alert lmit IOCTL for UMD
JIRA DNVGPU-130
Bug 200231080
Change-Id: I4a84157d90b12b576fa144567a3bdd5d39f5278e
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: http://git-master/r/1249483
(cherry picked from commit d3458008cc3dd98d3a51841b6ed8cea1aed9eb89)
Reviewed-on: http://git-master/r/1253457
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | 29 |
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 | ||
1301 | static 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 | |||
1301 | long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 1325 | long 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; |