From 84bb919909fa80bfd9801795f7fcfb3330c4c384 Mon Sep 17 00:00:00 2001 From: Martin Radev Date: Thu, 20 Apr 2023 22:52:32 +0300 Subject: [PATCH] gpu: nvgpu: Setup GFX-capable TPCs This patch dispatches to the appropriate HAL to select the GFX-capable TPCs. Bug 3944931 Change-Id: Ifb7338bea2cd59581133b7a2ba723f5d8bfa507c Signed-off-by: Martin Radev Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2891725 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/common/gr/gr.c | 7 +++++++ drivers/gpu/nvgpu/include/nvgpu/gops/gr.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/nvgpu/common/gr/gr.c b/drivers/gpu/nvgpu/common/gr/gr.c index 5d7cf3bf2..2b04a0868 100644 --- a/drivers/gpu/nvgpu/common/gr/gr.c +++ b/drivers/gpu/nvgpu/common/gr/gr.c @@ -680,6 +680,13 @@ static int gr_reset_hw_and_load_prod(struct gk20a *g) return err; } +#ifdef CONFIG_NVGPU_GRAPHICS + if (g->ops.gr.init.setup_gfx_tpcs != NULL) { + nvgpu_gr_exec_for_all_instances(g, + g->ops.gr.init.setup_gfx_tpcs(g)); + } +#endif + nvgpu_gr_exec_for_all_instances(g, nvgpu_cg_init_gr_load_gating_prod(g)); /* Disable elcg until it gets enabled later in the init*/ diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops/gr.h b/drivers/gpu/nvgpu/include/nvgpu/gops/gr.h index 0e8f6c178..56bd2a885 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gops/gr.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gops/gr.h @@ -941,6 +941,9 @@ struct gops_gr_init { void (*auto_go_idle)(struct gk20a *g, bool enable); void (*eng_config)(struct gk20a *g); int (*reset_gpcs)(struct gk20a *g); +#ifdef CONFIG_NVGPU_GRAPHICS + void (*setup_gfx_tpcs)(struct gk20a *g); +#endif int (*sm_id_config_early)(struct gk20a *g, struct nvgpu_gr_config *config); int (*load_sm_id_config)(struct gk20a *g,