diff options
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux')
-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, |