summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2018-09-11 07:47:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-08-15 03:58:54 -0400
commit8b484c0b531b95fce024e101cdd204f1f8107c29 (patch)
treed55f5ab0ed32e8c45ecfb9fa639456eba5433de2 /drivers/gpu/nvgpu/include
parent758cb76e225775ba5ac3dd2cb9415cb40dc83810 (diff)
gpu: nvgpu: support usermode submit buffers
Import userd and gpfifo buffers from userspace if provided via NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX. Also supply the work submit token (i.e., the hw channel id) to userspace. To keep the buffers alive, store their dmabuf and attachment/sgt handles in nvgpu_channel_linux. Our nvgpu_mem doesn't provide such data for buffers that are mainly in kernel use. The buffers are freed via a new API in the os_channel interface. Fix a bug in gk20a_channel_free_usermode_buffers: also unmap the usermode gpfifo buffer. Bug 200145225 Bug 200541476 Change-Id: I8416af7085c91b044ac8ccd9faa38e2a6d0c3946 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1795821 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> (cherry picked from commit 99b1c6dcdf328efcfe47338ad1b71a114ab7f272 in dev-main) Reviewed-on: https://git-master.nvidia.com/r/2170603 GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/channel.h2
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/gk20a.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/channel.h b/drivers/gpu/nvgpu/include/nvgpu/channel.h
index d7bf7816..7ca60fe3 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/channel.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/channel.h
@@ -95,7 +95,9 @@ struct nvgpu_setup_bind_args {
95 u32 num_gpfifo_entries; 95 u32 num_gpfifo_entries;
96 u32 num_inflight_jobs; 96 u32 num_inflight_jobs;
97 u32 userd_dmabuf_fd; 97 u32 userd_dmabuf_fd;
98 u64 userd_dmabuf_offset;
98 u32 gpfifo_dmabuf_fd; 99 u32 gpfifo_dmabuf_fd;
100 u64 gpfifo_dmabuf_offset;
99 u32 work_submit_token; 101 u32 work_submit_token;
100 u32 flags; 102 u32 flags;
101}; 103};
diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
index feae7d23..873fa826 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
@@ -1605,7 +1605,8 @@ struct gk20a {
1605 struct nvgpu_gpfifo_userdata userdata, 1605 struct nvgpu_gpfifo_userdata userdata,
1606 u32 start, u32 length); 1606 u32 start, u32 length);
1607 int (*alloc_usermode_buffers)(struct channel_gk20a *c, 1607 int (*alloc_usermode_buffers)(struct channel_gk20a *c,
1608 struct nvgpu_setup_bind_args *gpfifo_args); 1608 struct nvgpu_setup_bind_args *args);
1609 void (*free_usermode_buffers)(struct channel_gk20a *c);
1609 } os_channel; 1610 } os_channel;
1610 1611
1611 struct gk20a_scale_profile *scale_profile; 1612 struct gk20a_scale_profile *scale_profile;