August 16, 2011

samus8zero2x samus8zero2x
Lab Rat
6 posts

Graphics Performance

 

We’re using Qt Embedded (QWS) 4.7.3 with OpenGL ES on a TI processor with integrated SGX accelerator. It seems needed options (such as powervr, opengl es2, neon, openvg, etc.) are being configured and installed properly and we are able to run Open GL apps fine.

However, it seems the GUI itself is unreasonably slow, assuming that Qt is actually leveraging any of the above mentioned support modules. I will give two examples:
1 – Animating the opening of an on-screen keyboard is extremely chop (you get maybe 3 frames per second)
2 – Alpha blending is very sluggish

So, I’m guessing when neon, openvg, opengl, etc. are enabled Qt is still doing everything it normally does? Do you have to explicitly setup your application to make use of each of these options?

5 replies

August 16, 2011

VitorAMJ VitorAMJ
Lab Rat
89 posts

Hi there, I am not sure about embedded platform, however what I know is that to make Qt 4.7.3 work with opengl or openvg graphicssystems you must set it into the Qt build, during the configure procedure (then make, make install).
Otherwise it will be raster. You can set it by doing:
configure “other config stuff bla bla” -graphicssystem opengl
or
configure “other config stuff bla bla” -graphicssystem openvg

This means you have to rebuild Qt. Also, as the configure —help shows, these features are experimental… from what I know, it does not work well on some desktop platforms yet, not sure about yours… unfortunately.

Regards,

August 16, 2011

samus8zero2x samus8zero2x
Lab Rat
6 posts

When I tried to add the -graphicssystem switch I get the following:

  1. Error: Graphics System plugins are not supported on QWS.
  2.    On QWS, the graphics system API is part of the QScreen plugin architecture
  3.    rather than existing as a separate plugin.

This points to what I was previously assuming: using the powervr plugin uses the opengl system for “painting.”

FYI, here is my configure command:

  1. ./configure
  2.   -prefix [path/to/target]/qt-embedded -embedded arm
  3.   -platform qws/linux-x86-g++ -xplatform qws/linux-TIarmv7-g++
  4.   -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2
  5.   -no-glib -no-cups -no-largefile -no-accessibility -no-openssl
  6.   -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput
  7.   -qt-mouse-tslib -plugin-mouse-linuxtp -plugin-mouse-pc -fast
  8.   -opengl es2 -openvg -qt-gfx-transformed -qt-gfx-vnc
  9.   -qt-gfx-linuxfb -qt-gfx-multiscreen -plugin-gfx-powervr
  10.   -D QT_NO_QWS_CURSOR -D QT_QWS_CLIENTBLIT
  11.   -nomake examples -nomake demos -nomake docs -nomake translations

And here is the relevant resulting output from configure:

  1. Debug .................. no
  2. Qt 3 compatibility ..... yes
  3. QtDBus module .......... no
  4. QtConcurrent code ...... yes
  5. QtGui module ........... yes
  6. QtScript module ........ yes
  7. QtScriptTools module ... yes
  8. QtXmlPatterns module ... no
  9. Phonon module .......... no
  10. Multimedia module ...... auto
  11. SVG module ............. yes
  12. WebKit module .......... yes
  13. JavaScriptCore JIT ..... To be decided by JavaScriptCore
  14. Declarative module ..... yes
  15. Declarative debugging ...yes
  16. Support for S60 ........ no
  17. Symbian DEF files ...... no
  18. STL support ............ yes
  19. PCH support ............ yes
  20. MMX/3DNOW/SSE/SSE2/SSE3. no/no/no/no/no
  21. SSSE3/SSE4.1/SSE4.2..... no/no/no
  22. AVX..................... no
  23. iWMMXt support ......... no
  24. NEON support ........... yes
  25. IPv6 support ........... yes
  26. IPv6 ifname support .... yes
  27. getaddrinfo support .... yes
  28. getifaddrs support ..... yes
  29. Accessibility .......... no
  30. NIS support ............ yes
  31. CUPS support ........... no
  32. Iconv support .......... no
  33. Glib support ........... no
  34. GStreamer support ...... no
  35. PulseAudio support ..... no
  36. Large File support ..... no
  37. GIF support ............ plugin
  38. TIFF support ........... plugin (qt)
  39. JPEG support ........... plugin (qt)
  40. PNG support ............ yes (qt)
  41. MNG support ............ plugin (qt)
  42. zlib support ........... yes
  43. Session management ..... no
  44. Embedded support ....... arm
  45. Freetype2 support ...... auto (yes)
  46. Graphics (qt) .......... linuxfb multiscreen transformed vnc linuxfb multiscreen
  47. Graphics (plugin) ...... powervr
  48. Decorations (qt) ....... styled windows default
  49. Decorations (plugin) ...
  50. Keyboard driver (qt) ... tty
  51. Keyboard driver (plugin) ..
  52. Mouse driver (qt) ...... linuxinput tslib
  53. Mouse driver (plugin) .. linuxtp pc
  54. OpenGL support ......... yes (OpenGL ES 2.x)
  55. EGL support ............ yes <EGL/egl.h>
  56. OpenVG support ......... yes
  57. SQLite support ......... plugin (qt)
  58. OpenSSL support ........ no
  59. Alsa support ........... no
  60. ICD support ............ no

