diff --git a/drivers/gpu/nvgpu/hal/init/hal_init.c b/drivers/gpu/nvgpu/hal/init/hal_init.c index c73811bc5..984938375 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_init.c +++ b/drivers/gpu/nvgpu/hal/init/hal_init.c @@ -1,7 +1,7 @@ /* * NVIDIA GPU HAL interface. * - * Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2020, 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"), @@ -36,6 +36,10 @@ #include "hal_tu104.h" #endif +#if defined(CONFIG_NVGPU_HAL_NON_FUSA) && defined(CONFIG_NVGPU_NEXT) +#include "nvgpu_next_gpuid.h" +#endif + #include "hal/mc/mc_gm20b.h" int nvgpu_init_hal(struct gk20a *g) @@ -62,6 +66,13 @@ int nvgpu_init_hal(struct gk20a *g) return -ENODEV; } break; +#if defined(CONFIG_NVGPU_NEXT) + case NVGPU_NEXT_GPUID: + if (NVGPU_NEXT_INIT_HAL(g) != 0) { + return -ENODEV; + } + break; +#endif #endif case NVGPU_GPUID_GV11B: diff --git a/userspace/Makefile b/userspace/Makefile index 36c10c503..dfc297a4a 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2018-2020, 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"), @@ -38,6 +38,8 @@ CORE_OUT=$(OUT)/nvgpu_unit_core # Nvgpu driver code. NVGPU_SRC=$(TWD)/../drivers/gpu/nvgpu +# Nvgpu-next driver code. +NVGPU_NEXT_SRC=$(TWD)/../../nvgpu-next/drivers/gpu/nvgpu NVGPU_OUT=$(OUT)/libnvgpu # Unit tests themselves. @@ -47,6 +49,8 @@ UNIT_OUT=$(OUT)/units INCLUDES= \ -I$(NVGPU_SRC) \ -I$(NVGPU_SRC)/include \ + -I$(NVGPU_NEXT_SRC) \ + -I$(NVGPU_NEXT_SRC)/include \ -I$(TWD)/../include \ -I$(TWD)/../include/uapi \ -I$(TWD)/include \ @@ -133,6 +137,14 @@ $(NVGPU_OUT)/%.o : $(NVGPU_SRC)/%.c $(HEADERS) fi $(CC) --coverage $(CFLAGS) -c -o $@ $< +# Default build target for all the nvgpu-next driver object files we want to +# build in userspace. These too get bundled into libnvgpu-drv.so. +$(NVGPU_OUT)/%.o : $(NVGPU_NEXT_SRC)/%.c $(HEADERS) $(HEADERS_NEXT) + @if [ ! -d $(dir $@) ] ; then \ + mkdir -p $(dir $@) ; \ + fi + $(CC) --coverage $(CFLAGS) $(configs) -c -o $@ $< + # Build target for unit test files. These are not part of the libnvgpu-drv.so. # These comprise the unit test framework. $(CORE_OUT)/%.o : $(CORE_SRC)/%.c $(CORE_HEADERS) diff --git a/userspace/Makefile.sources b/userspace/Makefile.sources index 6a6c24764..d09495d35 100644 --- a/userspace/Makefile.sources +++ b/userspace/Makefile.sources @@ -21,8 +21,9 @@ # DEALINGS IN THE SOFTWARE. include $(NVGPU_SRC)/Makefile.sources +include $(NVGPU_NEXT_SRC)/Makefile.sources -OBJS := $(srcs:%.c=$(NVGPU_OUT)/%.o) +OBJS := $(srcs:%.c=$(NVGPU_OUT)/%.o) $(srcs_next:%.c=$(NVGPU_OUT)/%.o) HEADERS := \ $(NVGPU_SRC)/include/nvgpu/*.h \