From: Tomasz Stanislawski Date: Mon, 18 Jun 2012 07:25:01 +0000 (+0200) Subject: scatterlist: add sg_alloc_table_from_pages function X-Git-Tag: v3.6-rc1~57^2~11 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efc42bc98058a36d761b16a114823db1a902ed05;p=pandora-kernel.git scatterlist: add sg_alloc_table_from_pages function This patch adds a new constructor for an sg table. The table is constructed from an array of struct pages. All contiguous chunks of the pages are merged into a single sg nodes. A user may provide an offset and a size of a buffer if the buffer is not page-aligned. The function is dedicated for DMABUF exporters which often perform conversion from an page array to a scatterlist. Moreover the scatterlist should be squashed in order to save memory and to speed-up the process of DMA mapping using dma_map_sg. The code is based on the patch 'v4l: vb2-dma-contig: add support for scatterlist in userptr mode' and hints from Laurent Pinchart. Signed-off-by: Tomasz Stanislawski Signed-off-by: Kyungmin Park Acked-by: Daniel Vetter Acked-by: Laurent Pinchart Signed-off-by: Marek Szyprowski CC: Andrew Morton --- Reading git-diff-tree failed