From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tim Nordell <tim.nordell@logicpd.com>
Cc: linux-media@vger.kernel.org, sakari.ailus@iki.fi
Subject: Re: [PATCH v2] OMAP3 ISP: Set DMA segment size
Date: Tue, 14 Apr 2015 00:22:10 +0300 [thread overview]
Message-ID: <1510418.BOtJjAzaMU@avalon> (raw)
In-Reply-To: <1426773592-30182-1-git-send-email-tim.nordell@logicpd.com>
Hi Tim,
Thank you for the patch.
On Thursday 19 March 2015 08:59:52 Tim Nordell wrote:
> When utilizing userptr buffers for output from the CCDC, the
> DMA subsystem maps buffers into the virtual address space.
> However, the DMA subsystem also has a configurable parameter
> for what the largest segment to allocate is out of the virtual
> address space as well.
>
> Since we need contiguous buffers for the memory space from the
> OMAP3 ISP's vantage point, we need to configure the segments
> to be at least as large as the largest buffer we expect.
>
> Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
> ---
> drivers/media/platform/omap3isp/isp.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index ead2d0d..906d3e5 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -2170,6 +2170,20 @@ static int isp_attach_iommu(struct isp_device *isp)
> goto error;
> }
>
> + isp->dev->dma_parms = devm_kzalloc(isp->dev,
> + sizeof(*isp->dev->dma_parms), GFP_KERNEL);
> + if (!isp->dev->dma_parms) {
> + dev_err(isp->dev, "failed to allocate memory for dma_parms\n");
> + ret = -ENOMEM;
> + goto error;
> + }
How about adding a struct device_dma_parameters field in struct isp_device and
just assigning isp->dev->dma_parms = &isp->dma_parms ? This would get rid of
the separate allocation step.
> +
> + ret = dma_set_max_seg_size(isp->dev, SZ_32M);
There's no reason to limit the size to 32MB, you can use the full 4GB
addressable space.
> + if (ret < 0) {
> + dev_err(isp->dev, "failed to set max segment size for dma\n");
> + goto error;
> + }
> +
> return 0;
>
> error:
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2015-04-13 21:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 22:55 [PATCH] OMAP3 ISP: Set DMA segment size Tim Nordell
2015-03-19 13:59 ` [PATCH v2] " Tim Nordell
2015-04-13 21:22 ` 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=1510418.BOtJjAzaMU@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
--cc=tim.nordell@logicpd.com \
/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