From 00a801a0f2523ec5c8a0e7229d9d51b933bc4431 Mon Sep 17 00:00:00 2001 From: Pritesh Raithatha Date: Tue, 12 Jun 2018 12:24:46 +0530 Subject: gpu: nvgpu: kernel version check for dma_buf_ops In K4.14, dma_buf_ops members are renamed from kmap_atomic to map_atomic and kmap to map. So put the kernel version check to fix the build error for k4.14. Bug 200414723 Bug 200421495 Change-Id: Ic959960a43d2247f9cd4b530f9172a152bcbc08b Signed-off-by: Pritesh Raithatha Reviewed-on: https://git-master.nvidia.com/r/1747013 Reviewed-by: svc-mobile-coverity Reviewed-by: Debarshi Dutta GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/vidmem.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/os/linux/vidmem.c') diff --git a/drivers/gpu/nvgpu/os/linux/vidmem.c b/drivers/gpu/nvgpu/os/linux/vidmem.c index 136d4a10..df1a905d 100644 --- a/drivers/gpu/nvgpu/os/linux/vidmem.c +++ b/drivers/gpu/nvgpu/os/linux/vidmem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -15,6 +15,7 @@ */ #include +#include #include #ifdef CONFIG_NVGPU_USE_TEGRA_ALLOC_FD @@ -134,8 +135,13 @@ static const struct dma_buf_ops gk20a_vidbuf_ops = { .map_dma_buf = gk20a_vidbuf_map_dma_buf, .unmap_dma_buf = gk20a_vidbuf_unmap_dma_buf, .release = gk20a_vidbuf_release, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) + .map_atomic = gk20a_vidbuf_kmap_atomic, + .map = gk20a_vidbuf_kmap, +#else .kmap_atomic = gk20a_vidbuf_kmap_atomic, .kmap = gk20a_vidbuf_kmap, +#endif .mmap = gk20a_vidbuf_mmap, .set_drvdata = gk20a_vidbuf_set_private, .get_drvdata = gk20a_vidbuf_get_private, -- cgit v1.2.2