diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index e21653359..7b9b2a23b 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -53,6 +53,7 @@ ccflags-y += -DCONFIG_NVGPU_COMMON_NON_FUSA ccflags-y += -DCONFIG_NVGPU_INJECT_HWERR ccflags-y += -DCONFIG_NVGPU_GR_FALCON_NON_SECURE_BOOT ccflags-y += -DCONFIG_NVGPU_SW_SEMAPHORE +ccflags-y += -DCONFIG_NVGPU_FENCE ifeq ($(CONFIG_NVGPU_LOGGING),y) ccflags-y += -DCONFIG_NVGPU_LOGGING=1 diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index 5894bf097..c6b503693 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -79,6 +79,7 @@ NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_KERNEL_MODE_SUBMIT # Enable fences for safety build till until we switch to user mode submits only CONFIG_NVGPU_FENCE := 1 +NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_FENCE # Enable Channel/TSG Scheduling for safety build until devctl whitelisting is done CONFIG_NVGPU_CHANNEL_TSG_SCHEDULING := 1 diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index cc9a27df5..baf5d35f4 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -89,7 +89,6 @@ srcs += common/utils/assert.c \ common/mm/allocators/nvgpu_allocator.c \ common/mm/allocators/bitmap_allocator.c \ common/mm/allocators/buddy_allocator.c \ - common/mm/allocators/lockless_allocator.c \ common/mm/gmmu/page_table.c \ common/mm/gmmu/pd_cache.c \ common/mm/as.c \ @@ -397,7 +396,8 @@ endif endif ifeq ($(CONFIG_NVGPU_FENCE),1) -srcs += common/fence/fence.c +srcs += common/fence/fence.c \ + common/mm/allocators/lockless_allocator.c endif ifeq ($(CONFIG_NVGPU_FECS_TRACE),1) diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index 99998e215..937a28cd8 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h @@ -259,6 +259,7 @@ int nvgpu_allocator_init(struct gk20a *g, struct nvgpu_allocator *na, u64 base, u64 length, u64 blk_size, u64 max_order, u64 flags, enum nvgpu_allocator_type alloc_type); +#ifdef CONFIG_NVGPU_FENCE /* * Lockless allocatior initializers. * Note: This allocator can only allocate fixed-size structures of a @@ -267,6 +268,7 @@ int nvgpu_allocator_init(struct gk20a *g, struct nvgpu_allocator *na, int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *na, const char *name, u64 base, u64 length, u64 blk_size, u64 flags); +#endif #define GPU_BALLOC_MAX_ORDER 63U