I also define this on the target system:

  1. export QWS_DISPLAY="powervr"

I suppose I could ask my question in a different way: What is meant when the Qt docs say that a widget is “painted” with OpenGL? Is it painted internally as a bitmap/pixel buffer and then just copied to an OpenGL context?

August 16, 2011

VitorAMJ VitorAMJ
Lab Rat
89 posts

samus8zero2x wrote:
Error: Graphics System plugins are not supported on QWS. On QWS, the graphics system API is part of the QScreen plugin architecture rather than existing as a separate plugin.

Hey man, that’s just bad news…

Regarding your question, to me it seems that Qt paints the window using a raster process by default. I could not find the OpenGL being the base widget painting in the documentation, but if it is there, I believe its wrong and has to be corrected. Qt support for OpenGL means that you can subclass QGLWidget (framebuffer, shaders, and all the benefits), but for that class only and not the window painting system as a whole. I am not a SVG user also, but I’ve googled it and saw that you can use a QGraphicsSvgItem to display Scalable Vector Graphics drawings as items in the scene.

For the OpenGL QGLWidget subclass, there is no raster procedure involved. Again not sure about SVG, but it also sounds false.

I hope this helps,
VitorAMJ

August 16, 2011

samus8zero2x samus8zero2x
Lab Rat
6 posts

OK, the point is that I’m trying to animate core Qt widgets. Anything I can do manually in GL is kind of on the side.

Let’s say I have a scenario like this:
MainWindow
—VerticalLayout
——QScrollArea
———Screen Content
——MyKeyboardWidget
———QPushButtons

I then animate the opening of the keyboard by changing the keyboard’s height property using a QTimeLine event. Because of the vertical layout, this causes the scroll area height to be reduced as more of the keyboard is displayed. But in this case I have poor graphics update performance.

If I have an alpha blended overlay or watermark over the whole MainWindow, I get significantly worse performance. I’ve also tried the similar in a QGraphicsView with and without inheriting QGLWidget with similar results.

Can you guys think of a way to speed this up? Perhaps I need to try some trickery with off-screen drawing?

August 17, 2011

VitorAMJ VitorAMJ
Lab Rat
89 posts

Hey samus8zero2x,

EDIT: I am sorry if I made you think that, my bad, but QGLWIdget is only for GL content, it does not help to subclass the widgets you are trying to use.

I am probably not the best code optimizer, but I know some sources to recommend to you:
I found this link [slideshare.net] about some Qt optimizations.
There is also some videos [developer.qt.nokia.com] in the elearning main qtdev page.
I saw somethings that might handy:”
Optimizing Performance in Qt-Based Applications [developer.qt.nokia.com]
Performance: Do Graphics the Right Way [developer.qt.nokia.com]
Qt Tips and Tricks [developer.qt.nokia.com]
Accelerating Performance of Qt on TI’s Embedded Processors [developer.qt.nokia.com]

Please let me know if you find something useful.
Very best regards,
VitorAMJ

 
  ‹‹ [solved] Qt on Android (Necessitas) - working in simulator - how to get it on my phone?      [solved] screen scrolling ››

You must log in to post a reply. Not a member yet? Register here!