mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: compile out vidmem from safety build
Safety build does not support vidmem. This patch compiles out vidmem related changes - vidmem, dma alloc, cbc/acr/pmu alloc based on vidmem and corresponding tests like pramin, page allocator & gmmu_map_unmap_vidmem.. As vidmem is applicable only in case of DGPUs the code is compiled out using CONFIG_NVGPU_DGPU. JIRA NVGPU-3524 Change-Id: Ic623801112484ffc071195e828ab9f290f945d4d Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2132773 GVS: Gerrit_Virtual_Submit Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
c2eb26436a
commit
a16cc2dde3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2018-2019, 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"),
|
||||
@@ -35,6 +35,7 @@ int nvgpu_dma_alloc(struct gk20a *g, size_t size, struct nvgpu_mem *mem)
|
||||
int nvgpu_dma_alloc_flags(struct gk20a *g, unsigned long flags, size_t size,
|
||||
struct nvgpu_mem *mem)
|
||||
{
|
||||
#ifdef CONFIG_NVGPU_DGPU
|
||||
if (!nvgpu_is_enabled(g, NVGPU_MM_UNIFIED_MEMORY)) {
|
||||
/*
|
||||
* Force the no-kernel-mapping flag on because we don't support
|
||||
@@ -59,6 +60,7 @@ int nvgpu_dma_alloc_flags(struct gk20a *g, unsigned long flags, size_t size,
|
||||
* vidmem is exhausted.
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
|
||||
return nvgpu_dma_alloc_flags_sys(g, flags, size, mem);
|
||||
}
|
||||
@@ -68,6 +70,7 @@ int nvgpu_dma_alloc_sys(struct gk20a *g, size_t size, struct nvgpu_mem *mem)
|
||||
return nvgpu_dma_alloc_flags_sys(g, 0, size, mem);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NVGPU_DGPU
|
||||
int nvgpu_dma_alloc_vid(struct gk20a *g, size_t size, struct nvgpu_mem *mem)
|
||||
{
|
||||
return nvgpu_dma_alloc_flags_vid(g,
|
||||
@@ -86,6 +89,7 @@ int nvgpu_dma_alloc_vid_at(struct gk20a *g,
|
||||
return nvgpu_dma_alloc_flags_vid_at(g,
|
||||
NVGPU_DMA_NO_KERNEL_MAPPING, size, mem, at);
|
||||
}
|
||||
#endif
|
||||
|
||||
int nvgpu_dma_alloc_map(struct vm_gk20a *vm, size_t size,
|
||||
struct nvgpu_mem *mem)
|
||||
@@ -96,6 +100,7 @@ int nvgpu_dma_alloc_map(struct vm_gk20a *vm, size_t size,
|
||||
int nvgpu_dma_alloc_map_flags(struct vm_gk20a *vm, unsigned long flags,
|
||||
size_t size, struct nvgpu_mem *mem)
|
||||
{
|
||||
#ifdef CONFIG_NVGPU_DGPU
|
||||
if (!nvgpu_is_enabled(gk20a_from_vm(vm), NVGPU_MM_UNIFIED_MEMORY)) {
|
||||
/*
|
||||
* Force the no-kernel-mapping flag on because we don't support
|
||||
@@ -116,6 +121,7 @@ int nvgpu_dma_alloc_map_flags(struct vm_gk20a *vm, unsigned long flags,
|
||||
* vidmem is exhausted.
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
|
||||
return nvgpu_dma_alloc_map_flags_sys(vm, flags, size, mem);
|
||||
}
|
||||
@@ -150,6 +156,7 @@ fail_free:
|
||||
return err;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NVGPU_DGPU
|
||||
int nvgpu_dma_alloc_map_vid(struct vm_gk20a *vm, size_t size,
|
||||
struct nvgpu_mem *mem)
|
||||
{
|
||||
@@ -180,6 +187,7 @@ fail_free:
|
||||
nvgpu_dma_free(vm->mm->g, mem);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
void nvgpu_dma_free(struct gk20a *g, struct nvgpu_mem *mem)
|
||||
{
|
||||
@@ -187,9 +195,11 @@ void nvgpu_dma_free(struct gk20a *g, struct nvgpu_mem *mem)
|
||||
case APERTURE_SYSMEM:
|
||||
nvgpu_dma_free_sys(g, mem);
|
||||
break;
|
||||
#ifdef CONFIG_NVGPU_DGPU
|
||||
case APERTURE_VIDMEM:
|
||||
nvgpu_dma_free_vid(g, mem);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
/* like free() on "null" memory */
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user