From 58ef68e1625c975e1d64dd6c6a3e6cdf664f976d Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Mon, 20 Jul 2020 16:44:05 +0530 Subject: [PATCH] gpu: nvgpu: add gr manager gops for nvgpu-next-1 1) Included gr manager gops for nvgpu-next chip 2) Added conf flag to enable/disable MIG JIRA NVGPU-5646 Change-Id: I37d3b64fb8a49f97d37c89374241d0fc9c75891e Signed-off-by: Lakshmanan M Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2382270 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/Makefile.shared.configs | 4 ++++ drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 9 +++++++++ drivers/gpu/nvgpu/include/nvgpu/gops_priv_ring.h | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index 9f3829b07..222f939bc 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -291,6 +291,10 @@ NVGPU_COMMON_CFLAGS += -DCONFIG_TEGRA_GR_VIRTUALIZATION_SERVER CONFIG_NVGPU_SM_DIVERSITY := 1 NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_SM_DIVERSITY +# Enable Multi Instance GPU support for normal build +CONFIG_NVGPU_MIG := 1 +NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_MIG + endif endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 48849d84f..30bae37f5 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -173,6 +173,10 @@ enum nvgpu_profiler_pm_reservation_scope; #include "hal/clk/clk_gk20a.h" +#if defined(CONFIG_NVGPU_NEXT) && defined(CONFIG_NVGPU_MIG) +#include "include/nvgpu/nvgpu_next_gops_grmgr.h" +#endif + #ifdef CONFIG_DEBUG_FS struct railgate_stats { unsigned long last_rail_gate_start; @@ -636,6 +640,11 @@ struct gpu_ops { } tpc; #endif void (*semaphore_wakeup)(struct gk20a *g, bool post_events); + +#if defined(CONFIG_NVGPU_NEXT) && defined(CONFIG_NVGPU_MIG) + struct gops_grmgr grmgr; +#endif + }; /** diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops_priv_ring.h b/drivers/gpu/nvgpu/include/nvgpu/gops_priv_ring.h index d60285300..a8cbb88ef 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gops_priv_ring.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gops_priv_ring.h @@ -143,6 +143,10 @@ struct gops_priv_ring { void (*decode_error_code)(struct gk20a *g, u32 error_code); /** @endcond DOXYGEN_SHOULD_SKIP_THIS */ +#if defined(CONFIG_NVGPU_NEXT) +#include "include/nvgpu/nvgpu_next_gops_priv_ring.h" +#endif + }; #endif /* NVGPU_GOPS_PRIV_RING_H */