diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2014-07-31 05:10:36 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:10:47 -0400 |
commit | fff31d310c03a6e34234a133df694d4e4d777754 (patch) | |
tree | 694b2d72f54112950d08354113607442dce5fe33 /drivers | |
parent | 19b8f854ce5861598bb7749775440bd2f946c348 (diff) |
gpu: nvgpu: add channel enable/disable ioctls
Add below ioctls for channels
1. NVHOST_IOCTL_CHANNEL_ENABLE
To enable the channel
2. NVHOST_IOCTL_CHANNEL_DISABLE
To disable the channel
3. NVHOST_IOCTL_CHANNEL_PREEMPT
To preempt the channel
(Not supported for a channel in TSG)
Bug 1514064
Change-Id: Ie9315f9742bb27efb22f993799c51a1ecda91756
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/449229
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-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; |