drm: prime: add common helper to check scatterlist contiguity

It is a common operation done by DRM drivers to check the contiguity
of the DMA-mapped buffer described by a scatterlist in the
sg_table object. Let's add a common helper for this operation.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
This commit is contained in:
Marek Szyprowski
2020-05-08 16:04:44 +02:00
parent 9123e3a74e
commit d46e7ae24b
3 changed files with 36 additions and 20 deletions

View File

@@ -92,6 +92,8 @@ struct sg_table *drm_prime_pages_to_sg(struct page **pages, unsigned int nr_page
struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj,
int flags);
unsigned long drm_prime_get_contiguous_size(struct sg_table *sgt);
/* helper functions for importing */
struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev,
struct dma_buf *dma_buf,