There is a problem for transferring TILER UV data by EDMA in DM8127.
The pitch of UV data in TLER is 32768, but the pitch for EDMA is -32768~32767, so EDMA transfer UV data first at the bottom line of the frames.
The code is as follows:
void DM81XX_EDMA3_setUVParams(int chId,
int dmaQueue,
unsigned int srcAddr,
unsigned int dstAddr,
unsigned short edmaWidth,
unsigned short edmaHeight,
short srcLineOffset, short dstLineOffset)
{
volatile unsigned int PaRAMEntryAddr = DM81XX_EDMA3_PARAM_BASE + (chId * 0x20);
volatile unsigned int dchmapChId = DM81XX_EDMA3_DCHMAP0 + (chId << 2);
volatile unsigned int dmaQnum = DM81XX_EDMA3_DMAQNUM0 + ((chId >> 3) << 2);
/* PaRAM entry setup */
*((volatile unsigned int *) (PaRAMEntryAddr + OPT)) = ((0) | // SAM -> INCR mode
(0 << 1) | // DAM -> INCR mode
(1 << 2) | // SYNCDIM -> AB synchronized
(0 << 3) | // STATIC
(4 << 8) | // FWID
(0 << 11) | // TCCMODE
(chId << 12) | // TCC
(1 << 20) | // TCINTEN
(1 << 21) | // ITCINTEN
(0 << 22) | // TCCHEN
(0 << 23) | // ITCCHEN
(0 << 24)); // PRIVID
*((volatile unsigned int *) (PaRAMEntryAddr + SRC)) = srcAddr;
*((volatile unsigned int *) (PaRAMEntryAddr + A_B_CNT)) =
(edmaHeight << 16) | (edmaWidth);
*((volatile unsigned int *) (PaRAMEntryAddr + DST)) = dstAddr;
*((volatile unsigned int *) (PaRAMEntryAddr + SRC_DST_BIDX)) =
(dstLineOffset << 16) | (srcLineOffset);
*((volatile unsigned int *) (PaRAMEntryAddr + LINK_BCNTRLD)) =
(0 << 16) | 0xFFFF;
*((volatile unsigned int *) (PaRAMEntryAddr + SRC_DST_CIDX)) =
(0x0 << 16) | 0;
*((volatile unsigned int *) (PaRAMEntryAddr + CCNT)) = 0x1;
if (chId < 32)
{
/* Set Shadow region for the channel */
*((volatile unsigned int *) DM81XX_EDMA3_DRAE3) |= (1 << chId);
/* Enable interrupt */
*((volatile unsigned int *) DM81XX_EDMA3_IESR) |= (1 << chId);
}
else
{
/* Set Shadow region for the channel */
*((volatile unsigned int *) DM81XX_EDMA3_DRAE3H) |= (1 << (chId - 32));
/* Enable interrupt */
*((volatile unsigned int *) DM81XX_EDMA3_IESRH) |= (1 << (chId - 32));
}
/* channel to PaRAM entry mapping */
*((volatile unsigned int *) dchmapChId) = (chId << 5);
/* channel to queue mapping */
*((volatile unsigned int *) dmaQnum) |= (dmaQueue << ((chId & 0x7) * 4));
}
UVheight = ((edmaHeight + 1) >> 1);
src = (UInt32)((unsigned char *)Utils_tilerAddr2CpuAddr((UInt32)pReqObj->inFrameList.frames[0]->addr[0][1])
+ VPSUTILS_TILER_CNT_16BIT_PITCH * (UVheight - 1);
dst = Utils_tilerAddr2CpuAddr((UInt32)pReqObj->outFrameList.frames[0]->addr[0][1]) ;
+ VPSUTILS_TILER_CNT_16BIT_PITCH * (UVheight - 1);
DM81XX_EDMA3_setUVParams(pObj->UVAedmaHndl.dmaHndl.chId, // chId
COPY_LINK_EDMA3_UVQUEUE_ID, // dmaQueue
src, // srcAddr
dst, // dstAddr
edmaWidth, // edmaWidth
UVheight, //edmaHeight
-(VPSUTILS_TILER_CNT_16BIT_PITCH), // srcLineOffset
-(VPSUTILS_TILER_CNT_16BIT_PITCH) ); // dstLineOffset
DM81XX_EDMA3_trigger(pObj->UVAedmaHndl.dmaHndl.chId);
DM81XX_EDMA3_wait(pObj->UVAedmaHndl.dmaHndl.chId);
But the image got by the programs is
So what's wrong with the EDMA?