framebuffer in YUV420 mode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

framebuffer in YUV420 mode

跳至解决方案
3,228 次查看
tselmeci
Contributor IV

Hello all!

VPU decodes H264 frames in YUV420 planar format, and I was just wondering why shall IPU convert it to RGB565 if it's possible to set the framebuffer in YUV420 mode? Then the decoded bytes need only to be copied into the framebuffer (roughly).

Is it possible to set the framebuffer format to YUV420? I'm using SII902x HDMI converter and this kernel parameter now:

video=mxcdi0fb:RGB24,1920x1080M@60 hdmi di0_primary

All my attempts were failed to set to YUV420.

标签 (3)
标记 (3)
0 项奖励
回复
1 解答
1,954 次查看
tselmeci
Contributor IV

Meanwhile I've figured it out how to set the framebuffer in YUV420P mode. It really can't be done from kernel command line, instead one has to use framebuffer IOCTLs.

By the way, YUV420 --> RGB conversion done by IPU in case on HD resolution on iMX53 causes a significant overhead, so I'm searching for a better solution.

if (ioctl(mstate.fb_handle, FBIOGET_VSCREENINFO, &(mstate.fb_vsi)) < 0)

  return -1;

mstate.fb_vsi.xres = DISPLAY_RES_X;

mstate.fb_vsi.yres = DISPLAY_RES_Y;

mstate.fb_vsi.xres_virtual = DISPLAY_RES_X;

mstate.fb_vsi.yres_virtual = DISPLAY_RES_Y * 3;

mstate.fb_vsi.activate |= FB_ACTIVATE_FORCE;

mstate.fb_vsi.nonstd = IPU_PIX_FMT_YUV420P;

mstate.fb_vsi.bits_per_pixel = 12;

if (ioctl(mstate.fb_handle, FBIOPUT_VSCREENINFO, &(mstate.fb_vsi)) < 0)

     return -1;

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,954 次查看
b36401
NXP Employee
NXP Employee

Unfortunately it can not be managed with simple setting the option in u-boot. However you can configure IPU of i.MX53 manually. Please refer Chapter 45 of i.MX53 Multimedia Applications Processor Reference Manual.

However please note that the overhead related to RGB<->YUV conversion may be not significant and can be disregarded

0 项奖励
回复
1,955 次查看
tselmeci
Contributor IV

Meanwhile I've figured it out how to set the framebuffer in YUV420P mode. It really can't be done from kernel command line, instead one has to use framebuffer IOCTLs.

By the way, YUV420 --> RGB conversion done by IPU in case on HD resolution on iMX53 causes a significant overhead, so I'm searching for a better solution.

if (ioctl(mstate.fb_handle, FBIOGET_VSCREENINFO, &(mstate.fb_vsi)) < 0)

  return -1;

mstate.fb_vsi.xres = DISPLAY_RES_X;

mstate.fb_vsi.yres = DISPLAY_RES_Y;

mstate.fb_vsi.xres_virtual = DISPLAY_RES_X;

mstate.fb_vsi.yres_virtual = DISPLAY_RES_Y * 3;

mstate.fb_vsi.activate |= FB_ACTIVATE_FORCE;

mstate.fb_vsi.nonstd = IPU_PIX_FMT_YUV420P;

mstate.fb_vsi.bits_per_pixel = 12;

if (ioctl(mstate.fb_handle, FBIOPUT_VSCREENINFO, &(mstate.fb_vsi)) < 0)

     return -1;

0 项奖励
回复