How to rotate fb0 with 90 degree on imx6 platform

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

How to rotate fb0 with 90 degree on imx6 platform

2,480 Views
shanchong234
Contributor III

The lcd we are going to use is simular with the lcd on mobile phones,

Our device need rotate 90 or 270 degree to display

My problem is simular with i.MX6 IPU and rotating a frame buffer

i don't know  how to do with it,i tried many times ,just can't solved it.

Any adviece or  example code will help

CHIP: IMX6Q

BSP:  L3.0.35-4.1.0

0 Kudos
5 Replies

860 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

You can find examples of the IPU here:

rogeriorps/ipu-examples · GitHub

I believe that can help. Just notice that rotation is limited to 1024x1024 resolution.

Best Regards,

Alejandro

0 Kudos

860 Views
shanchong234
Contributor III

Thanks aleiandrolozano,

I have read this code before, and is not work for me.

my project need rotate the framebuffer automatical and continued to display.

the rotation example in rogeriorps/ipu-examples · GitHub  is manually rotate a picture to display only once , and i don't know how

to do the change to fit my project.

0 Kudos

860 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

The code rotates the image every 2 seconds:

for (i=1; i < 8 ; i++) {
   t->output.rotate = i;

   gettimeofday(&begin, NULL);

   ret = ioctl(fd_ipu, IPU_QUEUE_TASK, t);
   if (ret < 0) {
   printf("ioct IPU_QUEUE_TASK fail\n");
   goto done;
   }

   gettimeofday(&end, NULL);
   sec = end.tv_sec - begin.tv_sec;
   usec = end.tv_usec - begin.tv_usec;
   if (usec < 0) {
   sec--;
   usec = usec + 1000000;
   }
   run_time = (sec * 1000000) + usec;

         printf("Rotation time: %d usecs\n", run_time);

   sleep(2); // Show each image for 2 seconds

    }

Is not that a similar behavior you need?

/Alejandro

0 Kudos

860 Views
shanchong234
Contributor III

I mean ,once the frambuffer has been changed, the ipu will rotate it immediately and display on lcd  with no delay.

0 Kudos

860 Views
kennyzhang
Contributor I

Hi Chen,

     so it was  already fixed?

     I suppose also want to know how to enable the rotate for each frame instead to set the task each time.

Thanks!

Kenny

0 Kudos