diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2017-03-21 07:42:45 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-21 18:01:48 -0400 |
commit | fcd7fce9bc9ee744a518854995ba9679216e09c8 (patch) | |
tree | 4fa4264967ce32994d6789233f3d5624848ba34a /drivers/gpu/nvgpu/tegra/linux | |
parent | 8f3875393e7a6bd0fc03afdb1fa99b7e33b71576 (diff) |
gpu: nvgpu: use dma-attr wrappers for K4.9 compatibility
On kernel 4.9, the DMA API has changed, so use the NVIDIA compatibility
wrappers from dma-attrs.h to allow the code to build for both 4.4 and
4.9.
Bug 1853519
Change-Id: I0196936e81c7f72b41b38a67f42af0dc0b5518df
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1321102
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/tegra/linux')
-rw-r--r-- | drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c index d612fcd2..ceb1d67e 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <uapi/linux/nvgpu.h> | 22 | #include <uapi/linux/nvgpu.h> |
23 | #include <linux/dma-buf.h> | 23 | #include <linux/dma-buf.h> |
24 | #include <linux/dma-attrs.h> | ||
24 | #include <linux/nvmap.h> | 25 | #include <linux/nvmap.h> |
25 | #include <linux/reset.h> | 26 | #include <linux/reset.h> |
26 | #include <linux/tegra_soctherm.h> | 27 | #include <linux/tegra_soctherm.h> |
@@ -98,7 +99,7 @@ static void gk20a_tegra_secure_page_destroy(struct device *dev, | |||
98 | DEFINE_DMA_ATTRS(attrs); | 99 | DEFINE_DMA_ATTRS(attrs); |
99 | dma_free_attrs(&tegra_vpr_dev, secure_buffer->size, | 100 | dma_free_attrs(&tegra_vpr_dev, secure_buffer->size, |
100 | (void *)(uintptr_t)secure_buffer->iova, | 101 | (void *)(uintptr_t)secure_buffer->iova, |
101 | secure_buffer->iova, &attrs); | 102 | secure_buffer->iova, __DMA_ATTR(attrs)); |
102 | } | 103 | } |
103 | 104 | ||
104 | int gk20a_tegra_secure_page_alloc(struct device *dev) | 105 | int gk20a_tegra_secure_page_alloc(struct device *dev) |
@@ -113,7 +114,7 @@ int gk20a_tegra_secure_page_alloc(struct device *dev) | |||
113 | return -EINVAL; | 114 | return -EINVAL; |
114 | 115 | ||
115 | (void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova, | 116 | (void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova, |
116 | DMA_MEMORY_NOMAP, &attrs); | 117 | DMA_MEMORY_NOMAP, __DMA_ATTR(attrs)); |
117 | if (dma_mapping_error(&tegra_vpr_dev, iova)) | 118 | if (dma_mapping_error(&tegra_vpr_dev, iova)) |
118 | return -ENOMEM; | 119 | return -ENOMEM; |
119 | 120 | ||
@@ -133,7 +134,7 @@ static void gk20a_tegra_secure_destroy(struct gk20a *g, | |||
133 | phys_addr_t pa = sg_phys(desc->mem.sgt->sgl); | 134 | phys_addr_t pa = sg_phys(desc->mem.sgt->sgl); |
134 | dma_free_attrs(&tegra_vpr_dev, desc->mem.size, | 135 | dma_free_attrs(&tegra_vpr_dev, desc->mem.size, |
135 | (void *)(uintptr_t)pa, | 136 | (void *)(uintptr_t)pa, |
136 | pa, &attrs); | 137 | pa, __DMA_ATTR(attrs)); |
137 | gk20a_free_sgtable(&desc->mem.sgt); | 138 | gk20a_free_sgtable(&desc->mem.sgt); |
138 | desc->mem.sgt = NULL; | 139 | desc->mem.sgt = NULL; |
139 | } | 140 | } |
@@ -154,7 +155,7 @@ int gk20a_tegra_secure_alloc(struct device *dev, | |||
154 | return -EINVAL; | 155 | return -EINVAL; |
155 | 156 | ||
156 | (void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova, | 157 | (void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova, |
157 | DMA_MEMORY_NOMAP, &attrs); | 158 | DMA_MEMORY_NOMAP, __DMA_ATTR(attrs)); |
158 | if (dma_mapping_error(&tegra_vpr_dev, iova)) | 159 | if (dma_mapping_error(&tegra_vpr_dev, iova)) |
159 | return -ENOMEM; | 160 | return -ENOMEM; |
160 | 161 | ||
@@ -185,7 +186,7 @@ fail_sgt: | |||
185 | kfree(sgt); | 186 | kfree(sgt); |
186 | fail: | 187 | fail: |
187 | dma_free_attrs(&tegra_vpr_dev, desc->mem.size, | 188 | dma_free_attrs(&tegra_vpr_dev, desc->mem.size, |
188 | (void *)(uintptr_t)iova, iova, &attrs); | 189 | (void *)(uintptr_t)iova, iova, __DMA_ATTR(attrs)); |
189 | return err; | 190 | return err; |
190 | } | 191 | } |
191 | 192 | ||