diff --git a/drivers/gpu/nvgpu/common/linux/dmabuf.c b/drivers/gpu/nvgpu/common/linux/dmabuf.c index 08cf5f2bd..580dfcae9 100644 --- a/drivers/gpu/nvgpu/common/linux/dmabuf.c +++ b/drivers/gpu/nvgpu/common/linux/dmabuf.c @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -140,7 +140,6 @@ int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev) { struct gk20a *g = gk20a_get_platform(dev)->g; struct gk20a_dmabuf_priv *priv; - static u64 priv_count = 0; priv = dma_buf_get_drvdata(dmabuf, dev); if (likely(priv)) @@ -159,7 +158,6 @@ int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev) nvgpu_mutex_init(&priv->lock); nvgpu_init_list_node(&priv->states); - priv->buffer_id = ++priv_count; priv->g = g; dma_buf_set_drvdata(dmabuf, dev, priv, gk20a_mm_delete_priv); @@ -214,34 +212,3 @@ out: *state = s; return err; } - -int gk20a_mm_get_buffer_info(struct device *dev, int dmabuf_fd, - u64 *buffer_id, u64 *buffer_len) -{ - struct dma_buf *dmabuf; - struct gk20a_dmabuf_priv *priv; - int err = 0; - - dmabuf = dma_buf_get(dmabuf_fd); - if (IS_ERR(dmabuf)) { - dev_warn(dev, "%s: fd %d is not a dmabuf", __func__, dmabuf_fd); - return PTR_ERR(dmabuf); - } - - err = gk20a_dmabuf_alloc_drvdata(dmabuf, dev); - if (err) { - dev_warn(dev, "Failed to allocate dmabuf drvdata (err = %d)", - err); - goto clean_up; - } - - priv = dma_buf_get_drvdata(dmabuf, dev); - if (likely(priv)) { - *buffer_id = priv->buffer_id; - *buffer_len = dmabuf->size; - } - -clean_up: - dma_buf_put(dmabuf); - return err; -} diff --git a/drivers/gpu/nvgpu/common/linux/dmabuf.h b/drivers/gpu/nvgpu/common/linux/dmabuf.h index 8e6c139b9..d30ff5a5a 100644 --- a/drivers/gpu/nvgpu/common/linux/dmabuf.h +++ b/drivers/gpu/nvgpu/common/linux/dmabuf.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -57,7 +57,4 @@ int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev); int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct gk20a *g, u64 offset, struct gk20a_buffer_state **state); -int gk20a_mm_get_buffer_info(struct device *dev, int dmabuf_fd, - u64 *buffer_id, u64 *buffer_len); - #endif diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index ebbe7ddae..b751a3377 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -753,13 +753,6 @@ static int gk20a_ctrl_vsm_mapping(struct gk20a *g, return err; } -static int gk20a_ctrl_get_buffer_info( - struct gk20a *g, struct nvgpu_gpu_get_buffer_info_args *args) -{ - return gk20a_mm_get_buffer_info(dev_from_gk20a(g), args->in.dmabuf_fd, - &args->out.id, &args->out.length); -} - static int nvgpu_gpu_get_cpu_time_correlation_info( struct gk20a *g, struct nvgpu_gpu_get_cpu_time_correlation_info_args *args) @@ -1757,11 +1750,6 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg (struct nvgpu_gpu_vsms_mapping *)buf); break; - case NVGPU_GPU_IOCTL_GET_BUFFER_INFO: - err = gk20a_ctrl_get_buffer_info(g, - (struct nvgpu_gpu_get_buffer_info_args *)buf); - break; - case NVGPU_GPU_IOCTL_GET_CPU_TIME_CORRELATION_INFO: err = nvgpu_gpu_get_cpu_time_correlation_info(g, (struct nvgpu_gpu_get_cpu_time_correlation_info_args *)buf); diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 391d482dc..4ee6a459e 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -1,7 +1,7 @@ /* * NVGPU Public Interface Header * - * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -892,8 +892,6 @@ struct nvgpu_gpu_set_deterministic_opts_args { _IOWR(NVGPU_GPU_IOCTL_MAGIC, 18, struct nvgpu_gpu_num_vsms) #define NVGPU_GPU_IOCTL_VSMS_MAPPING \ _IOWR(NVGPU_GPU_IOCTL_MAGIC, 19, struct nvgpu_gpu_vsms_mapping) -#define NVGPU_GPU_IOCTL_GET_BUFFER_INFO \ - _IOWR(NVGPU_GPU_IOCTL_MAGIC, 20, struct nvgpu_gpu_get_buffer_info_args) #define NVGPU_GPU_IOCTL_RESUME_FROM_PAUSE \ _IO(NVGPU_GPU_IOCTL_MAGIC, 21) #define NVGPU_GPU_IOCTL_TRIGGER_SUSPEND \