mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
9207ceb10a0c661c31534f52279f20e9fc1720f8
Deferred dmabuf unmapping is being removed from kernel. So, add similar support to cache sgt in NvMap. During map_dma_buf() call, NvMap will create a mapping and an sgt corresponding to it. It will also cache this sgt. When unmap_dma_buf() is called for same sgt, NvMap will not unmap the mappings. It will simply return from there. Next time when the mapping request comes for same dmabuf, it will look for existing sgt in cache and return it. This significantly reduces mapping overhead for same buffer when it's mapped and unmapped multiple times. Free the sgt and unmap only when corresponding buffer is freed. When all references from a buffer are removed, dmabuf_release() will be called where sgt will be freed. Bug 4064339 Change-Id: I7ed767ecaaac7aa44e6576e701b28537b84986ec Signed-off-by: Ashish Mhetre <amhetre@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2925224 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Description
No description provided