IPU DC mapping for YUYV

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

IPU DC mapping for YUYV

1,160 Views
jotes
Contributor IV

Hello!

We have a display device connected to port IPU1 DI0 which needs YUYV data as an input (LUMA on pins 19-12, CHROMA on pins 9-2). What I am trying to do is to set mapping scheme (like the one in Figure 37-33 of RM) and change the microcode. To do so, I need to know how Y, U, V components are located on the input of the Bus Mapping Unit. We know that for YUV444 we have Y on 23-16, U on 15-8, V on 7-0.

My question is: where exactly (I mean: which bits?) are located Y, U and V components for YUYV pixel format? Is it YUY (1st cycle) -> VYU (2nd cycle) -> YVY (3th cycle), and so on?

As for now, I am only able to set interface_pix_fmt for my display as IPU_PIX_FMT_YUV444 and set mapping to send YU (V is omitted) in the first cycle, and YV (U is omitted) in the second cycle. Is there any way to do so by using IPU_PIX_FMT_YUYV format?

Can someone help me? I've run out of ideas...

Thanks!

Labels (4)
Tags (3)
0 Kudos
5 Replies

566 Views
fabio_estevam
NXP Employee
NXP Employee

In the kernel we have the following mapping for Y

/* IPU_PIX_FMT_YUYV 16bit width */
_ipu_dc_map_clear(ipu, 9);
_ipu_dc_map_link(ipu, 9, 5, 2, 5, 1, 5, 0);
_ipu_dc_map_clear(ipu, 10);
_ipu_dc_map_link(ipu, 10, 5, 1, 5, 2, 5, 0);

Please check _ipu_init_dc_mappings() at:

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/drivers/mxc/ipu3/ipu_disp.c?h=imx_3...

Regards,

Fabio Estevam

0 Kudos

566 Views
jotes
Contributor IV

Are you sure this mapping is working? Did you test it?

I've already checked this mapping on my board. As I understand, it assumes that we have 24 bits on input bus and we map it in two cycles:

cycle 1: byte 0 -> bit 15, byte 2 -> bit 7

cycle 2: byte 1 -> bit 15, byte 2 -> bit 7

Since it is YUYV, I guess we have U on byte 0, V on byte 1 and Y on byte 2. Am I correct?

Nevertheless, using this mapping on my board results in wrong colors.

0 Kudos

566 Views
fabio_estevam
NXP Employee
NXP Employee

I haven't tested it. I only inspected the code.

Regards,

Fabio Estevam

0 Kudos

566 Views
jotes
Contributor IV

Thanks, but I have also inspected the code so many times, and it is still unclear for me.

Maybe you will know, what actually I have to do, to change pixel format of input datas for display to YUYV (or UYVY)? I am using L3.0.35_4.1.0_130816_source. The only thing I have changed is interface_pix_fmt in sabresd_fb_data structure:

            .disp_dev = "lcd",

            .interface_pix_fmt = IPU_PIX_FMT_YUYV,

            .mode_str = "LCD-HD",

            .default_bpp = 24,

            .int_clk = false,

            .late_init = false,

Maybe it is not enough? But it is working for YUV444, so I suspect that mapping rules do not match the order of bits on input bus for Display Controller.

0 Kudos

566 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Jotes, you can apply the patch in https://community.freescale.com/docs/DOC-100657

If your panel needs UYVY formar data, that patch can support it, it was verified on some other customer's UYVY16 interface display, the video mode is as followed, the frame buffer is still in RGB format, when output to display, the IPU DP will convert RGB frame buffer to UYVY data format:

Output 1080i50 display mode on LCD interface:

      "video=mxcfb0:dev=lcd,LCD-1080I50,if=UYVY,bpp=32"


0 Kudos