mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Fix build for Linux v5.18
Upstream commit 7938f4218168 ("dma-buf-map: Rename to iosys-map")
renames 'struct dma_buf_map' to 'struct iosys_map' and breaks building
the NVGPU driver with Linux v5.18-rc1. In the NVGPU driver there are
many places where 'dma_buf_map' is used and so to clean-up the code and
minimise the impact of this change, add a gk20a_dmabuf_vmap() and a
gk20a_dmabuf_vunmap() helper function. These new functions support all
kernel versions and eliminate a lot the KERNEL_VERSION ifdefs.
Bug 3598986
Change-Id: Id0f904ec0662f20f3d699b74efd9542d12344228
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2693970
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
19a8adeae1
commit
86c0a696ed
@@ -661,9 +661,6 @@ static void trace_write_pushbuffer(struct nvgpu_channel *c,
|
||||
unsigned int words;
|
||||
u64 offset;
|
||||
struct dma_buf *dmabuf = NULL;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||
struct dma_buf_map map;
|
||||
#endif
|
||||
|
||||
if (gk20a_debug_trace_cmdbuf) {
|
||||
u64 gpu_va = (u64)g->entry0 |
|
||||
@@ -672,14 +669,8 @@ static void trace_write_pushbuffer(struct nvgpu_channel *c,
|
||||
|
||||
words = pbdma_gp_entry1_length_v(g->entry1);
|
||||
err = nvgpu_vm_find_buf(c->vm, gpu_va, &dmabuf, &offset);
|
||||
if (!err) {
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||
err = dma_buf_vmap(dmabuf, &map);
|
||||
mem = err ? NULL : map.vaddr;
|
||||
#else
|
||||
mem = dma_buf_vmap(dmabuf);
|
||||
#endif
|
||||
}
|
||||
if (!err)
|
||||
mem = gk20a_dmabuf_vmap(dmabuf);
|
||||
}
|
||||
|
||||
if (mem) {
|
||||
@@ -698,11 +689,7 @@ static void trace_write_pushbuffer(struct nvgpu_channel *c,
|
||||
mem);
|
||||
}
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||
dma_buf_vunmap(dmabuf, &map);
|
||||
#else
|
||||
dma_buf_vunmap(dmabuf, mem);
|
||||
#endif
|
||||
gk20a_dmabuf_vunmap(dmabuf, mem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user