diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 5bb62dd3..f7cafc52 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -2264,6 +2264,48 @@ long gk20a_channel_ioctl(struct file *filp, | |||
2264 | ((struct nvhost_set_priority_args *)buf)->priority); | 2264 | ((struct nvhost_set_priority_args *)buf)->priority); |
2265 | gk20a_idle(dev); | 2265 | gk20a_idle(dev); |
2266 | break; | 2266 | break; |
2267 | case NVHOST_IOCTL_CHANNEL_ENABLE: | ||
2268 | err = gk20a_busy(dev); | ||
2269 | if (err) { | ||
2270 | dev_err(&dev->dev, | ||
2271 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | ||
2272 | __func__, cmd); | ||
2273 | return err; | ||
2274 | } | ||
2275 | /* enable channel */ | ||
2276 | gk20a_writel(ch->g, ccsr_channel_r(ch->hw_chid), | ||
2277 | gk20a_readl(ch->g, ccsr_channel_r(ch->hw_chid)) | | ||
2278 | ccsr_channel_enable_set_true_f()); | ||
2279 | gk20a_idle(dev); | ||
2280 | break; | ||
2281 | case NVHOST_IOCTL_CHANNEL_DISABLE: | ||
2282 | err = gk20a_busy(dev); | ||
2283 | if (err) { | ||
2284 | dev_err(&dev->dev, | ||
2285 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | ||
2286 | __func__, cmd); | ||
2287 | return err; | ||
2288 | } | ||
2289 | /* disable channel */ | ||
2290 | gk20a_writel(ch->g, ccsr_channel_r(ch->hw_chid), | ||
2291 | gk20a_readl(ch->g, ccsr_channel_r(ch->hw_chid)) | | ||
2292 | ccsr_channel_enable_clr_true_f()); | ||
2293 | gk20a_idle(dev); | ||
2294 | break; | ||
2295 | case NVHOST_IOCTL_CHANNEL_PREEMPT: | ||
2296 | if (gk20a_is_channel_marked_as_tsg(ch)) | ||
2297 | return -EINVAL; | ||
2298 | err = gk20a_busy(dev); | ||
2299 | if (err) { | ||
2300 | dev_err(&dev->dev, | ||
2301 | "%s: failed to host gk20a for ioctl cmd: 0x%x", | ||
2302 | __func__, cmd); | ||
2303 | return err; | ||
2304 | } | ||
2305 | /* preempt channel */ | ||
2306 | err = gk20a_fifo_preempt_channel(ch->g, ch->hw_chid); | ||
2307 | gk20a_idle(dev); | ||
2308 | break; | ||
2267 | default: | 2309 | default: |
2268 | dev_err(&dev->dev, "unrecognized ioctl cmd: 0x%x", cmd); | 2310 | dev_err(&dev->dev, "unrecognized ioctl cmd: 0x%x", cmd); |
2269 | err = -ENOTTY; | 2311 | err = -ENOTTY; |