From a372ec9a3813b56bc0fb308f44af38bef47a9b5f Mon Sep 17 00:00:00 2001 From: Shashank Singh Date: Mon, 20 Dec 2021 05:34:31 +0000 Subject: [PATCH] gpu: nvgpu: disable golden context image verification - Disable golden context image verification until ctxsw fw for orin safety is ready for this feature. - Make NULL check for hal set_default_compute_regs else it causes crash for orin safety. Bug 3456240 Change-Id: I1f6ca9d78f22cc6776bb0b3a9e05f22171095c7f Signed-off-by: Shashank Singh Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2645666 (cherry picked from commit 3907d1b315e1247243632fefdcbce69d58090681) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2644533 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/Makefile.shared.configs | 1 - drivers/gpu/nvgpu/common/gr/obj_ctx.c | 4 +++- libs/dgpu/libnvgpu-drv-dgpu_safe.export | 1 - libs/igpu/libnvgpu-drv-igpu_safe.export | 1 - userspace/units/gr/setup/nvgpu-gr-setup.c | 3 ++- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index eba8d8770..a31f0d864 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -76,7 +76,6 @@ ifeq ($(profile),$(filter $(profile),safety_debug safety_release)) # Enable golden context verification only for safety debug/release build NVGPU_COMMON_CFLAGS += \ - -DCONFIG_NVGPU_GR_GOLDEN_CTX_VERIFICATION \ -DCONFIG_NVGPU_BUILD_CONFIGURATION_IS_SAFETY ## For tesing of CTXSW FW error codes manually, enable below configs in safety build. diff --git a/drivers/gpu/nvgpu/common/gr/obj_ctx.c b/drivers/gpu/nvgpu/common/gr/obj_ctx.c index 69c1d206a..5e5d1ad6c 100644 --- a/drivers/gpu/nvgpu/common/gr/obj_ctx.c +++ b/drivers/gpu/nvgpu/common/gr/obj_ctx.c @@ -881,7 +881,9 @@ int nvgpu_gr_obj_ctx_alloc(struct gk20a *g, subctx); #ifndef CONFIG_NVGPU_NON_FUSA - g->ops.gr.init.set_default_compute_regs(g, gr_ctx); + if (g->ops.gr.init.set_default_compute_regs != NULL) { + g->ops.gr.init.set_default_compute_regs(g, gr_ctx); + } #endif nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gr, "done"); diff --git a/libs/dgpu/libnvgpu-drv-dgpu_safe.export b/libs/dgpu/libnvgpu-drv-dgpu_safe.export index b35413ebf..77bd916f5 100644 --- a/libs/dgpu/libnvgpu-drv-dgpu_safe.export +++ b/libs/dgpu/libnvgpu-drv-dgpu_safe.export @@ -477,7 +477,6 @@ nvgpu_gr_global_ctx_buffer_get_mem nvgpu_gr_global_ctx_buffer_map nvgpu_gr_global_ctx_buffer_ready nvgpu_gr_global_ctx_buffer_unmap -nvgpu_gr_global_ctx_compare_golden_images nvgpu_gr_global_ctx_deinit_local_golden_image nvgpu_gr_global_ctx_desc_alloc nvgpu_gr_global_ctx_desc_free diff --git a/libs/igpu/libnvgpu-drv-igpu_safe.export b/libs/igpu/libnvgpu-drv-igpu_safe.export index 238e0a79e..3343927e5 100644 --- a/libs/igpu/libnvgpu-drv-igpu_safe.export +++ b/libs/igpu/libnvgpu-drv-igpu_safe.export @@ -493,7 +493,6 @@ nvgpu_gr_global_ctx_buffer_get_mem nvgpu_gr_global_ctx_buffer_map nvgpu_gr_global_ctx_buffer_ready nvgpu_gr_global_ctx_buffer_unmap -nvgpu_gr_global_ctx_compare_golden_images nvgpu_gr_global_ctx_deinit_local_golden_image nvgpu_gr_global_ctx_desc_alloc nvgpu_gr_global_ctx_desc_free diff --git a/userspace/units/gr/setup/nvgpu-gr-setup.c b/userspace/units/gr/setup/nvgpu-gr-setup.c index 2936892bf..9b860f35c 100644 --- a/userspace/units/gr/setup/nvgpu-gr-setup.c +++ b/userspace/units/gr/setup/nvgpu-gr-setup.c @@ -725,12 +725,13 @@ int test_gr_setup_alloc_obj_ctx(struct unit_module *m, if (err != 0) { unit_return_fail(m, "local golden image alloc failed\n"); } +#if 0 err = nvgpu_gr_global_ctx_alloc_local_golden_image(g, &g->gr->golden_image->local_golden_image_copy, 0x800); if (err != 0) { unit_return_fail(m, "local golden image copy alloc failed\n"); } - +#endif /* Test with channel and tsg */ err = gr_test_setup_allocate_ch_tsg(m, g); if (err != 0) {