gpu: nvgpu: ga10b: use a hal instead of a macro

Use the g->ops.grmgr.get_allowed_swizzid_size() hal instead of
smcarb_allowed_swizzid__size1_v(). This helps to avoid the duplication
of another hal when the macro changes for new chips.

JIRA: NVGPU-9078

Change-Id: I2dfb927172c30e945c2c20da7dd64f7f17bc71ae
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2814618
Reviewed-by: svcacv <svcacv@nvidia.com>
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: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Ramalingam C
2022-11-23 10:07:57 +00:00
committed by mobile promotions
parent 8a54f6d840
commit 093974e397

View File

@@ -870,14 +870,14 @@ int ga10b_grmgr_get_gpc_instance_gpcgrp_id(struct gk20a *g,
u32 gpu_instance_id, u32 gr_syspipe_id, u32 *gpcgrp_id)
{
if ((gpu_instance_id >= smcarb_allowed_swizzid__size1_v()) ||
if ((gpu_instance_id >= g->ops.grmgr.get_allowed_swizzid_size(g)) ||
(gr_syspipe_id >= g->ops.grmgr.get_max_sys_pipes(g)) ||
(gpcgrp_id == NULL)) {
nvgpu_err(g,
"[Invalid_param] gr_syspipe_id[%u %u] gpu_instance_id[%u %u] "
"or gpcgrp_id == NULL ",
gr_syspipe_id, g->ops.grmgr.get_max_sys_pipes(g),
gpu_instance_id, smcarb_allowed_swizzid__size1_v());
gpu_instance_id, g->ops.grmgr.get_allowed_swizzid_size(g));
return -EINVAL;
}