* [PATCH] OMAP3 ISP: Set DMA segment size
@ 2015-03-18 22:55 Tim Nordell
2015-03-19 13:59 ` [PATCH v2] " Tim Nordell
0 siblings, 1 reply; 3+ messages in thread
From: Tim Nordell @ 2015-03-18 22:55 UTC (permalink / raw)
To: linux-media; +Cc: laurent.pinchart, sakari.ailus, Tim Nordell
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 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index ead2d0d..ab95fd1 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2170,6 +2170,14 @@ 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);
+ ret = dma_set_max_seg_size(isp->dev, SZ_32M);
+ if (ret < 0) {
+ dev_err(isp->dev, "failed to set max segment size for dma\n");
+ goto error;
+ }
+
return 0;
error:
--
2.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2] OMAP3 ISP: Set DMA segment size
2015-03-18 22:55 [PATCH] OMAP3 ISP: Set DMA segment size Tim Nordell
@ 2015-03-19 13:59 ` Tim Nordell
2015-04-13 21:22 ` Laurent Pinchart
0 siblings, 1 reply; 3+ messages in thread
From: Tim Nordell @ 2015-03-19 13:59 UTC (permalink / raw)
To: linux-media; +Cc: laurent.pinchart, sakari.ailus, Tim Nordell
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;
+ }
+
+ ret = dma_set_max_seg_size(isp->dev, SZ_32M);
+ if (ret < 0) {
+ dev_err(isp->dev, "failed to set max segment size for dma\n");
+ goto error;
+ }
+
return 0;
error:
--
2.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] OMAP3 ISP: Set DMA segment size
2015-03-19 13:59 ` [PATCH v2] " Tim Nordell
@ 2015-04-13 21:22 ` Laurent Pinchart
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2015-04-13 21:22 UTC (permalink / raw)
To: Tim Nordell; +Cc: linux-media, sakari.ailus
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-13 21:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox