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.
Solved! Go to Solution.
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;
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
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;