Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1515262
| Path | csiph.com!news.redatomik.org!enother.net!enother.net!enother.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] media: omap3isp: Use dma_request_chan_by_mask() to request the DMA channel |
| Date | Fri, 04 Nov 2016 16:50:01 +0100 |
| Message-ID | <szOUF-3Dx-5@gated-at.bofh.it> (permalink) |
| References | <szHzP-7cG-5@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1478274310; bh=HfoylKgh8f0lAkYcqxWvjqI1491uIaKDxxvCy2YsJDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qO/RTtHzY9pKqSWnIzn7jaLmTQE33rUf7Gd/7SpBuI211/8wTl6fQ2h7G4Zn48XXj mDoSjVLi6tDD1ayRjBDqp+B/P8GHqp4e8RO7jKWdQoX4tDiiYGXtvndACHkR6W8EPF 1V6bpkjfdqUpe7IOYwSDEd4Q+5zcRJGzyGNDAnEU= |
| User-Agent | KMail/4.14.10 (Linux/4.8.6-gentoo; KDE/4.14.24; x86_64; ; ) |
| MIME-Version | 1.0 |
| Content-Transfer-Encoding | 7Bit |
| Content-Type | text/plain; charset="us-ascii" |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 98 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | mchehab@osg.samsung.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Fri, 04 Nov 2016 17:46:03 +0200 |
| X-Original-Message-ID | <4166499.xzsPgrmGQ7@avalon> |
| X-Original-References | <20161104075802.19063-1-peter.ujfalusi@ti.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1515262 |
Show key headers only | View raw
Hi Peter,
Thank you for the patch.
On Friday 04 Nov 2016 09:58:02 Peter Ujfalusi wrote:
> When requesting the DMA channel it was mandatory that we do not have DMA
> resource nor valid DMA channel via DT. In this case the
> dma_request_slave_channel_compat() would fall back and request any channel
> with SW trigger.
>
> The same can be achieved with the dma_request_chan_by_mask() without the
> misleading use of the DMAengine API - implying that the omap3isp does
> need to have DMA resource or valid dma binding in DT.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> CC: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
and added to my tree.
> ---
> Hi,
>
> Changes sicne v1:
> - use dma_request_chan_by_mask() to request the channel as for the histogram
> data reading we do not have hw syncronisation. Add comment about this also
> to clarify the reason.
>
> Regards,
> Peter
>
> drivers/media/platform/omap3isp/isphist.c | 28 +++++++++++++++-------------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/media/platform/omap3isp/isphist.c
> b/drivers/media/platform/omap3isp/isphist.c index
> 7138b043a4aa..a4ed5d140d48 100644
> --- a/drivers/media/platform/omap3isp/isphist.c
> +++ b/drivers/media/platform/omap3isp/isphist.c
> @@ -18,7 +18,6 @@
> #include <linux/delay.h>
> #include <linux/device.h>
> #include <linux/dmaengine.h>
> -#include <linux/omap-dmaengine.h>
> #include <linux/slab.h>
> #include <linux/uaccess.h>
>
> @@ -486,27 +485,30 @@ int omap3isp_hist_init(struct isp_device *isp)
> hist->isp = isp;
>
> if (HIST_CONFIG_DMA) {
> - struct platform_device *pdev = to_platform_device(isp->dev);
> - struct resource *res;
> - unsigned int sig = 0;
> dma_cap_mask_t mask;
>
> + /*
> + * We need slave capable channel without DMA request line for
> + * reading out the data.
> + * For this we can use dma_request_chan_by_mask() as we are
> + * happy with any channel as long as it is capable of slave
> + * configuration.
> + */
> dma_cap_zero(mask);
> dma_cap_set(DMA_SLAVE, mask);
> + hist->dma_ch = dma_request_chan_by_mask(&mask);
> + if (IS_ERR(hist->dma_ch)) {
> + ret = PTR_ERR(hist->dma_ch);
> + if (ret == -EPROBE_DEFER)
> + return ret;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
> - "hist");
> - if (res)
> - sig = res->start;
> -
> - hist->dma_ch = dma_request_slave_channel_compat(mask,
> - omap_dma_filter_fn, &sig, isp->dev, "hist");
> - if (!hist->dma_ch)
> + hist->dma_ch = NULL;
> dev_warn(isp->dev,
> "hist: DMA channel request failed, using
PIO\n");
> - else
> + } else {
> dev_dbg(isp->dev, "hist: using DMA channel %s\n",
> dma_chan_name(hist->dma_ch));
> + }
> }
>
> hist->ops = &hist_ops;
--
Regards,
Laurent Pinchart
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2] media: omap3isp: Use dma_request_chan_by_mask() to request the DMA channel Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-11-04 09:00 +0100 Re: [PATCH v2] media: omap3isp: Use dma_request_chan_by_mask() to request the DMA channel Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-11-04 16:50 +0100
csiph-web