Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751501AbbGLRgD (ORCPT ); Sun, 12 Jul 2015 13:36:03 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:37787 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751320AbbGLRgB (ORCPT ); Sun, 12 Jul 2015 13:36:01 -0400 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Sun, 12 Jul 2015 19:35:59 +0200 X-ME-IP: 86.199.64.162 From: Robert Jarzmik To: Guennadi Liakhovetski Cc: Mauro Carvalho Chehab , Jiri Kosina , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] media: pxa_camera: conversion to dmaengine References: <1436120872-24484-1-git-send-email-robert.jarzmik@free.fr> <1436120872-24484-5-git-send-email-robert.jarzmik@free.fr> X-URL: http://belgarath.falguerolles.org/ Date: Sun, 12 Jul 2015 19:33:09 +0200 In-Reply-To: (Guennadi Liakhovetski's message of "Sun, 12 Jul 2015 19:05:49 +0200 (CEST)") Message-ID: <87y4iljn6y.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1224 Lines: 32 Guennadi Liakhovetski writes: >> /* init DMA for Y channel */ > > How about taking the loop over the sg list out of pxa_init_dma_channel() > to avoid having to iterate it from the beginning each time? Then you would > be able to split it into channels inside that global loop? Would that > work? Of course you might need to rearrange functions to avoid too deep > code nesting. Ok, will try that. The more I think of it, the more it looks to me like a generic thing : take an sglist, and an array of sizes, and split the sglist into several sglists, each of the defined size in the array. Or more code-like speaking : - sglist_split(struct scatterlist *sg_int, size_t *sizes, int nb_sizes, struct scatterlist **sg_out) - and sg_out is an array of nb_sizes (struct scatterlist *sg) So I will try that out. Maybe if that works out for pxa_camera, Jens or Russell would accept that into lib/scatterlist.c. Cheers. -- Robert -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/