How set mx6q_sabresd output the display data to YUV format

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

How set mx6q_sabresd output the display data to YUV format

4,133 Views
kaisun1
Contributor III

HI:

     I have modefiy code.


1 . on the Kernel mxc_lcdif.c data structure inside lcdif_modedb of adding the Video Mode

{

               /* 1920x1080 @ 60 Hz , pixel clk @ 148.5MHz */

               "LCD-1080P", 60, 1920, 1080, 6734, 148, 88, 36, 4, 44, 5,

               FB_SYNC_DATA_INVERT,

               FB_VMODE_NONINTERLACED,

               0,},

                2 .  delete  #define BT656_IF_DI_MSB 23

                 3 . setenv bootargs_mmc 'setenv bootargs ${bootargs} root=/dev/mmcblk1p1 rootwait rw ip=none video=mxcfb0:dev=lcd,LCD-1080P,if=YUYV16,fbpix=RGB565'




        i hope have a YUV4:2:2  output on the Parallel port.

 

     but i  measured by the oscilloscope:

                                     pclk = 27Mhz,vsync=57.6Hz, hsync=29.3Khz.

Original Attachment has been moved to: log.txt.zip

0 Kudos
21 Replies

1,565 Views
kaisun1
Contributor III

HI li ,

        add your changes,can you test your board pclk?

0 Kudos

1,565 Views
kaisun1
Contributor III

HI li,

        i find the reason why the pclk is not work . This is the problem of I leads to. I would like to thank you these days to help!

          and now beacuse my kernel code ( int  fb_find_mode () )always renturn 3. kernel code always do the default_mode = &db[0].what  can  i do to  support 720P、1080P at the same time

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

To support more video modes in same time, you can modify the code in function lcdif_init():

From

      for (i = 0; i < modedb_sz; i++) {

       struct fb_videomode m;

       fb_var_to_videomode(&m, &setting->fbi->var);

       if (fb_mode_is_equal(&m, &modedb[i])) {

        fb_add_videomode(&modedb[i],

          &setting->fbi->modelist);

        break;

       }

      }

To

      for (i = 0; i < modedb_sz; i++) {

       fb_add_videomode(&modedb[i],

         &setting->fbi->modelist);

      }


In command mode line, you can run "# cat /sys/class/graphics/fb0/modes" to list all supported modes, you can find mode such as "U:1920x1080p-60", then you can use command "# echo U:1920x1080p-60 > /sys/class/graphics/fb0/mode" to switch the mode on the fly.

In Android, the display resolution can be changed from Setting -> Display -> Advanced.

0 Kudos

1,565 Views
kaisun1
Contributor III

Hi li,

       thanks your for your help . I think that the problem about the  progressive Display was resolved. In addition , the interlace display is not work .I thought maybe the problem is my code  . becauese of patch conflict , i only use git apply some patch , so i did not use all the patch.all the  Patch is necessary to git apply ?


Regards,

kai

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

You can apply all patches, if you don't set dev:bt656, the BT1120 and BT656 code will not be actived.

For interlaced mode, you need modify the "FB_VMODE_NONINTERLACED" to "FB_VMODE_INTERLACED" in Video Mode.

0 Kudos

1,565 Views
kaisun1
Contributor III

HI li:

      that is my change:

static struct fb_videomode lcdif_modedb[] = {

  {

  /* 1920*1080 @60Hz, pixel clk  @74.25MHz */

  "LCD-1080i", 60, 1920, 1080, 13763, 148, 88, 15, 2, 44, 5,

  FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

  FB_VMODE_INTERLACED,

  },

  {

  /* 720*576i  @50Hz,poxel clk @13.5Mhz*/

  "LCD-576i", 50, 720, 576, 74074, 64, 16, 39, 5, 64, 5, 0,

  FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

  FB_VMODE_INTERLACED,

  },

  {

  /* 1280x720 @50Hz, pixel clk @74.25Mhz*/

  "LCD-720p", 50, 1280, 720, 13468, 220, 440, 20, 5, 40, 5,

  FB_SYNC_CLK_LAT_FALL,

  FB_VMODE_NONINTERLACED,

  },

};

change  /myandroid/device/fsl/common/display/display_mode_fb0.confg

like this: U:1920x1080p-60

             U:1280x720p-60    

             U:1920x1080i-50

             D:720x576i-50

U:1280x720p-50

D:720x576d-50

U:1920x1080i-60

but when a cat /sys/class/graphics/fb0/modes :

like this:

0 Kudos

1,565 Views
kaisun1
Contributor III

U:1280x720p-50

D:720x576d-50

U:1920x1080i-60

where is the 720x576d from?

when i do the operations  (echo "D:720x576d-50" > mode). then the pix clock is error  like this :

scope_0.bmp

I was based on the modified version 13.04. bt656 patch I deleted it.

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

You had missed a "0" in each video mode, it will be random data in your setting and it that value is not 0, "D:" will appear:

static struct fb_videomode lcdif_modedb[] = {

  {

  /* 1920*1080 @60Hz, pixel clk  @74.25MHz */

  "LCD-1080i", 60, 1920, 1080, 13763, 148, 88, 15, 2, 44, 5,

  FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

  FB_VMODE_INTERLACED,

0,

  },

