diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2018-09-11 07:47:51 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-08-15 03:58:54 -0400 |
commit | 8b484c0b531b95fce024e101cdd204f1f8107c29 (patch) | |
tree | d55f5ab0ed32e8c45ecfb9fa639456eba5433de2 /include/uapi/linux | |
parent | 758cb76e225775ba5ac3dd2cb9415cb40dc83810 (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 'include/uapi/linux')
-rw-r--r-- | include/uapi/linux/nvgpu.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 0fa04f6b..38139524 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h | |||
@@ -1514,8 +1514,24 @@ struct nvgpu_channel_setup_bind_args { | |||
1514 | #define NVGPU_CHANNEL_SETUP_BIND_FLAGS_DETERMINISTIC (1 << 1) | 1514 | #define NVGPU_CHANNEL_SETUP_BIND_FLAGS_DETERMINISTIC (1 << 1) |
1515 | /* enable replayable gmmu faults for this channel */ | 1515 | /* enable replayable gmmu faults for this channel */ |
1516 | #define NVGPU_CHANNEL_SETUP_BIND_FLAGS_REPLAYABLE_FAULTS_ENABLE (1 << 2) | 1516 | #define NVGPU_CHANNEL_SETUP_BIND_FLAGS_REPLAYABLE_FAULTS_ENABLE (1 << 2) |
1517 | /* | ||
1518 | * Enable usermode submits on this channel. | ||
1519 | * | ||
1520 | * Submits in usermode are supported in some environments. If supported and | ||
1521 | * this flag is set + USERD and GPFIFO buffers are provided here, a submit | ||
1522 | * token is passed back to be written in the doorbell register in the usermode | ||
1523 | * region to notify the GPU for new work on this channel. Usermode and | ||
1524 | * kernelmode submit modes are mutually exclusive; by passing this flag, the | ||
1525 | * SUBMIT_GPFIFO IOCTL cannot be used. | ||
1526 | */ | ||
1527 | #define NVGPU_CHANNEL_SETUP_BIND_FLAGS_USERMODE_SUPPORT (1 << 3) | ||
1517 | __u32 flags; | 1528 | __u32 flags; |
1518 | __u32 reserved[16]; | 1529 | __s32 userd_dmabuf_fd; /* in */ |
1530 | __s32 gpfifo_dmabuf_fd; /* in */ | ||
1531 | __u32 work_submit_token; /* out */ | ||
1532 | __u64 userd_dmabuf_offset; /* in */ | ||
1533 | __u64 gpfifo_dmabuf_offset; /* in */ | ||
1534 | __u32 reserved[9]; | ||
1519 | }; | 1535 | }; |
1520 | struct nvgpu_fence { | 1536 | struct nvgpu_fence { |
1521 | __u32 id; /* syncpoint id or sync fence fd */ | 1537 | __u32 id; /* syncpoint id or sync fence fd */ |