1
  1. How can I build Qt for X11 with OpenGL support? I have Hardware acceleration on my device(GPU), but when I config the qt(qml) application to work with opengl I can’t see any improvment with the performance… it become more slower performance.

I use the command: QApplication::setGraphicsSystem("opengl");

I use Qt lighthouse(not qt embedded-linux).

  1. How can I ensure that the Qt is really use the gpu acceleration to paint qt/qml widgets on the screen?
user1335880
  • 81
  • 2
  • 8

1 Answers1

1

Make sure Qt gets linked dynamically against /usr/lib[64]/libGL.so (or just libGL.so in the library path). Linkage against any other libGL.so, static linkage, or maybe even libMesaGL.{so, a} means, you'll very likely get a software rasterizer implementation of OpenGL into your program, not using the HW acceleration on your system. Also make sure your system actually supports HW accelerated OpenGL.

If running glxinfo | grep renderer reports you some software rasterizer, you're not HW accelerated. Note that being direct vs indirect has nothing to say about HW acceleration, depite that being stated sometimes. Indirect just means that OpenGL commands are encapsulated into X11 requests and sent over the X11 server instead of being delivered directly to the OpenGL implementation, bypassing the server.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • The Qt Application linked to the openGL libraries. The output of compile include the lines: -lgsl -lgsl-fsl -lEGL -lGLESv2 -lEGL -lGLESv2 -lgsl -lEGL -lGLESv2 -lgsl -lQtOpenGL .... so I guess the linkage is OK. – user1335880 Aug 06 '12 at 07:38
  • You're linking OpenGL-ES. This doesn't make sense if used with X11. Your linkage string should be `-lGL -lQtOpenGL` but contain none of the EGL or ES libraries, because those are usually pulling in a SW rasterizer. – datenwolf Aug 06 '12 at 07:56
  • The application run on embedded system , this is the reason why the linkage is to EGL... – user1335880 Aug 06 '12 at 09:56
  • @user1335880: Well, in the case of a embedded system you likely can't use X11 and OpenGL-ES together. Either don't use X11 and do everything through EGL or use X11 and have no OpenGL. Note that this is mostly a lack of driver support not a limitation of X11. In case the HW actually does support OpenGL-ES + X11 you will probably get several roundtrips for the data to show up on the X11 server, which would explain the poor performance in that case. – datenwolf Aug 06 '12 at 19:36