video: tegra: nvmap: Don't perform repetitive ioremap

__ioremap function called during cache maint takes more time in case of
multiple processes compared to single process. This is impacting camera
tests when multiple cameras are used. For carveouts, nvmap performs page
by page ioremap and then cache maint on it. Optimize this with following
steps:
- During first cache_maint of the buffer, perform ioremap on entire
buffer and save the kernel V.A.
- Next time, when cache_maint is called on the same buffer, we will
reuse the saved kernel V.A.

Bug 3922175

Change-Id: Iecb372365409de1951bcc8e6f3d8e8e867bb2a80
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2948759
Reviewed-by: Barton Xu (SW-TEGRA) <bartonx@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Ketan Patil
2023-08-04 09:17:06 +00:00
committed by mobile promotions
parent e063d55fff
commit edf9d114e1

View File

@@ -194,6 +194,16 @@ static int do_cache_maint(struct cache_maint_op *cache_work)
goto out; goto out;
} }
if (!h->vaddr) {
if (__nvmap_mmap(h))
__nvmap_munmap(h, h->vaddr);
else
goto per_page_phy_cache_maint;
}
inner_cache_maint(op, h->vaddr + pstart, pend - pstart);
goto out;
per_page_phy_cache_maint:
pstart += h->carveout->base; pstart += h->carveout->base;
pend += h->carveout->base; pend += h->carveout->base;