From 4ed84db8a5766e3d1a081333b0e30269026ebecd Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Fri, 6 Jan 2023 16:21:10 -0800 Subject: [PATCH] gpu: nvgpu: vgpu: add vgpu-next support for hal init vgpu-next is enabled only for internal build. Jira GVSCI-15646 Change-Id: I5a829a91da2ca0f4f4d445f5337be8983baab36d Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2840221 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Austin Tajiri Reviewed-by: Rajesh Devaraj Reviewed-by: Aparna Das GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c b/drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c index cdf84e35b..f13b2f676 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -32,11 +32,22 @@ #include "vgpu_hal_ga10b.h" #endif +#if defined(CONFIG_NVGPU_NON_FUSA) && defined(CONFIG_NVGPU_NEXT) +#include +#endif + int vgpu_init_hal(struct gk20a *g) { u32 ver = g->params.gpu_arch + g->params.gpu_impl; int err; +#if defined(CONFIG_NVGPU_HAL_NON_FUSA) && defined(CONFIG_NVGPU_NEXT) + err = vgpu_next_init_hal(g); + if (err != -ENODEV) { + return err; + } +#endif + switch (ver) { #ifdef CONFIG_NVGPU_HAL_NON_FUSA case NVGPU_GPUID_GV11B: