Hi All,
I am using imx6q Rev D sabrelite board. Using the Linux kernel version 3.0.35. The board is connected with 3 LCD 4.2", 7.1" and 12.3". On boot up, i am able to rotate the logo to 180 degree using command, "echo 1 > /sys/class/graphics/fb0/rotate" but not able to rotate the logo 90 degree or 270 degree. Please provide your suggestions on how rotation of 90 degree or 270 degree can be accomplished using fb0 rotate.
已解决! 转到解答。
Hi,
following code can be useful
//set rotate using IDMA
memset(&rot_info, 0x00, sizeof(ipu_rot_info_t));
rot_info.width_in = panel->height;
rot_info.height_in = panel->width;
rot_info.width_out = panel->width;
rot_info.height_out = panel->height;
rot_info.strideline_in = rot_info.width_in;
rot_info.strideline_out = rot_info.width_out;
rot_info.pixel_format_in = NON_INTERLEAVED_YUV422; //INTERLEAVED_RGB565;
rot_info.pixel_format_out = NON_INTERLEAVED_YUV422; //INTERLEAVED_RGB565;
rot_info.rot = 1;
rot_info.hf = 0;
rot_info.vf = 0;
rot_info.addr0_in = res_out_mem;
rot_info.addr0_out = rot_out_mem;
rot_info.ubo_in = 0xc0000;
rot_info.ubo_out = 0xc0000;
ipu_rotate_idmac_config(ipu_index, rot_chnl_in, rot_chnl_out, rot_info);
Thanks,
Saurabh
Hello everyone,
Although gst-inspect reports that imxvideosrc supports rotation, in our testing only vertical mirroring works (rotate=2).
It seems that the rotation functionality has not been carried over from the imx51 line.
A workaround is to perform the rotation using the the imxvideosink element, where rotation is given in degrees (90,180, etc).
The output device can be specified using the option "device=" (/dev/video16, /dev/video17, etc).
To get horizontal mirroring, we use rotate=3 to get vertical mirroring in imxvideosrc, and then use rotate=180 in the imxvideosink.
I hope this is useful for someone!
Hi,
I believe /sys/class/graphics/fb0/rotate will do vertical flip when passing 1 to it. Below the rotation enum of the IPU driver.
IPU_ROTATE_NONE = 0, | |
IPU_ROTATE_VERT_FLIP = 1, | |
IPU_ROTATE_HORIZ_FLIP = 2, | |
IPU_ROTATE_180 = 3, | |
IPU_ROTATE_90_RIGHT = 4, | |
IPU_ROTATE_90_RIGHT_VFLIP = 5, | |
IPU_ROTATE_90_RIGHT_HFLIP = 6, | |
IPU_ROTATE_90_LEFT = 7, |
You could try to modify the fb driver to get another rotation. The driver is in <linux>/drivers/video/mxc/mxc_ipuv3_fb,c.
For a concrete example on how to use the IPU for rotation please check the mxc_ipudev_test in the imx-test package.
BTW. IPU rotation uses the IRT and it's slow 100Mp/sec. For faster rotation use GPU GC320.
Michel
There are two lines of code in the /driver/video/mxc/mxc_ipuv3_fb.c
If (var->rotate > IPU_ROTATE_VERT_FLIP)
var->rotate = IPU_ROTATE_NONE
I think it's the reason why I get the result which is mentioned above, so I comment those lines out and rebuild the kernel image.
After that I re-check the rotation function by doing "echo 4 > /sys/class/graphics/fb0/rotate", but things does not work out as i think,
there is an error occur and the error message shows "imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00080000"
Could you help me out, please?
Comment out two lines of code in the /driver/video/mxc/mxc_ipuv3_fb.c
//If (var->rotate > IPU_ROTATE_VERT_FLIP)
//var->rotate = IPU_ROTATE_NONE
and after rebuilding I got results below:
echo 0 > /sys/class/graphics/fb0/rotate => No Rotation
echo 1 > /sys/class/graphics/fb0/rotate => Vertical Flip
echo 2 > /sys/class/graphics/fb0/rotate => No Rotation
echo 3 > /sys/class/graphics/fb0/rotate => Vertical Flip
echo 4 > /sys/class/graphics/fb0/rotate => Error Message : imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00080000
echo 5 > /sys/class/graphics/fb0/rotate => Error Message : imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00080000
echo 6 > /sys/class/graphics/fb0/rotate => Error Message : imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00080000
echo 7 > /sys/class/graphics/fb0/rotate => Error Message : imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00080000
The BSP version I use is L3.0.35.12.09.01, is there any idea about this?
Thank you for your reply, could you tell me more detail about how to do that? What does IC of IPU mean?
If I want to rotate the penguin logo in 90 degrees, what should I do?
Is that a direct rotation of framebuffer?
Hi,
following code can be useful
//set rotate using IDMA
memset(&rot_info, 0x00, sizeof(ipu_rot_info_t));
rot_info.width_in = panel->height;
rot_info.height_in = panel->width;
rot_info.width_out = panel->width;
rot_info.height_out = panel->height;
rot_info.strideline_in = rot_info.width_in;
rot_info.strideline_out = rot_info.width_out;
rot_info.pixel_format_in = NON_INTERLEAVED_YUV422; //INTERLEAVED_RGB565;
rot_info.pixel_format_out = NON_INTERLEAVED_YUV422; //INTERLEAVED_RGB565;
rot_info.rot = 1;
rot_info.hf = 0;
rot_info.vf = 0;
rot_info.addr0_in = res_out_mem;
rot_info.addr0_out = rot_out_mem;
rot_info.ubo_in = 0xc0000;
rot_info.ubo_out = 0xc0000;
ipu_rotate_idmac_config(ipu_index, rot_chnl_in, rot_chnl_out, rot_info);
Thanks,
Saurabh
Hi
Vladislav
Please Check IPU example.
https://community.freescale.com/docs/DOC-94961
https://github.com/rogeriorps/ipu-examples/blob/master/mx6/rotation/example1/rot_ex1.c
Thanks
Saurabh
After re-check the /sys/class/graphics/fb0/rotate and according to the image presentation , I think it's more like mirroring, not a rotation, and to each 1 > /sys/class/graphics/fb0/rotate is considered the mirror property equals true, other numbers considered false