diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2018-06-12 02:54:46 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-06-21 07:52:32 -0400 |
commit | 00a801a0f2523ec5c8a0e7229d9d51b933bc4431 (patch) | |
tree | cd685151ba1cbed7541afd7528658bfd9d874972 /drivers/gpu/nvgpu | |
parent | 0258721eb1e4b6be4217b1e7090a9f4073c7805a (diff) |
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 <praithatha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1747013
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/vidmem.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/dma-buf.h> | 17 | #include <linux/dma-buf.h> |
18 | #include <linux/version.h> | ||
18 | #include <uapi/linux/nvgpu.h> | 19 | #include <uapi/linux/nvgpu.h> |
19 | 20 | ||
20 | #ifdef CONFIG_NVGPU_USE_TEGRA_ALLOC_FD | 21 | #ifdef CONFIG_NVGPU_USE_TEGRA_ALLOC_FD |
@@ -134,8 +135,13 @@ static const struct dma_buf_ops gk20a_vidbuf_ops = { | |||
134 | .map_dma_buf = gk20a_vidbuf_map_dma_buf, | 135 | .map_dma_buf = gk20a_vidbuf_map_dma_buf, |
135 | .unmap_dma_buf = gk20a_vidbuf_unmap_dma_buf, | 136 | .unmap_dma_buf = gk20a_vidbuf_unmap_dma_buf, |
136 | .release = gk20a_vidbuf_release, | 137 | .release = gk20a_vidbuf_release, |
138 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) | ||
139 | .map_atomic = gk20a_vidbuf_kmap_atomic, | ||
140 | .map = gk20a_vidbuf_kmap, | ||
141 | #else | ||
137 | .kmap_atomic = gk20a_vidbuf_kmap_atomic, | 142 | .kmap_atomic = gk20a_vidbuf_kmap_atomic, |
138 | .kmap = gk20a_vidbuf_kmap, | 143 | .kmap = gk20a_vidbuf_kmap, |
144 | #endif | ||
139 | .mmap = gk20a_vidbuf_mmap, | 145 | .mmap = gk20a_vidbuf_mmap, |
140 | .set_drvdata = gk20a_vidbuf_set_private, | 146 | .set_drvdata = gk20a_vidbuf_set_private, |
141 | .get_drvdata = gk20a_vidbuf_get_private, | 147 | .get_drvdata = gk20a_vidbuf_get_private, |