From fa2a3e2d3dd780d409e7673e7b47a34fd1cafb4f Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 29 Nov 2017 15:34:19 -0800 Subject: gpu: nvgpu: Define create_from_phys when nvhost enabled Define __nvgpu_mem_create_from_phys only in systems with nvhost enabled. The calling code is also built only when nvhost is enabled. phys_to_page() also exists only in arm64, so using it in non-arm64 platform causes a build failure. Change-Id: Iee023b55bba863d46079796e1c49c19456c1d229 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1607581 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/nvgpu_mem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c b/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c index 2b3cb6fd..eb64ecd3 100644 --- a/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c +++ b/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c @@ -478,6 +478,7 @@ int __nvgpu_mem_create_from_pages(struct gk20a *g, struct nvgpu_mem *dest, return 0; } +#ifdef CONFIG_TEGRA_GK20A_NVHOST int __nvgpu_mem_create_from_phys(struct gk20a *g, struct nvgpu_mem *dest, u64 src_phys, int nr_pages) { @@ -496,6 +497,7 @@ int __nvgpu_mem_create_from_phys(struct gk20a *g, struct nvgpu_mem *dest, return ret; } +#endif static void *nvgpu_mem_linux_sgl_next(void *sgl) { -- cgit v1.2.2