diff options
author | 2017-11-10 13:33:10 +0000 | |
---|---|---|
committer | 2017-11-15 18:14:46 +0100 | |
commit | 998fb1a0f478b83492220ff79583bf9ad538bdd8 (patch) | |
tree | 2726e7460e19dbee07402dec75f13522b44c6502 /include/drm/drm_gem_cma_helper.h | |
parent | drm/atomic-helper: always track connector commits, too (diff) | |
download | linux-998fb1a0f478b83492220ff79583bf9ad538bdd8.tar.gz linux-998fb1a0f478b83492220ff79583bf9ad538bdd8.tar.bz2 linux-998fb1a0f478b83492220ff79583bf9ad538bdd8.zip |
drm: gem_cma_helper.c: Allow importing of contiguous scatterlists with nents > 1
drm_gem_cma_prime_import_sg_table() will fail if the number of entries
in the sg_table > 1. However, you can have a device that uses an IOMMU
engine and can map a discontiguous buffer with multiple entries that
have consecutive sg_dma_addresses, effectively making it contiguous.
Allow for that scenario by testing the entries in the sg_table for
contiguous coverage.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171110133310.1225-1-Liviu.Dudau@arm.com
Diffstat (limited to 'include/drm/drm_gem_cma_helper.h')
-rw-r--r-- | include/drm/drm_gem_cma_helper.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h index 76ded75f02cc..f191227f60c0 100644 --- a/include/drm/drm_gem_cma_helper.h +++ b/include/drm/drm_gem_cma_helper.h @@ -8,7 +8,9 @@ * struct drm_gem_cma_object - GEM object backed by CMA memory allocations * @base: base GEM object * @paddr: physical address of the backing memory - * @sgt: scatter/gather table for imported PRIME buffers + * @sgt: scatter/gather table for imported PRIME buffers. The table can have + * more than one entry but they are guaranteed to have contiguous + * DMA addresses. * @vaddr: kernel virtual address of the backing memory */ struct drm_gem_cma_object { |