mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: remove NVGPU_GR_NUM_INSTANCES
common.gr defined a temporary macro NVGPU_GR_NUM_INSTANCES to enable or disable multiple GR instances from common.gr unit. Multiple GR instance boot is now verified, so we can remove this temporary solution. Note that nvgpu_grmgr_get_num_gr_instances() will return more than 1 instance only if NVGPU_SUPPORT_MIG is enabled. Update unit tests to set number of syspipes to 1 to allow enumeration of GR instance by grmgr. Jira NVGPU-5648 Change-Id: I795901ae516843ae7b6c1794dae0f023a213ab1d Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2418377 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User 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: Lakshmanan M <lm@nvidia.com> Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
b9050c51c1
commit
d2bb5df3c7
@@ -53,14 +53,6 @@
|
||||
|
||||
#include "gr_priv.h"
|
||||
|
||||
/*
|
||||
* Use this until common.gr is completely updated to support multiple
|
||||
* GR instances. Once that is supported, nvgpu_grmgr_get_num_gr_instances()
|
||||
* should be used to get number of GR instances.
|
||||
* Set this to 0 for local MIG testing.
|
||||
*/
|
||||
#define NVGPU_GR_NUM_INSTANCES 1
|
||||
|
||||
static int gr_alloc_global_ctx_buffers(struct gk20a *g, struct nvgpu_gr *gr)
|
||||
{
|
||||
int err;
|
||||
@@ -875,10 +867,7 @@ int nvgpu_gr_alloc(struct gk20a *g)
|
||||
return 0;
|
||||
}
|
||||
|
||||
g->num_gr_instances = NVGPU_GR_NUM_INSTANCES;
|
||||
if (g->num_gr_instances == 0U) {
|
||||
g->num_gr_instances = nvgpu_grmgr_get_num_gr_instances(g);
|
||||
}
|
||||
if (g->num_gr_instances == 0U) {
|
||||
nvgpu_err(g, "No GR engine enumerated");
|
||||
return -EINVAL;
|
||||
|
||||
@@ -180,6 +180,7 @@ static void nvgpu_init_gr_manager(struct gk20a *g)
|
||||
struct nvgpu_gr_syspipe *gr_syspipe = &gpu_instance->gr_syspipe;
|
||||
|
||||
g->mig.num_gpu_instances = 1;
|
||||
g->mig.num_gr_sys_pipes_enabled = 1;
|
||||
gr_syspipe->gr_instance_id = 0U;
|
||||
gr_syspipe->gr_syspipe_id = 0U;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ static void nvgpu_init_gr_manager(struct gk20a *g)
|
||||
struct nvgpu_gr_syspipe *gr_syspipe = &gpu_instance->gr_syspipe;
|
||||
|
||||
g->mig.num_gpu_instances = 1;
|
||||
g->mig.num_gr_sys_pipes_enabled = 1;
|
||||
gr_syspipe->gr_instance_id = 0U;
|
||||
gr_syspipe->gr_syspipe_id = 0U;
|
||||
}
|
||||
|
||||
@@ -248,6 +248,7 @@ static void nvgpu_init_gr_manager(struct gk20a *g)
|
||||
struct nvgpu_gr_syspipe *gr_syspipe = &gpu_instance->gr_syspipe;
|
||||
|
||||
g->mig.num_gpu_instances = 1;
|
||||
g->mig.num_gr_sys_pipes_enabled = 1;
|
||||
gr_syspipe->gr_instance_id = 0U;
|
||||
gr_syspipe->gr_syspipe_id = 0U;
|
||||
}
|
||||
|
||||
@@ -168,6 +168,7 @@ static void nvgpu_init_gr_manager(struct gk20a *g)
|
||||
struct nvgpu_gr_syspipe *gr_syspipe = &gpu_instance->gr_syspipe;
|
||||
|
||||
g->mig.num_gpu_instances = 1;
|
||||
g->mig.num_gr_sys_pipes_enabled = 1;
|
||||
gr_syspipe->gr_instance_id = 0U;
|
||||
gr_syspipe->gr_syspipe_id = 0U;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user