mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: Add api to get the gr_instance_id
Added api to get the gr_instance_id from gr_syspipe_id. JIRA NVGPU-5653 Change-Id: Ie4e931cb6d30a7ec4120d186ab8006cf2b604bd3 Signed-off-by: Lakshmanan M <lm@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2414597 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Alex Waterman
parent
689cf24256
commit
56a73c8230
@@ -396,3 +396,30 @@ u32 nvgpu_grmgr_get_gr_runlist_id(struct gk20a *g, u32 gpu_instance_id)
|
||||
|
||||
return U32_MAX;
|
||||
}
|
||||
|
||||
u32 nvgpu_grmgr_get_gr_instance_id_for_syspipe(struct gk20a *g,
|
||||
u32 gr_syspipe_id)
|
||||
{
|
||||
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_MIG)) {
|
||||
u32 gr_instance_id = 0U;
|
||||
u32 index;
|
||||
/* 0th entry is physical device gpu instance. */
|
||||
for (index = 1U; index < g->mig.num_gpu_instances; ++index) {
|
||||
struct nvgpu_gpu_instance *gpu_instance =
|
||||
&g->mig.gpu_instance[index];
|
||||
struct nvgpu_gr_syspipe *gr_syspipe =
|
||||
&gpu_instance->gr_syspipe;
|
||||
|
||||
if (gr_syspipe->gr_syspipe_id == gr_syspipe_id) {
|
||||
nvgpu_log(g, gpu_dbg_mig,
|
||||
"gr_instance_id[%u] gr_syspipe_id[%u]",
|
||||
gr_instance_id, gr_syspipe_id);
|
||||
return gr_instance_id;
|
||||
}
|
||||
++gr_instance_id;
|
||||
}
|
||||
}
|
||||
|
||||
/* Default gr_instance_id is 0U for legacy mode. */
|
||||
return 0U;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user