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>
This commit is contained in:
Puneet Saxena
2022-10-14 16:13:14 +05:30
committed by Laxman Dewangan
parent f1e2cd8dea
commit c4a88d6515
9 changed files with 335 additions and 3 deletions

View File

@@ -229,9 +229,15 @@ static int nvmap_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
if (PageAnon(page) && (vma->vm_flags & VM_SHARED))
return VM_FAULT_SIGSEGV;
if (priv->handle->is_subhandle) {
pr_err("sub_handle page:%p\n", page);
kaddr = kmap(page);
BUG_ON(!kaddr);
inner_cache_maint(NVMAP_CACHE_OP_WB_INV, kaddr, PAGE_SIZE);
kunmap(page);
}
if (!nvmap_handle_track_dirty(priv->handle))
goto finish;
mutex_lock(&priv->handle->lock);
if (nvmap_page_dirty(priv->handle->pgalloc.pages[offs])) {
mutex_unlock(&priv->handle->lock);