]> git.baikalelectronics.ru Git - kernel.git/commit
drm: gem_cma_helper.c: Allow importing of contiguous scatterlists with nents > 1
authorLiviu Dudau <Liviu.Dudau@arm.com>
Fri, 10 Nov 2017 13:33:10 +0000 (13:33 +0000)
committerNoralf Trønnes <noralf@tronnes.org>
Wed, 15 Nov 2017 17:14:46 +0000 (18:14 +0100)
commita7f3657e8cfa0dbe2644bcf1168d3eb0937f055c
tree2726e7460e19dbee07402dec75f13522b44c6502
parentc7b9f5774c336535d4f9eaf5e4b086e583496450
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
drivers/gpu/drm/drm_gem_cma_helper.c
include/drm/drm_gem_cma_helper.h