Skip to contentSkip to conversation

drm: use dmaengine API instead of raw function pointers

PATCH In review [email protected] 2 participants 2 messages Oct 2 – Oct 6

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: use dmaengine API instead of raw function pointers

From: Frank Li <[email protected]>

Replace direct calls through dma_async_tx_descriptor and dma_device function pointers with the proper dmaengine API wrappers in vc4_dsi and omap_dmm_tiler.

Assisted-by LLM
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 2 +-
 drivers/gpu/drm/vc4/vc4_dsi.c            | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +1 -1
index a2c702b831a7c..c5dd350f937f4 100644
@@ -87,7 +87,7 @@ static int dmm_dma_copy(struct dmm *dmm, dma_addr_t src, dma_addr_t dst)
 		return -EIO;
 	}
 
-	cookie = tx->tx_submit(tx);
+	cookie = dmaengine_submit(tx);
 	if (dma_submit_error(cookie)) {
 		dev_err(dmm->dev, "Failed to do DMA tx_submit\n");
 		return -EIO;
drivers/gpu/drm/vc4/vc4_dsi.c +3 -5
index 0148f2befed14..b1626c2d3a582 100644
@@ -628,16 +628,14 @@ dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val)
 
 	*dsi->reg_dma_mem = val;
 
-	tx = chan->device->device_prep_dma_memcpy(chan,
-						  dsi->reg_paddr + offset,
-						  dsi->reg_dma_paddr,
-						  4, 0);
+	tx = dmaengine_prep_dma_memcpy(chan, dsi->reg_paddr + offset,
+				       dsi->reg_dma_paddr, 4, 0);
 	if (!tx) {
 		drm_err(drm, "Failed to set up DMA register write\n");
 		return;
 	}
 
-	cookie = tx->tx_submit(tx);
+	cookie = dmaengine_submit(tx);
 	ret = dma_submit_error(cookie);
 	if (ret) {
 		drm_err(drm, "Failed to submit DMA: %d\n", ret);
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw

Hi Frank,

Quoted 8 lines · On 02/10/26 17:06, [email protected] wrote:

From: Frank Li <[email protected]>

Replace direct calls through dma_async_tx_descriptor and dma_device function pointers with the proper dmaengine API wrappers in vc4_dsi and omap_dmm_tiler.

Assisted-by LLM

For VC4:

Best regards,
- Maíra

Quoted 42 lines
---
  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 2 +-
  drivers/gpu/drm/vc4/vc4_dsi.c            | 8 +++-----
  2 files changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +1 -1
index a2c702b831a7c..c5dd350f937f4 100644
@@ -87,7 +87,7 @@ static int dmm_dma_copy(struct dmm *dmm, dma_addr_t src, dma_addr_t dst)
  		return -EIO;
  	}
 
-	cookie = tx->tx_submit(tx);
+	cookie = dmaengine_submit(tx);
  	if (dma_submit_error(cookie)) {
  		dev_err(dmm->dev, "Failed to do DMA tx_submit\n");
  		return -EIO;
drivers/gpu/drm/vc4/vc4_dsi.c +3 -5
index 0148f2befed14..b1626c2d3a582 100644
@@ -628,16 +628,14 @@ dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val)
 
  	*dsi->reg_dma_mem = val;
 
-	tx = chan->device->device_prep_dma_memcpy(chan,
-						  dsi->reg_paddr + offset,
-						  dsi->reg_dma_paddr,
-						  4, 0);
+	tx = dmaengine_prep_dma_memcpy(chan, dsi->reg_paddr + offset,
+				       dsi->reg_dma_paddr, 4, 0);
  	if (!tx) {
  		drm_err(drm, "Failed to set up DMA register write\n");
  		return;
  	}
 
-	cookie = tx->tx_submit(tx);
+	cookie = dmaengine_submit(tx);
  	ret = dma_submit_error(cookie);
  	if (ret) {
  		drm_err(drm, "Failed to submit DMA: %d\n", ret);