From 9487599da1b1a918353757173dc3125885c802b8 Mon Sep 17 00:00:00 2001 From: Martin Radev Date: Mon, 22 May 2023 21:52:38 +0300 Subject: [PATCH] gpu: nvgpu: update SETUP_BIND uapi This patch updates the SETUP_BIND uapi for conditionally exposing the GPFIFO, UserD and Usermode MMIO GPU VAs to userspace. Bug 3938139 Change-Id: Ifa42d592d5224de075c8c9640dd67cab398a9786 Signed-off-by: Martin Radev Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2908614 Reviewed-by: Dinesh T Reviewed-by: Ankur Kishore GVS: Gerrit_Virtual_Submit --- include/uapi/linux/nvgpu-ctrl.h | 2 ++ include/uapi/linux/nvgpu.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/uapi/linux/nvgpu-ctrl.h b/include/uapi/linux/nvgpu-ctrl.h index 7d196ccf6..5f07bb6df 100644 --- a/include/uapi/linux/nvgpu-ctrl.h +++ b/include/uapi/linux/nvgpu-ctrl.h @@ -201,6 +201,8 @@ struct nvgpu_gpu_zbc_query_table_args { #define NVGPU_GPU_FLAGS_MULTI_PROCESS_TSG_SHARING (1ULL << 56) /* SM LRF ECC is enabled */ #define NVGPU_GPU_FLAGS_ECC_ENABLED_SM_LRF (1ULL << 60) +/* Flag to indicate GPU MMIO support */ +#define NVGPU_GPU_FLAGS_SUPPORT_GPU_MMIO (1ULL << 57) /* SM SHM ECC is enabled */ #define NVGPU_GPU_FLAGS_ECC_ENABLED_SM_SHM (1ULL << 61) /* TEX ECC is enabled */ diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index a5b6ecf8d..e8434f83e 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -1087,12 +1087,19 @@ struct nvgpu_channel_setup_bind_args { * SUBMIT_GPFIFO IOCTL cannot be used. */ #define NVGPU_CHANNEL_SETUP_BIND_FLAGS_USERMODE_SUPPORT (1 << 3) +/* + * Map usermode resources to GPU and return GPU VAs to userspace. + */ +#define NVGPU_CHANNEL_SETUP_BIND_FLAGS_USERMODE_GPU_MAP_RESOURCES_SUPPORT (1 << 4) __u32 flags; __s32 userd_dmabuf_fd; /* in */ __s32 gpfifo_dmabuf_fd; /* in */ __u32 work_submit_token; /* out */ __u64 userd_dmabuf_offset; /* in */ __u64 gpfifo_dmabuf_offset; /* in */ + __u64 gpfifo_gpu_va; /* out */ + __u64 userd_gpu_va; /* out */ + __u64 usermode_mmio_gpu_va; /* out */ __u32 reserved[9]; };