summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/as_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/as_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/as_gk20a.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
index 038fa4c8..63569008 100644
--- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Address Spaces 2 * GK20A Address Spaces
3 * 3 *
4 * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -225,6 +225,31 @@ static int gk20a_as_ioctl_get_va_regions(
225 return 0; 225 return 0;
226} 226}
227 227
228static int gk20a_as_ioctl_get_buffer_compbits_info(
229 struct gk20a_as_share *as_share,
230 struct nvgpu_as_get_buffer_compbits_info_args *args)
231{
232 gk20a_dbg_fn("");
233 return gk20a_vm_get_compbits_info(as_share->vm,
234 args->mapping_gva,
235 &args->compbits_win_size,
236 &args->compbits_win_ctagline,
237 &args->mapping_ctagline,
238 &args->flags);
239}
240
241static int gk20a_as_ioctl_map_buffer_compbits(
242 struct gk20a_as_share *as_share,
243 struct nvgpu_as_map_buffer_compbits_args *args)
244{
245 gk20a_dbg_fn("");
246 return gk20a_vm_map_compbits(as_share->vm,
247 args->mapping_gva,
248 &args->compbits_win_gva,
249 &args->mapping_iova,
250 args->flags);
251}
252
228int gk20a_as_dev_open(struct inode *inode, struct file *filp) 253int gk20a_as_dev_open(struct inode *inode, struct file *filp)
229{ 254{
230 struct gk20a_as_share *as_share; 255 struct gk20a_as_share *as_share;
@@ -334,6 +359,14 @@ long gk20a_as_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
334 err = gk20a_as_ioctl_get_va_regions(as_share, 359 err = gk20a_as_ioctl_get_va_regions(as_share,
335 (struct nvgpu_as_get_va_regions_args *)buf); 360 (struct nvgpu_as_get_va_regions_args *)buf);
336 break; 361 break;
362 case NVGPU_AS_IOCTL_GET_BUFFER_COMPBITS_INFO:
363 err = gk20a_as_ioctl_get_buffer_compbits_info(as_share,
364 (struct nvgpu_as_get_buffer_compbits_info_args *)buf);
365 break;
366 case NVGPU_AS_IOCTL_MAP_BUFFER_COMPBITS:
367 err = gk20a_as_ioctl_map_buffer_compbits(as_share,
368 (struct nvgpu_as_map_buffer_compbits_args *)buf);
369 break;
337 default: 370 default:
338 dev_dbg(dev_from_gk20a(g), "unrecognized as ioctl: 0x%x", cmd); 371 dev_dbg(dev_from_gk20a(g), "unrecognized as ioctl: 0x%x", cmd);
339 err = -ENOTTY; 372 err = -ENOTTY;