mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: remove __flush_dcache_area
In preparation for making nvgpu more aligned to upstream kernel, the dependency on the downstream exported _flush_dcache_area is removed. Nvgpu instead uses dma_buf_begin_cpu_access/dma_buf_end_cpu_access to correctly flush the dirty writes and ensure coherency for combits_scatter_buffer. For kernel versions below 4.19, nvgpu calls the modified APIs provided by Nvmap. Going forward Nvmap will be maintaining compatibility with the existing APIs. Change-Id: I5f4e01e45e61000693182392eadf05f197517a81 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2358937 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Alex Waterman
parent
7b8a08af7a
commit
8bc36f5383
@@ -1149,9 +1149,28 @@ __releases(&l->cde_app->mutex)
|
||||
err = -EINVAL;
|
||||
goto exit_unmap_surface;
|
||||
} else {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
err = dma_buf_begin_cpu_access(compbits_scatter_buf, scatterbuffer_byte_offset,
|
||||
scatterbuffer_size, DMA_BIDIRECTIONAL);
|
||||
#else
|
||||
err = dma_buf_begin_cpu_access(compbits_scatter_buf, DMA_BIDIRECTIONAL);
|
||||
#endif
|
||||
if (err != 0) {
|
||||
nvgpu_warn(g, "buffer access setup failed");
|
||||
nvgpu_mm_unpin_privdata(dev_from_gk20a(g), compbits_scatter_buf,
|
||||
attachment, sgt);
|
||||
goto exit_unmap_surface;
|
||||
}
|
||||
err = l->ops.cde.populate_scatter_buffer(g, sgt,
|
||||
compbits_byte_offset, scatter_buffer,
|
||||
scatterbuffer_size);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
dma_buf_end_cpu_access(compbits_scatter_buf, scatterbuffer_byte_offset,
|
||||
scatterbuffer_size, DMA_BIDIRECTIONAL);
|
||||
#else
|
||||
dma_buf_end_cpu_access(compbits_scatter_buf, DMA_BIDIRECTIONAL);
|
||||
#endif
|
||||
WARN_ON(err);
|
||||
|
||||
nvgpu_mm_unpin_privdata(dev_from_gk20a(g), compbits_scatter_buf,
|
||||
@@ -1160,7 +1179,6 @@ __releases(&l->cde_app->mutex)
|
||||
goto exit_unmap_surface;
|
||||
}
|
||||
|
||||
__cpuc_flush_dcache_area(scatter_buffer, scatterbuffer_size);
|
||||
dma_buf_vunmap(compbits_scatter_buf, surface);
|
||||
surface = NULL;
|
||||
}
|
||||
@@ -1250,8 +1268,9 @@ __releases(&l->cde_app->mutex)
|
||||
return err;
|
||||
|
||||
exit_unmap_surface:
|
||||
if (surface)
|
||||
if (surface) {
|
||||
dma_buf_vunmap(compbits_scatter_buf, surface);
|
||||
}
|
||||
exit_unmap_vaddr:
|
||||
nvgpu_vm_unmap(cde_ctx->vm, map_vaddr, NULL);
|
||||
exit_idle:
|
||||
|
||||
Reference in New Issue
Block a user