summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
diff options
context:
space:
mode:
authorSami Kiminki <skiminki@nvidia.com>2015-10-26 13:23:54 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-11-17 15:38:44 -0500
commit30632cec54048944ee364781b4b8c2676ae5dfed (patch)
tree2d58fe57b8f80eb747aa1f8e3923f982870a9a16 /drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
parent5a24e95fe605a2e7ec4d1a126c9bffd64bd77590 (diff)
gpu: nvgpu: Implement NVGPU_GPU_IOCTL_GET_BUFFER_INFO
Implement NVGPU_GPU_IOCTL_GET_BUFFER_INFO. The new IOCTL can be used to identify buffers and retrieve their sizes. This allows the userspace to be agnostic to the dmabuf implementation, as the generic dmabuf fd interface does not have a reliable way for buffer identification. Bug 1614735 Bug 1623949 Bug 1660392 Change-Id: Ic3dd0a9385c9852778110ccb80636dd6f4f36208 Signed-off-by: Sami Kiminki <skiminki@nvidia.com> Reviewed-on: http://git-master/r/822845 Reviewed-on: http://git-master/r/833252 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
index 3b5ca298..0b6b5913 100644
--- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
@@ -514,6 +514,13 @@ static int gk20a_ctrl_vsm_mapping(struct gk20a *g,
514 return err; 514 return err;
515} 515}
516 516
517static int gk20a_ctrl_get_buffer_info(
518 struct gk20a *g, struct nvgpu_gpu_get_buffer_info_args *args)
519{
520 return gk20a_mm_get_buffer_info(dev_from_gk20a(g), args->in.dmabuf_fd,
521 &args->out.id, &args->out.length);
522}
523
517long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 524long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
518{ 525{
519 struct platform_device *dev = filp->private_data; 526 struct platform_device *dev = filp->private_data;
@@ -729,6 +736,10 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
729 (struct nvgpu_gpu_vsms_mapping *)buf); 736 (struct nvgpu_gpu_vsms_mapping *)buf);
730 break; 737 break;
731 738
739 case NVGPU_GPU_IOCTL_GET_BUFFER_INFO:
740 err = gk20a_ctrl_get_buffer_info(g,
741 (struct nvgpu_gpu_get_buffer_info_args *)buf);
742 break;
732 743
733 default: 744 default:
734 dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd); 745 dev_dbg(dev_from_gk20a(g), "unrecognized gpu ioctl cmd: 0x%x", cmd);