Ketan Patil
1f703af3e0
video: tegra: nvmap: Avoid double updation of RSS counter
...
The RSS counter is updated during buffer allocation as well as mmap,
which is leading to double updation. Fix this by decrementing the RSS
counter during page fault while increment it back during unmap flow.
Bug 5222690
Change-Id: I77972185f20d9d710571cc07ae1c5188060bfa1f
Signed-off-by: Ketan Patil <ketanp@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3442670
(cherry picked from commit 1c59063ce7 )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3453103
(cherry picked from commit b27a1a79ee )
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3454644
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com >
Tested-by: Amulya Yarlagadda <ayarlagadda@nvidia.com >
Reviewed-by: Amulya Yarlagadda <ayarlagadda@nvidia.com >
2025-09-23 10:55:17 -07:00
Laxman Dewangan
e8b7a5ca26
nvmap: Use SPDX license GPL 2.0 format
...
Use SPDX license GPL-V2.0 format and change Nvidia
copyright year to include 2023.
Bug 4078035
Change-Id: I4db6577ddb806690f6ec04f5eaf1364578102d14
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890635
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com >
Reviewed-by: Ketan Patil <ketanp@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-22 09:59:20 -07:00
Ketan Patil
6937db210f
video: tegra: nvmap: Add CBC carveout support
...
- Add CBC carveout suport in nvmap.
- Chunk size for CBC is 2MB, hence each bit from bitmap for CBC carveout
indicate 2MB physically contiguous chunk.
- In case of allocation from CBC, first try to allocate the entire chunk
in physically contiguous manner, if it's not possible then allocate in
chunks of 2MB. All page pointers to these chunks will be stored in
nvmap_handle struct.
- Modify all other operations like vmap, kmap, mmap as per the above
restrictions.
Bug 3956637
Change-Id: I7c304b0127c8fef028e135a4662ab3ad3dc1d1f6
Signed-off-by: Ketan Patil <ketanp@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2880662
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com >
Reviewed-by: Sachin Nikam <snikam@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2885806
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
Tested-by: Laxman Dewangan <ldewangan@nvidia.com >
2023-04-12 04:32:35 -07:00
Ketan Patil
85f7def3a6
nvmap: Don't free pages while freeing subhandle
...
This patch fixes the following issues:
- When the handle associated with the sub-buffer is freed, the call to
the nvmap_page_pool_fill_lots is made, which would free the pages when
the refcount on the pages is > 1, even though the main handle is not
freed, hence add a check for sub-handle.
- In cpu unmap code, list_for_each_entry is used for iterating over the
vma list and in the same loop list_del is aldo being called, this can
lead to undefined behavior, instead use list_for_each_entry_safe which
is safe against removal of list entry.
- Mutex of sub-handle is not initialized, fix it by initializing it.
- Set error value when handle creation failed.
Bug 3494980
Change-Id: I0659d7f70b44814e87e3081702352e891d9191f7
Signed-off-by: Ketan Patil <ketanp@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2824668
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com >
Reviewed-by: Puneet Saxena <puneets@nvidia.com >
Reviewed-by: Sachin Nikam <snikam@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-11 05:54:22 +00:00
Ketan Patil
abb244025f
nvmap: Fix coherency issues while creating subhandle
...
Make sure that all handles, from which sub-buffer handle needs to be
created, have same cache coherency, are of type RW, not created from VA.
Set the cache coherency of the sub-buffer handle same as the cache
coherency of the main handles, so that explicit cache flush is not
needed during vma fault.
Bug 3494980
Change-Id: I878568e4cdc4529fb3d1a6682e38798769dad9c0
Signed-off-by: Ketan Patil <ketanp@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2819129
Reviewed-by: Puneet Saxena <puneets@nvidia.com >
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com >
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com >
Reviewed-by: Sachin Nikam <snikam@nvidia.com >
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com >
2023-04-11 05:54:22 +00:00
Puneet Saxena
c4a88d6515
tegra: nvmap: dmabuf fd for range from list of handles
...
It returns dmabuf fd from list of nvmap handles
for a range between offset and size.
The range should fall under total size of all of the handles.
Range may lie between sub set of handles.
Bug 3494980
Change-Id: I5c688f832a7a3bb0b6e3713ec6462224bb6fbfc5
Signed-off-by: Puneet Saxena <puneets@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2789431
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
2023-04-11 05:54:22 +00:00
Laxman Dewangan
4cf8c80669
nvmap: Copy drivers and headers from kernel/nvidia
...
Copy the driver and header sources of the nvmap to
kernel/nvidia-oot from kernel/nvidia as part of
removing the dependency of kernel/nvidia for OOT drivers.
The latest (few) git history of the files copied are
b7a355916 video: tegra: nvmap: Fix type casting issue
2128c5433 video: tegra: nvmap: Fix type casting issues
0cd082559 video: tegra: nvmap: Change peer vm id data type
4bd7ece67 tegra: nvmap: mark ivm carveout pages occupied
e86f3630a video: tegra: nvmap: Fix type casting issue
c43a23e58 video: tegra: nvmap: Fix type casting issue
ca1dda22e video: tegra: nvmap: Fix type casting issue
1f567abfe video: tegra: nvmap: Fix wrap up condition
29db4d31c video: tegra: nvmap: Remove unnecessary debugfs
fe72f1413 video: tegra: nvmap: Remove get_drv_data() call
3b0fc79e7 video: tegra: nvmap: Fix coverity defect
3cc0ce41b video: tegra: nvmap: Fix coverity defect
6da39e966 video: tegra: nvmap: Fix WARN_ON condition
a16351ff1 video: tegra: nvmap: Remove dead code
9993f2d2d video: tegra: nvmap: Update print level
6066a2077 video: tegra: nvmap: Remove nvmap_debug_lru_allocations_show
3cdf2b7ba video: tegra: nvmap: Add kernel version check
716ded4fc video: tegra: nvmap: Initialize the return value
9b6c1b4ab video: tegra: nvmap: Correct debugfs code
33e70118b video: tegra: nvmap: Fix Cert-C error handling bug
7b960ed79 video: tegra: nvmap: Fix Cert-C error handling bug
945dc1471 video: tegra: nvmap: Fix Cert-C error handling bug
31e572de2 video: tegra: nvmap: Fix Cert-C error handling bug
1f25cbf68 video: tegra: nvmap: Fix Cert-C error handling bug
fa5428107 video: tegra: nvmap: Remove nvmap_handle_get_from_fd
df73f2208 video: tegra: nvmap: Protect kmap/kunmap code
9842e7c6a video: tegra: nvmap: Remove t19x dma_buf map/unmap
06dff1a8d video: tegra: nvmap: Remove unnecessary export symbols
6f097f86b video: tegra: nvmap: Fix Cert-C error handling bug
f14171608 video: tegra: nvmap: load nvmap for T23x compatible platforms
266812814 video: tegra: nvmap: Get rid of NVMAP_CONFIG_KSTABLE_KERNEL
1b38c0887 nvmap: Don't use NV_BUILD_KERNEL_OPTIONS
0ab8dc032 video: tegra: nvmap: Reintroduce NVMAP_CONFIG_VPR_RESIZE
cc8db9797 driver: platform: tegra: Separate out vpr code
28955d95c video/tegra: nvmap: Enable build as OOT module
876d1fbb8 video: tegra: nvmap: Remove IS_ENABLED check
5ea30867a nvmap: Add support to build as module from OOT kernel
a71ad020e video: tegra: nvmap: Protect tegra_vpr args under config
e70061cc1 video: tegra: nvmap: Do not export cvnas_dev
d2a26ff36 video: tegra: nvmap: Include missing header
692e4f682 video: tegra: nvmap: Update page coloring algo
2b9dbb911 video: tegra: nvmap: Check for return value
de8de12b6 video: tegra: nvmap: Enable legacy init support
65d478158 video: tegra: nvmap: Remove dependency of cvnas
38bdd6f05 video: tegra: nvmap: Make nvmap as loadable module
9668e410b video: tegra: nvmap: Enable handle as ID
11c6cbd23 tegra: nvmap: Fix build for Linux v5.18
fbd95c3ab linux: nvmap: change ivm_handle to u32
eb1e2c302 video: tegra: nvmap: Fix NVSCIIPC support
022689b29 tegra: nvmap: return error if handle as ID enabled but id is fd
19e5106ed video: tegra: nvmap: Don't treat ivm as reserved mem carveouts
Bug 4038415
Change-Id: I7108aec3b8532fe79c9423c2835744b1213719e8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com >
2023-04-11 05:47:21 +00:00