diff mbox series

[3/3] dmaengine: pl330: Add DMA_2D capability

Message ID 20250210061915.26218-4-aatif4.m@samsung.com (mailing list archive)
State New
Headers show
Series Add capability for 2D DMA transfer | expand

Commit Message

Aatif Mushtaq Feb. 10, 2025, 6:19 a.m. UTC
Add a capability to prepare DMA for 2D transfer and create a hook
between the DMA engine and the pl330 driver

Signed-off-by: Aatif Mushtaq <aatif4.m@samsung.com>
---
 drivers/dma/pl330.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Pankaj Dubey Feb. 10, 2025, 7:54 a.m. UTC | #1
> -----Original Message-----
> From: Aatif Mushtaq <aatif4.m@samsung.com>
> Sent: Monday, February 10, 2025 11:49 AM
> To: vkoul@kernel.org; dmaengine@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Cc: pankaj.dubey@samsung.com; aswani.reddy@samsung.com; Aatif Mushtaq
> <aatif4.m@samsung.com>
> Subject: [PATCH 3/3] dmaengine: pl330: Add DMA_2D capability
> 
> Add a capability to prepare DMA for 2D transfer and create a hook
> between the DMA engine and the pl330 driver
> 
> Signed-off-by: Aatif Mushtaq <aatif4.m@samsung.com>
> ---

Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
diff mbox series

Patch

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 546ea442044e..ac17657413b5 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2847,6 +2847,23 @@  pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
 	return &desc->txd;
 }
 
+static struct dma_async_tx_descriptor *
+pl330_prep_2d_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
+		dma_addr_t src, size_t len, u16 src_imm,
+		u16 dst_imm, unsigned long flags)
+{
+	struct dma_pl330_desc *desc;
+	struct dma_async_tx_descriptor *tx;
+
+	tx = pl330_prep_dma_memcpy(chan, dst, src, len, flags);
+	desc = to_desc(tx);
+
+	desc->px.src_imm = src_imm;
+	desc->px.dst_imm = dst_imm;
+
+	return tx;
+}
+
 static void __pl330_giveback_desc(struct pl330_dmac *pl330,
 				  struct dma_pl330_desc *first)
 {
@@ -3157,6 +3174,7 @@  pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	pd->device_alloc_chan_resources = pl330_alloc_chan_resources;
 	pd->device_free_chan_resources = pl330_free_chan_resources;
 	pd->device_prep_dma_memcpy = pl330_prep_dma_memcpy;
+	pd->device_prep_2d_dma_memcpy = pl330_prep_2d_dma_memcpy;
 	pd->device_prep_dma_cyclic = pl330_prep_dma_cyclic;
 	pd->device_tx_status = pl330_tx_status;
 	pd->device_prep_slave_sg = pl330_prep_slave_sg;