mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
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 Change-Id: I8416af7085c91b044ac8ccd9faa38e2a6d0c3946 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1795821 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
9de6d20abb
commit
99b1c6dcdf
@@ -63,6 +63,19 @@ struct nvgpu_os_fence_framework {
|
||||
struct sync_timeline *timeline;
|
||||
};
|
||||
|
||||
struct nvgpu_usermode_bufs_linux {
|
||||
/*
|
||||
* Common low level info of these is stored in nvgpu_mems in
|
||||
* channel_gk20a; these hold lifetimes for the actual dmabuf and its
|
||||
* dma mapping.
|
||||
*/
|
||||
struct nvgpu_usermode_buf_linux {
|
||||
struct dma_buf *dmabuf;
|
||||
struct dma_buf_attachment *attachment;
|
||||
struct sg_table *sgt;
|
||||
} gpfifo, userd;
|
||||
};
|
||||
|
||||
struct nvgpu_channel_linux {
|
||||
struct channel_gk20a *ch;
|
||||
|
||||
@@ -72,6 +85,8 @@ struct nvgpu_channel_linux {
|
||||
struct nvgpu_error_notifier error_notifier;
|
||||
|
||||
struct dma_buf *cyclestate_buffer_handler;
|
||||
|
||||
struct nvgpu_usermode_bufs_linux usermode;
|
||||
};
|
||||
|
||||
u32 nvgpu_submit_gpfifo_user_flags_to_common_flags(u32 user_flags);
|
||||
|
||||
Reference in New Issue
Block a user