diff options
author | Alex Waterman <alexw@nvidia.com> | 2016-09-26 13:29:25 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-04 04:51:11 -0400 |
commit | 9d97af9e9fd461ed8e69cadb027fe639d7e3247b (patch) | |
tree | f97c53235d022de9de3021c28863f3240d8364eb /drivers | |
parent | bc4182afeb7461e5b211da9a26a796c40395bbfd (diff) |
gpu: nvgpu: Return -EINVAL for bad l2 flush args
When the L2 flush IOCTL gets no l2 flush and no fb flush we now
return -EINVAL. This can sometimes happen if the user tries to just
invalidate. Currently we do not support L2 invalidates only.
Bug 1661242
Change-Id: I87f3259bfbd736b5f4222cfe7b3cfa4a6475389e
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1227125
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 0357f098..220cb3e7 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |||
@@ -330,6 +330,10 @@ static int nvgpu_gpu_ioctl_l2_fb_ops(struct gk20a *g, | |||
330 | { | 330 | { |
331 | int err = 0; | 331 | int err = 0; |
332 | 332 | ||
333 | if ((!args->l2_flush && !args->fb_flush) || | ||
334 | (!args->l2_flush && args->l2_invalidate)) | ||
335 | return -EINVAL; | ||
336 | |||
333 | if (args->l2_flush) | 337 | if (args->l2_flush) |
334 | g->ops.mm.l2_flush(g, args->l2_invalidate ? true : false); | 338 | g->ops.mm.l2_flush(g, args->l2_invalidate ? true : false); |
335 | 339 | ||