[PATCH v2] OMAP3 ISP: Set DMA segment size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux