gpu: nvgpu: prof: add new resource type

Add new profiler resource type NVGPU_PROFILER_PM_RESOURCE_TYPE_PC_SAMPLER.
Introduce regops HAL get_hwpm_pc_sampler_register_ranges to get
allowlist for PC_SAMPLER resources. Re-generate allowlist files to include
register ranges for PC_SAMPLER resources.

Update uapi header to advertise new resource type
NVGPU_PROFILER_PM_RESOURCE_ARG_PC_SAMPLER.

Bug 3408536

Change-Id: I7009ef822665771eed727da48ef1e89dcc6b9c4b
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2689057
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Antony Clince Alex
2022-03-29 08:35:06 +00:00
committed by mobile promotions
parent 11819380e8
commit 19a8adeae1
19 changed files with 381 additions and 78 deletions

View File

@@ -267,6 +267,9 @@ static int nvgpu_prof_ioctl_get_pm_resource_type(u32 resource,
case NVGPU_PROFILER_PM_RESOURCE_ARG_SMPC:
*pm_resource = NVGPU_PROFILER_PM_RESOURCE_TYPE_SMPC;
return 0;
case NVGPU_PROFILER_PM_RESOURCE_ARG_PC_SAMPLER:
*pm_resource = NVGPU_PROFILER_PM_RESOURCE_TYPE_PC_SAMPLER;
return 0;
default:
break;
}
@@ -307,6 +310,17 @@ static int nvgpu_prof_ioctl_reserve_pm_resource(struct nvgpu_profiler_object *pr
nvgpu_err(g, "SMPC global mode not supported");
return -EINVAL;
}
/*
* PC_SAMPLER resources are always context switched with a GR
* context, so reservation scope is always context. This
* requires that profiler object is instantiated with a valid
* GR context.
*/
if ((pm_resource == NVGPU_PROFILER_PM_RESOURCE_TYPE_PC_SAMPLER)
&& (prof->tsg == NULL)) {
nvgpu_err(g, "PC_SAMPLER reservation is only allowed wth context bound");
return -EINVAL;
}
if (flag_ctxsw) {
prof->ctxsw[pm_resource] = true;
} else {