iMX6solo: How to convert YUV422 images on RAM to RGB565 images by using IPU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6solo: How to convert YUV422 images on RAM to RGB565 images by using IPU

740 Views
koichisakagami
Contributor II

Dear community,

I want to convert some YUV422 images on RAM Memory to
RGB565 images by using IPU's IC module and IDMAC (ch#12, #20) as following diagram.

[Mem(YUV422)] -> [IDMAC(ch#12)] -> [IC Encode] ->[IDMAC(ch#20)] -> [Mem(RGB565)]

This flow is described in i.MX6Solo Reference Manual(IMX6SDLRM Rev.2) page2965.

But IDMAC's ch#12 does not move (IDMAC_CH_BUSY_12 is not set).

Please tell me how to start IDMAC and IC move.

= Appendix =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I will show a brief flow of my software & environment.

SOC = iMX6 Solo
Memory = DDR3 512MByte(Cached)

1. reset IPU

    *(volatile uint32_t *)SRC_BASE   |= 0x8;
    *(volatile uint32_t *)IPU_MEM_RST = 0x807fffff;
    udelay(30000);
        /* wait until MEM_RST negate */

2. configure IDMAC (ch12, 20) & enable it.

        /*
          config CPMEM of ch12 and ch20
        */
        ... // omit because this block is so big.

        /*
          config IDMAC register
        */
        *(volatile uint32_t *)IPU_IDMAC_CH_EN1 = ((1 << 12) | (1 << 20));


3. configure IC(Encode Task) & enable it.

        /*
           config TPMEM for CSC(ColorSpace Conversion)
        */
        ... // omit because this block is so big.

        /*
           config IC registers
        */
        *(volatile uint32_t *)IPU_IC_PRP_VF_RSC = 0x20002000;
                                                                // No Downsizing
        *(volatile uint32_t *)IPU_IC_IDMAC1 &= ~(1 << 0);       // burst size of CB1 = 8
        *(volatile uint32_t *)IPU_IC_IDMAC1 &= ~(1 << 20);      // no Flip
        *(volatile uint32_t *)IPU_IC_IDMAC2 = (480-1);          // set Height = 480
        *(volatile uint32_t *)IPU_IC_IDMAC3 = (720-1);          // set Width  = 720

        *(volatile uint32_t *)IPU_IC_CONF   = 0x40000003;       // enable RWE, CSC, Encode


4. copy YUV422 image into Memory (address is identical with IDMAC ch#12)
   and flush it to DRAM.
        ...

5. set ready flag of DMA buffer
   I dont't know this configuration is required or not to move.

        *(volatile uint32_t *)IPU_CH_BUF0_RDY0 |= (1 << 12);

6. Finaly, set IPU enable.

        *(volatile uint32_t *)IPU_CONF = 0x4;                   // enable IC


=> result is described before.

Best Regards,

Koichi Sakagami

Labels (1)
0 Kudos
1 Reply

506 Views
jimmychan
NXP TechSupport
NXP TechSupport

G2D API can do this. chapter 2.4.1 Color space conversion from YUV to RGB

0 Kudos