Monday, January 11, 2016

Qt Declarative 2d build explained

The source code posted at Sources is built against Qt 5.3.2 . I hope to be able to update to newer versions later on. The problem with this is that Quick2 changes a lot and it is very hard to keep up for me, help is most welcome.

Prerequisites:

  1. A working toolchain for your ARM target.
  2. A system rootfs with headers etc on your build host.
  3. The 5.3.2 distribution of Qt
Build process:

  1. Extract the Qt source archive.
  2. Please read the generic build instructions at qt.io and configure the sources for "linux-arm-g++". *hint* use the -sysroot argument to point to your rootfs. You will also need to add -no-xcb and -qpa linuxfb.
  3. Build Qt (make)
  4. Test Qt on your target with a simple widget application for example wiggly.
  5. If the test fails, check that your /dev/fb0 is working and go thru the configure step again. Once you have your Qt working move on to next step.
  6. Clone Qt Declarative 2d into your top Qt source tree. (  git clone -b asm https://github.com/mgrunditz/qtdeclarative-2d.git )
  7. Enter the resulting directory and run qmake from your build tree ( ../qtbase/bin/qmake )
  8. Build it with make.
  9. Modify src/quick/items/qquickitem.cpp to your target screeen resolution.
  10. Modify src/quick/items/alphablender.S to match your screenwidth*4. *hint* check the comments.
  11. Redo make.
  12. make install
  13. Once you have your new binaries on your target it is time for some testing. You should have a program "qml" in your $prefix/$qt/bin directory. Do a simple hello world qml script and run it with the qml program.
  14. You might have problems with missing components. Check that your build includes imports, and tools.
  15. If your "Hello World" works you are ready to try out more complex applications.

Problems and bugs:

The most important issue is that Quick2 assumes that you can have larger window than your screen. I have tried to handle this in qquickitem.cpp and I have it semi working with 720p but it still crashes sometimes. Obviously it doesn't crash if your application stays inside your screen resolution.

The screen dimensions can be fetched from the qquickswindow object. Keep in mind that it is my variables you want to use, screenwidth screenheight.

The rest is a pure math exercise.

If you have any questions you can always email me at michael.grunditz@prevas.se.

Thank you for reading this far and on from all of us at:

Good luck!

Friday, October 09, 2015

QtDeclarative-2d first code drop!

I have the pleasure to announce the first sourcecode drop of our qtdeclarative (Quick2) renderer for system without GPU's.

The sources

The first push contains the branch "asm" which is a version for ARM systems only. If you want to try it on your system, please note the following:

The screen resolution is hardcoded in QQuickItem and in alphablender.S.

The screen needs to be in 32-bit mode ( fbset -depth 32)

More branches with more generic support will follow soon.

So, instead of complaining that it is not working for you , or that it looks bad , go fork it and make pull requests. The whole idea with releasing this as a opensource project is to make it a community project. More details about how it is built up will be posted here in next week.




This work is funded by FLIR to investigate the possibilities of running a rich UI on simple devices with high performance.


Freescale Semiconductor

The reference hardware is Freescale i.MX7, but is also tested on much smaller hardware with ARM9 cores.

If you find this effort interesting , have suggestions, want to certify it for your hardware, please tell me:

michael.grunditz@prevas.se , Prevas



Wednesday, August 19, 2015

i.MX6 Qt Quick2 display mirroring and scaling

This is about  screen mirroring and scaling with Qt Quick2 content on the i.MX6.


The way I did it was to use the IPU's to scale and copy out a grabbed screen image to the second display. The event mechanism was triggered by a Quick property in the Window item.

The linked file isn't the exact source code that went into production, but it shows the how  the mirror / scaling can be done. It contains a nasty goto/label thing ... useful in the context since if something breaks, the IPU tasks needs to be shutdown and not to be started again. 

The performance is quite good thanks to the high performance IPU's. There is some load on the CPU when doing the "grab", but it isn't a problem on a Quad i.MX6


 The sourcecode below can be used under the LGPL v2 or later license. The complete code package is available on request.



qsgthreadedrenderloop.cpp

Friday, August 14, 2015

Qt Declarative 2d on i.MX7

Time for some updates on the Qt Declarative 2d project.

I have recently focused on changing the rendering mechanism to a custom frame buffer hitting solution. The heart of it is a ARM assembler routine for alpha blending that composes the the graphics on to the "window" backbuffer. The assembler runs in circles around Qt's drawImage,
which was the primary composing mechanism I used before the assembler routine.

I am also lucky to have a i.MX7 board for certifying Qt Declarative 2d on. It runs very nicely.

The rssnews demo running on the i.MX7 using Qt Declarative 2d with the new rendering engine:



If you have hardware that you would like that to be certified, please contact me at:

michael.grunditz@prevas.se.

Saturday, July 25, 2015

Vacation "Work"

It is vacation time this month and I have spent a lot of time with on of my passions, namely:
The Sinclair QL , or rather its operating system QDOS and its successor SMSQ/E.

The main quest has been to get a dedicated system. I don't have any original QL, they went away many years ago. SMSQ/E is available for many platforms, including Atari ST/TT. I have a Atari 1024STe so I picked that for my first test. Sadly the current builds of SMSQ/E didn't work on it. The testing resulted in more fun! I started to debug SMSQ/E using the sources and the Hatari emulator.

In the meantime I figured out a alternative. The most well known SMSQ/E capable emulators is  QPC . They recently became freeware and I encourage you to try them out. Since I wanted a machine that is dedicated to QL computing I opted for the older DOS QPC1. I found a Celeron 400Mz PC under my desk (!) that have a CF IDE adapter and runs DOS. I took the CF card and plugged it into my CF reader and extracted QPC1 to it from my Mac. It worked on first try in the DOS pc.

QPC1 doesn't multitask, it completely takes over the machine. That was exactly what I wanted.
I am currently busy with getting up a decent install of QL software, slow progress but I am getting there.



And on Atari (old smsq/e) :



Thursday, February 12, 2015

Monday, February 09, 2015

QtDeclarative on platforms without GLES (Quick2)

We ,Prevas (http://www.prevas.com), have been working on a yet to be released project. Our goal is to have a Quick2 compatible Qt Declarative framework for targets without GLES enabled GPU's. The basic design is:
* The application is a standard Quick2 QML application that can be created with QtCreator.
* The QML code runs inside the standard unaltered QML engine.
* A QML application can be described as a tree of QQuickItems. In the GLES QtDeclarative those are tied to GLES shaders. Within this implementation we have replaced the shaders with Qt 2d drawing methods. When a QQuickItem is shown on the screen it renders itself directly to the QPA back buffer. In this way we can skip a lot of abstraction layers compared to using widgets.


 The result is that we can run many of the Quick2 examples and demos on small ARM targets at a decent speed and with a relatively small cpu usage. The performance can be compared to running Quick2  software rendered on a PC.

This implementation will be , in case of release, pushed to gitorious.org probably with the LGPL license. If someone at Digia "The Qt Company" reads this and have any questions and or objections about the license, just contact me.

 If you are interested to get this project come out of our drawers, leave a comment here and I will contact you. We can help you to adopt this to your hardware and possibly also tune QPA backends for different GPU configurations and even to GPU less targets.

Please note that this project has no connections with and was started long before anything was known about: http://blog.qt.io/blog/2015/01/22/introducing-the-qt-quick-2d-renderer/