[RFC] pl330: Interleaved (2D) Transfers

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

 



Hello all,

I've got an application where I'd like to be able to use the PL330 DMA to do 2D
mem-to-mem transfers (i.e. I have two source buffers and I want to interleave
them into a destination buffer one 32-bit word at a time). I'll need to do this
using two separate transfers, since I may not have both buffers available
simultaneously.

I think that this should be possible by adding the appropriate ADDH to the
load/store loop in _ldst_memtomem(), after having set my source and destination
burst size to 4 and length to 1:

static inline int _ldst_memtomem(unsigned dry_run, u8 buf[],
const struct _xfer_spec *pxs, int cyc,
u16 ld_stride, u16 st_stride )
{
...
    while (cyc--) {
        off += _emit_LD(dry_run, &buf[off], ALWAYS);
        off += _emit_ST(dry_run, &buf[off], ALWAYS);
        if ( ld_stride > 4 )
            off += _emit_ADDH(dry_run, &buf[off], SRC, ld_stride-4);
        if ( st_stride > 4 )
            off += _emit_ADDH(dry_run, &buf[off], DST, st_stride-4);
...
}

I'd then make the above available through a "device_prep_interleaved_dma"-style
interface.

Depending on the src_inc and dst_inc values in the dma_interleaved_template, it
might be possible to increase the burst length/size of either the source or
destination as well, which would require changing the code above, but I'm just
thinking of a simple implementation right now.

Is anyone aware of any other issues I should be concerned with when trying to
implement 2D transfers with the pl330 DMA?

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



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux