From 789ebda23d2172fdaecdf65482ac84f774bc649d Mon Sep 17 00:00:00 2001 From: Martin Radev Date: Thu, 11 May 2023 11:08:49 +0300 Subject: [PATCH] nvgpu: Expose HES PM resource This patch adds the HES profiling resource. Bug 3944963 Change-Id: Ie7ea4d060cfdc6803262166c1c89d0c2d155c9e3 Signed-off-by: Martin Radev Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2901996 GVS: Gerrit_Virtual_Submit Reviewed-by: Kishan Palankar Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/os/linux/ioctl_prof.c | 2 ++ include/uapi/linux/nvgpu.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_prof.c b/drivers/gpu/nvgpu/os/linux/ioctl_prof.c index 03416344d..1b2fdf05e 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_prof.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_prof.c @@ -271,6 +271,8 @@ static int nvgpu_prof_ioctl_get_pm_resource_type(u32 resource, case NVGPU_PROFILER_PM_RESOURCE_ARG_PC_SAMPLER: *pm_resource = NVGPU_PROFILER_PM_RESOURCE_TYPE_PC_SAMPLER; return 0; + case NVGPU_PROFILER_PM_RESOURCE_ARG_HES_CWD: + return -EINVAL; default: break; } diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 8caf991e6..a5b6ecf8d 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -803,6 +803,7 @@ struct nvgpu_profiler_bind_context_args { #define NVGPU_PROFILER_PM_RESOURCE_ARG_HWPM_LEGACY 0U #define NVGPU_PROFILER_PM_RESOURCE_ARG_SMPC 1U #define NVGPU_PROFILER_PM_RESOURCE_ARG_PC_SAMPLER 2U +#define NVGPU_PROFILER_PM_RESOURCE_ARG_HES_CWD 3U struct nvgpu_profiler_reserve_pm_resource_args { __u32 resource; /* in: NVGPU_PROFILER_PM_RESOURCE_ARG_* resource to be reserved */