  {

  /* 720*576i  @50Hz,poxel clk @13.5Mhz*/

  "LCD-576i", 50, 720, 576, 74074, 64, 16, 39, 5, 64, 5, 0,

  FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

  FB_VMODE_INTERLACED,

0,

  },

  {

  /* 1280x720 @50Hz, pixel clk @74.25Mhz*/

  "LCD-720p", 50, 1280, 720, 13468, 220, 440, 20, 5, 40, 5,

  FB_SYNC_CLK_LAT_FALL,

  FB_VMODE_NONINTERLACED,

0,

  },

};

0 Kudos

1,565 Views
kaisun1
Contributor III

Hi li:

       when a add 0 on the video mode. It is the same phenomenon then before, 576 is also is 576d.

root@android:/sys/class/graphics/fb0 #

root@android:/sys/class/graphics/fb0 # cat modes

U:1280x720p-50

D:720x576d-50

U:1920x1080i-60

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

There is a wrong "0" before "FB_SYNC_HOR_HIGH_ACT" for the 720*576 resolution, please delete it.

  {

  /* 720*576i  @50Hz,poxel clk @13.5Mhz*/

  "LCD-576i", 50, 720, 576, 74074, 64, 16, 39, 5, 64, 5, 0,

  FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

  FB_VMODE_INTERLACED,

0,

  },

should be:

{

  /* 720*576i  @50Hz,poxel clk @13.5Mhz*/

  "LCD-576i", 50, 720, 576, 74074, 64, 16, 39, 5, 64, 5,

  FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

  FB_VMODE_INTERLACED,

0,

  },

1,565 Views
kaisun1
Contributor III

HI MR li:

root@android:/sys/class/graphics/fb0 # cat modes

U:1280x720p-50

U:720x576i-50

U:1920x1080i-60

root@android:/sys/class/graphics/fb0 # echo "U:720x576i-50" > mode

root@android:/sys/class/graphics/fb0 # imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_

INT_STAT_10 = 0x00080000

this is the pixclock:

scope_0.bmp

HI li,

      Does this problem have progress?

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Since you are using Androlid, I think you also need modify the android file "myandroid/device/fsl/common/display/display_mode_fb0.conf" and added "D:1920x1080p-60" into it.

From your current log, the 800*480 timing date was set in display driver, so the pixel clock is 27MHz, you can use the followed command to check the current display mode:

# cat /sys/class/graphics/fb0/mode

0 Kudos

1,565 Views
kaisun1
Contributor III

Hi ,

         # cat /sys/class/graphics/fb0/mode. then i not foud D:1920x1080p-60.

       then i read my "myandroid/device/fsl/common/display/display_mode_fb0.conf"  .

          S:1920x1080p-60   

          U:1920x1080p-60

          S:1280x720p-60

          U:1280x720p-60

          D:1024x768p-60

     What does S\U\D mean?  if i add D:1920x1080p-60.into it ,if  i  use make bootimage commond is ok?

then i read log . and found .the code is used

  if (!fb_try_mode(var, info, default_mode, default_bpp))

       return 3;

the default_mode is &db[0].  it is

static struct fb_videomode lcdif_modedb[] = {

  {

  /* 800x480 @ 57 Hz , pixel clk @ 27MHz */

  "CLAA-WVGA", 57, 800, 480, 37037, 40, 60, 10, 10, 20, 10,

  FB_SYNC_CLK_LAT_FALL,

  FB_VMODE_NONINTERLACED,

  0,},

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For test, I think you can only keep the "LCD-1080P" and remove the other two modes in  mxc_lcdif.c.

For U/D/S, you can reference to the followed code, your LCD-1080P mode will be "U:1920x1080p-60", then you don't need change the Android code.

static int mode_string(char *buf, unsigned int offset,
         const struct fb_videomode *mode)
{
char m = 'U';
char v = 'p';

if (mode->flag & FB_MODE_IS_DETAILED)
  m = 'D';
if (mode->flag & FB_MODE_IS_VESA)
  m = 'V';
if (mode->flag & FB_MODE_IS_STANDARD)
  m = 'S';

if (mode->vmode & FB_VMODE_INTERLACED)
  v = 'i';
if (mode->vmode & FB_VMODE_DOUBLE)
  v = 'd';

return snprintf(&buf[offset], PAGE_SIZE - offset, "%c:%dx%d%c-%d\n",
                 m, mode->xres, mode->yres, v, mode->refresh);
}

1,565 Views
kaisun1
Contributor III

Log in Accessories. the kernel used default_mode( it is  1920*1080) , but i  measured by the oscilloscope:

        pclk  have not found

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

It is not reasonable, since you had already seen the 27MHz Pixel clock with 800*480 setting.

0 Kudos

1,565 Views
kaisun1
Contributor III

your can found the laster  log :  imx-ipuv3  imx-ipuv3.0 IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7). this not found on the first log .

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

This is not error message, it just shows high resolution (1920x1080) was used now.

0 Kudos

1,565 Views
kaisun1
Contributor III

i have a question , why the not return 5. do this code : fb_try_mode(var,info,&db[best],bpp);

                                                                                                return 5;

0 Kudos

1,565 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

I think you don't need care that, you should make sure "cat /sys/class/graphics/fb0/mode", "U:1920x1080p-60" is the result, that means the diplay interface is working in 1920x1080 resoltion now.

What can you see on serial debug port when running command "cat /sys/class/graphics/fb0/mode"?

0 Kudos