mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
Add macros to get current GR instance id and the pointer nvgpu_gr_get_cur_instance_ptr() nvgpu_gr_get_cur_instance_id() This approach makes sure that the caller is getting GR instance pointer under mutex g->mig.gr_syspipe_lock in MIG mode. Trying to access current GR instance outside of this lock in MIG mode dumps a warning. Return 0th instance in case MIG mode is disabled. Use these macros in nvgpu instead of direct reference to g->mig.cur_gr_instance. Store instance id in struct nvgpu_gr. This is to retrieve GR instance id in functions where struct nvgpu_gr pointer is already available. Jira NVGPU-5648 Change-Id: Ibfef6a22371bfdccfdc2a7d636b0a3e8d0eff6d9 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2413140 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>