From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755832AbbHCXTm (ORCPT ); Mon, 3 Aug 2015 19:19:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46371 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755758AbbHCXTl (ORCPT ); Mon, 3 Aug 2015 19:19:41 -0400 Date: Mon, 3 Aug 2015 16:19:39 -0700 From: Andrew Morton To: Robert Jarzmik Cc: Russell King - ARM Linux , Jens Axboe , Guennadi Liakhovetski , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [RFC PATCH v2] lib: scatterlist: add sg splitting function Message-Id: <20150803161939.2edd494eb64bc81ea8e91c16@linux-foundation.org> In-Reply-To: <1438435033-7636-1-git-send-email-robert.jarzmik@free.fr> References: <1438435033-7636-1-git-send-email-robert.jarzmik@free.fr> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 1 Aug 2015 15:17:13 +0200 Robert Jarzmik wrote: > Sometimes a scatter-gather has to be split into several chunks, or sub scatter > lists. This happens for example if a scatter list will be handled by multiple > DMA channels, each one filling a part of it. > > A concrete example comes with the media V4L2 API, where the scatter list is > allocated from userspace to hold an image, regardless of the knowledge of how > many DMAs will fill it : > - in a simple RGB565 case, one DMA will pump data from the camera ISP to memory > - in the trickier YUV422 case, 3 DMAs will pump data from the camera ISP pipes, > one for pipe Y, one for pipe U and one for pipe V > > For these cases, it is necessary to split the original scatter list into > multiple scatter lists, which is the purpose of this patch. > > ... > > include/linux/scatterlist.h | 5 ++ > lib/scatterlist.c | 189 ++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 194 insertions(+) It's quite a bit of code for a fairly specialised thing. How ugly would it be to put this in a new .c file and have subsystems select it in Kconfig?