From ae5488c4954a93523347a97a262919a20bb02ea3 Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Thu, 13 Oct 2022 14:40:59 +0530 Subject: [PATCH] gpu: nvgpu: add multi process tsg sharing char for linux Add the characteristic flag NVGPU_SUPPORT_MULTI_PROCESS_TSG_SHARING for Linux. Bug 3677982 JIRA NVGPU-8681 Change-Id: I774c1aa57f91704a28cfb18912eba4f5afe3b9b8 Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2792083 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Scott Long Reviewed-by: Vijayakumar Subbu GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/include/nvgpu/enabled.h | 2 ++ drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 2 ++ drivers/gpu/nvgpu/os/linux/module.c | 1 + include/uapi/linux/nvgpu-ctrl.h | 2 ++ 4 files changed, 7 insertions(+) diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 155d41067..bb8074eae 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h @@ -230,6 +230,8 @@ struct gk20a; "PES Floorsweeping"), \ DEFINE_FLAG(NVGPU_SCHED_EXIT_WAIT_FOR_ERRBAR_SUPPORTED, \ "Implicit ERRBAR support"), \ + DEFINE_FLAG(NVGPU_SUPPORT_MULTI_PROCESS_TSG_SHARING, \ + "Multi process TSG sharing support"), \ DEFINE_FLAG(NVGPU_MAX_ENABLED_BITS, "Marks max number of flags"), /** diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index eddac17ba..673a5b7bf 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -342,6 +342,8 @@ static struct nvgpu_flags_mapping flags_mapping[] = { NVGPU_SUPPORT_NVS_CTRL_FIFO}, {NVGPU_GPU_FLAGS_SCHED_EXIT_WAIT_FOR_ERRBAR_SUPPORTED, NVGPU_SCHED_EXIT_WAIT_FOR_ERRBAR_SUPPORTED}, + {NVGPU_GPU_FLAGS_MULTI_PROCESS_TSG_SHARING, + NVGPU_SUPPORT_MULTI_PROCESS_TSG_SHARING}, }; static u64 nvgpu_ctrl_ioctl_gpu_characteristics_flags(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 210101492..c2e32e7b8 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -340,6 +340,7 @@ void gk20a_init_linux_characteristics(struct gk20a *g) nvgpu_set_enabled(g, NVGPU_SUPPORT_USERSPACE_MANAGED_AS, true); nvgpu_set_enabled(g, NVGPU_SUPPORT_REMAP, true); nvgpu_set_enabled(g, NVGPU_SUPPORT_BUFFER_METADATA, true); + nvgpu_set_enabled(g, NVGPU_SUPPORT_MULTI_PROCESS_TSG_SHARING, true); if (!IS_ENABLED(CONFIG_NVGPU_SYNCFD_NONE)) { nvgpu_set_enabled(g, NVGPU_SUPPORT_SYNC_FENCE_FDS, true); diff --git a/include/uapi/linux/nvgpu-ctrl.h b/include/uapi/linux/nvgpu-ctrl.h index 5ef43986b..057a378d4 100644 --- a/include/uapi/linux/nvgpu-ctrl.h +++ b/include/uapi/linux/nvgpu-ctrl.h @@ -205,6 +205,8 @@ struct nvgpu_gpu_zbc_query_table_args { #define NVGPU_GPU_FLAGS_SUPPORT_NVS_SCHED_CTRL_FIFO (1ULL << 54) /* Flag to indicate whether implicit ERRBAR is supported */ #define NVGPU_GPU_FLAGS_SCHED_EXIT_WAIT_FOR_ERRBAR_SUPPORTED (1ULL << 55) +/* Flag to indicate whether multi-process TSG sharing is supported */ +#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) /* SM SHM ECC is enabled */