From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH] media: omap3isp: hist: Move histogram DMA to DMA engine
Date: Fri, 13 Mar 2015 02:26:04 +0200 [thread overview]
Message-ID: <109710782.yRElq6GaBL@avalon> (raw)
In-Reply-To: <20150312235632.GQ11954@valkosipuli.retiisi.org.uk>
Hi Sakari,
Thank you for the review.
On Friday 13 March 2015 01:56:32 Sakari Ailus wrote:
> On Sun, Mar 08, 2015 at 11:37:55PM +0200, Laurent Pinchart wrote:
> ...
>
> > @@ -198,24 +177,58 @@ static void hist_dma_cb(int lch, u16 ch_status, void
> > *data)
> > static int hist_buf_dma(struct ispstat *hist)
> > {
> > dma_addr_t dma_addr = hist->active_buf->dma_addr;
> > + struct dma_async_tx_descriptor *tx;
> > + struct dma_slave_config cfg;
> > + dma_cookie_t cookie;
> > + int ret;
> >
> > if (unlikely(!dma_addr)) {
> > dev_dbg(hist->isp->dev, "hist: invalid DMA buffer address\n");
> > - hist_reset_mem(hist);
> > - return STAT_NO_BUF;
> > + goto error;
> > }
> >
> > isp_reg_writel(hist->isp, 0, OMAP3_ISP_IOMEM_HIST, ISPHIST_ADDR);
> > isp_reg_set(hist->isp, OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT,
> > ISPHIST_CNT_CLEAR);
> >
> > omap3isp_flush(hist->isp);
> >
> > - hist->dma_config.dst_start = dma_addr;
> > - hist->dma_config.elem_count = hist->buf_size / sizeof(u32);
> > - omap_set_dma_params(hist->dma_ch, &hist->dma_config);
> >
> > - omap_start_dma(hist->dma_ch);
> > + memset(&cfg, 0, sizeof(cfg));
> > + cfg.src_addr = hist->isp->mmio_base_phys[OMAP3_ISP_IOMEM_HIST]
> > + + ISPHIST_DATA;
> > + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
> > + cfg.src_maxburst = hist->buf_size / 4;
>
> How about initialising the struct when you declare it instead? That might be
> a matter of opinion though, but I think I prefer that. Up to you.
I sometimes agree with this argument, but in this case the separation between
initialization and usage of the structure would in my opinion impede
readability.
I've also checked the code generated by the compiler, and except for memset
being replaced by __memzero, initializing the structure at declaration time
doesn't make a difference.
> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2015-03-13 0:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-08 21:37 [PATCH] media: omap3isp: hist: Move histogram DMA to DMA engine Laurent Pinchart
2015-03-12 23:56 ` Sakari Ailus
2015-03-13 0:26 ` Laurent Pinchart [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=109710782.yRElq6GaBL@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox