0

How does Qt embedded work with Linux framebuffer driver?

I think directly write to /dev/fb0 will cause image flickering. Use double buffer will solve flickering problem, but, what is the strategy of copying data from Qt buffer to framebuffer memory? by a time interval then copy whole buffer to /dev/fb0 or something else? and, for the data is huge, how is it be copied? by a DMA enabled copy_from_user or some way else?

László Papp
  • 51,870
  • 39
  • 111
  • 135
Leslie Li
  • 407
  • 7
  • 14

1 Answers1

2

You should avoid using Qt 4 and its flawed QWS design. I would recommend using Qt 5, and getting interested in that.

As for Qt 5, it depends on the platform integration plugin. I assume you mean the "linuxfb" plugin in this scenario as the closest option to what you describe.

In that special case, there is actually no ping-pong buffer applied. It uses a QImage which gets copied directly. The plugin is essentially using the default QBackingStore.

László Papp
  • 51,870
  • 39
  • 111
  • 135
  • thanks your reply, I'm not a Qt programmer, but write a framebuffer driver for Qt application use most on an ARM board, I'd like to know the Qte 4.8.x or other later version's behavior so I can know more detailed about the performance. As you mentioned above, Qt 5 starts to use QImage to directly write to framebuffer memory? Do you know the mechanism of Qt 4? – Leslie Li Sep 27 '13 at 01:27
  • @Leslie Li: As I wrote: Qt4 and its QWS design has several flaws. It is also old, and Qt 5 is superior in almost every way possible. Qt 4 would be even slower missing the improvements, including performance. – László Papp Sep 27 '13 at 03:06
  • @LeslieLi: any reason why you have not accepted my reply as an answer? What more can I do for you? – László Papp Sep 27 '13 at 16:32
  • Sorry for the delay, I'm new to this forum; I still got no idea of the data transferring, for Qt5, you mentioned it 'copied' directly, I guess it means, Qt5 has an internal mem in user mode and put all gui data into it, then at some very time, Qt5 will copy data from this user mode mem to framebuffer driver's mmapped ram, is it right? if so, I got two questions: 1. when will the data copy start? by a fixed time interval or triggered by GUI 'paint' some thing? 2. how to copy? use dma? if the resolution is 1920x1080x4bytes, data is huge – Leslie Li Sep 29 '13 at 03:08
  • @LeslieLi: Yes, you are correct. Please do not start new questions. This is a Q/A site, not an open ended forum. If you have new questions, open new threads for those, and we will be happy to help. Also, here you can find the code yourself for further inspection: https://qt.gitorious.org/qt/qtbase/source/475cbed2446d0e3595e7b8ab71dcbc1ae5f59bcf:src/plugins/platforms/linuxfb – László Papp Sep 29 '13 at 04:44
  • thank you for the link! I will go through it for the exact answers. I don't think they are new questions which should be in a new thread, when and how the data transferring are my original questions, I will accept the answer which solved them clearly. – Leslie Li Sep 29 '13 at 07:29
  • @LeslieLi: did my link help? – László Papp Sep 30 '13 at 12:50