Displaying 2 results from an estimated 2 matches for "drm_prime_sg_to_page_addr_array".
Did you mean:
drm_prime_sg_to_page_addr_arrays
2020 Aug 24
1
[PATCH 0/8] Convert the intel iommu driver to the dma-iommu api
...to stop iterating -- and I suspect this
> is the bug that got in Tom's way.
>
> >> However, as Robin pointed out, there are other ugly tricks like stopping
> >> iterating through the SGL when sg_dma_len() is zero. For example, the
> >> AMD driver appears to use drm_prime_sg_to_page_addr_arrays() which does
> >> this trick and thus likely isn't buggy (otherwise, I'd expect someone to
> >> have complained by now seeing AMD has already switched to IOMMU-DMA.
> >
> > I'm not sure that this is a trick. Stopping at zero sg_dma_len() was
> > some...
2020 Nov 09
1
[PATCH 2/2] drm/mediatek: Use struct dma_buf_map in GEM vmap ops
...obj);
if (IS_ERR(sgt))
- return NULL;
+ return PTR_ERR(sgt);
npages = obj->size >> PAGE_SHIFT;
mtk_gem->pages = kcalloc(npages, sizeof(*mtk_gem->pages), GFP_KERNEL);
- if (!mtk_gem->pages)
- goto out;
+ if (!mtk_gem->pages) {
+ kfree(sgt);
+ return -ENOMEM;
+ }
drm_prime_sg_to_page_addr_arrays(sgt, mtk_gem->pages, NULL, npages);
@@ -265,13 +267,15 @@ void *mtk_drm_gem_prime_vmap(struct drm_gem_object *obj)
out:
kfree(sgt);
+ dma_buf_map_set_vaddr(map, mtk_gem->kvaddr);
- return mtk_gem->kvaddr;
+ return 0;
}
-void mtk_drm_gem_prime_vunmap(struct drm_gem_object *obj,...