IMX6 FrameBuffer reading takes 1.8 seconds while reading 1080*1920 Pixel image from GPU to CPU

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

IMX6 FrameBuffer reading takes 1.8 seconds while reading 1080*1920 Pixel image from GPU to CPU

1,306 Views
ashifta
Contributor I

I am trying to capture rendered image( developed in Qt's QML qquickrendercontrol example)  using framebuffer with OpenGL API "glReadPixels"  but it takes 1.8 seconds to read the pixel data. which is not acceptable, since i need the image capture at least 100ms.  I have binded the OpenGL using texture ID. I have no issue while rendering, it so fast. While I am running same application in PC(Core i5 ) it takes 11 to 15ms to capture the same image. But when it comes to IMX6 capturing takes 1.8 seconds.

I have used following API's but  all it takes 1.8 seconds

1. Using direct openGL API glReadPixels 

2. QOpenGLFramebufferObject:: toImage()

3. grabToImage() API of QML Item.

or

Is there any other workaround to capture the framebuffer without blocking the rendering thread?

Labels (3)
0 Kudos
1 Reply

816 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Ashif,

It is not clear if the issue is on GPU side or CPU side, please add vprofiler to your code in order to check if glReadPixels is causing this delay. also The sample code in GPU SDK shows how to directly upload a texture (instead of using glTexImage2D).  this could be use to also download the texture faster than glReadPixels, Or the  better way to do that is using virtual framebuffers, please check the virtual buffer driver:

GitHub - Freescale/linux-module-virtfb: Virtual frame buffer driver for iMX devices 

Regards