Hi All and thank you for reading this.

I have a MainWindow with three widgets (QWidget, QDialog and QOpenGLWidget). The QWidget is a navigation bar at the bottom and the QDiaglog is for user input to later serial communitcation. Neither of these are doing anyting right now as it is the early stags of the project. I setup the structure and visual elements with no event handling for now. My main focus is the QOpenGLWidget as this is the view of one of many future cameras. I put in a frame counter in the paintGL () that once it hits 30 frames, give me a duration. Every 30 frames takes roughly 21 seconds. This is very unacceptable.

As background, I have setup the default format as such in main...

Qt Code:
  1. QSurfaceFormat format;
  2. format.setProfile ( QSurfaceFormat::CoreProfile );
  3. format.setRenderableType ( QSurfaceFormat::OpenGLES );
  4. format.setSwapBehavior ( QSurfaceFormat::TripleBuffer );
  5. format.setSwapInterval ( 0 ); // 0 = draw to vsync
  6. format.setVersion ( 3, 0 ); // imx6 vivante revision 5.0.11
  7. // must be called before the widget
  8. // or its parent window gets shown
  9. QSurfaceFormat::setDefaultFormat ( format );
To copy to clipboard, switch view to plain text mode 

I then setup my subclassed mainwindow through my own initialization function to propagate the items before show(). At the end of this, all items at created and initialized. They have their geomotry, everything is connected and we're ready to to be shown. show() then starts the visual loops and off we go. In the QOpenGLWidget, as standard, I follow the standard three overrides. Here is the top of my class in question...

Qt Code:
  1. class AVC8000nano : public QOpenGLWidget, protected QOpenGLFunctions
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. explicit AVC8000nano ( QWidget *parent = 0 );
  7. ~AVC8000nano ( void );
  8.  
  9. APP_STATUS Initialize ( WhichSetup* structWhichSetup );
  10. void DoWork ( WORKTODO myTask );
  11. bool SetCameraToViewPort ( const WHICH_CAMERA eCamera );
  12.  
  13. protected:
  14. void initializeGL () Q_DECL_OVERRIDE;
  15. void paintGL () Q_DECL_OVERRIDE;
  16. void resizeGL ( int width, int height );
  17. QOpenGLExtraFunctions* m_OGLES3Functions;
  18. ...
To copy to clipboard, switch view to plain text mode 

Inside of paintGL(), I do very little...

Qt Code:
  1. void AVC8000nano::paintGL ()
  2. {
  3. if ( ( m_bAreWeExitting ) ||
  4. ( !m_bInitialized ) )
  5. {
  6. return;
  7. }
  8.  
  9. QOpenGLContext *oglContext = context ();
  10. if ( !oglContext ) // QOpenGLWidget not yet initialized
  11. {
  12. return;
  13. }
  14.  
  15. //GLenum enumError;
  16.  
  17. m_qimage2Paint = m_helperAVC8KV4L2->GrabImage ();
  18. if ( m_qimage2Paint != NULL )
  19. {
  20. QPainter qPainter ( this );
  21. qPainter.translate ( m_nDeltaX / 2, m_nDeltaY / 2 );
  22. qPainter.drawImage ( m_rectImage, *m_qimage2Paint );
  23.  
  24. // if ( ( enumError = m_OGLES3Functions->glGetError () ) != GL_NO_ERROR )
  25. // {
  26. // qDebug ( "OpenGL error: %d.", enumError );
  27. // }
  28. }
  29.  
  30.  
  31. #ifdef DEBUG_LIVE_TIMING
  32. m_nFrameGrabbed++;
  33. if ( m_nFrameGrabbed == 30 )
  34. {
  35. gettimeofday ( &m_tv_now, NULL );
  36. m_tk_Diff = TV_SECONDS ( m_tv_now, m_tv_begin );
  37. qDebug ( "30 frames took %lld seconds", m_tk_Diff, m_nFrameGrabbed );
  38. m_nFrameGrabbed = 0;
  39. gettimeofday ( &m_tv_begin, NULL );
  40. }
  41. #endif
  42.  
  43. delete m_qimage2Paint;
  44.  
  45. // Schedule composition. Note that this will use QueuedConnection, meaning
  46. // that update() will be invoked on the gui thread.
  47. QMetaObject::invokeMethod ( this, "update");
  48. //update ( m_rectWidget );
  49. }
To copy to clipboard, switch view to plain text mode 

I have placed inside of my /etc/appcontroller.conf file as well as my /etc/profile (appropriately edited) these lines...

Qt Code:
  1. env=QT_QPA_PLATFORM=eglfs
  2. env=QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/plugins/platforms
  3. env=QT_QPA_EGLFS_WIDTH=1920
  4. env=QT_QPA_EGLFS_HEIGHT=1080
  5. env=QT_QPA_EGLFS_PHYSICAL_WIDTH=1920
  6. env=QT_QPA_EGLFS_PHYSICAL_HEIGHT=1080
  7. env=QT_QPA_EGLFS_SWAPINTERVAL=0
To copy to clipboard, switch view to plain text mode 

My main point here is the SWAPINTERVAL matching the applications format.setSwapInterval above. I have tested setting these values to 34, 17, 1 and 0. None of these effect the 30 frames in 21 seconds measurement.

For uboot, I set the video args as such for the kernel. Changing the @60 to @30 again makes no diff.

vidargs=acpi=force mxc_hdmi.only_cea=1 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb1ff video=mxcfb2ff video=mxcfb3ff fbmem=32M

So here I am now not sure where to look. Does anyone have any ideas as to where to look next? Thank you for your time.

Cheers,
Pete