From ba69628aafefcf4567f2f3b1459ccc4ebd8e203f Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 29 Nov 2017 15:32:59 -0800 Subject: gpu: nvgpu: Use device_is_iommuable() only for iGPU device_is_iommuable() is defined only in Tegra kernel. There is no explicit config option to check for its existance, so skip building that code when Tegra iGPU is not supported. Change-Id: I50dc47070fa416181d458beabf5a2f2373931331 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1612649 GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/dma.c | 4 ++++ drivers/gpu/nvgpu/common/linux/nvgpu_mem.c | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/common/linux/dma.c b/drivers/gpu/nvgpu/common/linux/dma.c index d0b6c8a8..786065dd 100644 --- a/drivers/gpu/nvgpu/common/linux/dma.c +++ b/drivers/gpu/nvgpu/common/linux/dma.c @@ -634,7 +634,11 @@ void nvgpu_free_sgtable(struct gk20a *g, struct sg_table **sgt) bool nvgpu_iommuable(struct gk20a *g) { +#ifdef CONFIG_TEGRA_GK20A struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); return device_is_iommuable(l->dev); +#else + return true; +#endif } diff --git a/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c b/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c index eb64ecd3..79098eca 100644 --- a/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c +++ b/drivers/gpu/nvgpu/common/linux/nvgpu_mem.c @@ -313,9 +313,7 @@ void nvgpu_memset(struct gk20a *g, struct nvgpu_mem *mem, u32 offset, */ u64 nvgpu_mem_get_addr_sgl(struct gk20a *g, struct scatterlist *sgl) { - struct nvgpu_os_linux *l = container_of(g, struct nvgpu_os_linux, g); - - if (!device_is_iommuable(l->dev)) + if (!nvgpu_iommuable(g)) return g->ops.mm.gpu_phys_addr(g, NULL, sg_phys(sgl)); if (sg_dma_address(sgl) == 0) -- cgit v1.2.2