Buildroot Image With Qt5 OPEGN GLS 2.0 Mesa VC4 Driver in 32 Bit
Buildroot Image With Qt5 OPEGN GLS 2.0 Mesa VC4 Driver in 32 Bit
make raspberrypi3_defconfig
to the same place where all the builds you do. It could save time if downloaded package already
there.
Before I will go over the QT5 VC4 settings, I will start with the compiler.
While adding QT5 in 32 bit I am getting compiler error when using external download compiler and
external pre built
The internal build root compiler , complains about other error that I don't konw why.
Never mind , I don't want the internal toolchain any case.
Better place is to edit file:
put the define in comment
//#define __ARM_FEATURE_CRC32 0
output/build/qt5base-5.8.0/src/corelib/.moc/moc_predefs.h
Qt5 settings
VC4 is a DRM driver.
https://en.wikipedia.org/wiki/Direct_Rendering_Manager
From wikipedia
We can see from the make linux-menuconfig that the kernel Is configured as module = m
means , if the vc4 will find the Broadcom GPU it will be loaded.
Once we enable vc4 driver in mesa we have the open gl option in Qt enabled
QT5 configurations.
Enable qt quick, jpeg, png and gif
The png and all others are for game like maroon that require png support
Loading overlays
If we don't load the vc4 overlay , the VC4 DRM driver will not be loaded.
And we will get from the raspberry pi 3 an error that DRM device was not loaded
In output/images/rpi-firmware/overlays
So in config.txt:
There is a note:
# You should override this file using a post-build script.
I will deal with it later
output/images/rpi-firmware/cmdline.txt
I will add:
cma=128M
at the end
change:
gpu_mem_1024=256
When we use an overlay the VC4 DRI driver will load:
QT uses probably libinput directly and does not need the mesa drivers.
It also use xkbcommon for key mapping
The option to solve the font problem to create a link between /usr/share/fonts and /usr/lib/fonts
does not work
ln -s /usr/share/fonts /usr/lib/fonts
source link
The solution is to add QT_QPA_FONTDIR environment variable to tell QT where it can find fonts
See font problem
But remove qtengine because it did not compiled when I did make.
Could be that I can do make clean and make it will compile.
But seems that this library is not important.
http://doc.qt.io/archives/qt-5.5/enginio-index.html
Qt is complain that it cannot find the Physical with and height of the screen
After reading I found that the QT uses /dev/fb0 to determine the screen dimensions
So I have added:
This solved the problem with the cannot detect the screen dimension
Debugging
Note:When in doubt, enable logging from both the graphics and input subsystems by
setting the environment variable QT_LOGGING_RULES=qt.qpa.*=true before
launching the application. This will help identifying the correct input device nodes
and may uncover output configuration issues that can be difficult to debug otherwise.
QT_QPA_ENABLE_TERMINAL_KEYBOARD to 1
enable the control C
https://stackoverflow.com/questions/40490113/eglfs-on-raspberry2-failed-to-add-service-already-
in-use
More debugging
export QML_IMPORT_TRACE=1
Font problem
I tried run marron example.
The maroon example have almost everything in QT5
https://forum.qt.io/topic/75145/cross-compile-qt-5-7-for-raspberry-pi-3-problem-font-text-words-
in-application-not-showing-up-during-running/13
works!
Mouse and keyboard problem
Mouse problem solved by removing all mesa drivers mouse related
make savedefconfig
And here how it looks like in the raspberry pi 3 target on HDMI monitor
QT quick gallery
Some pazzel game
As we can see , all examples are working , with font, mouse, and keyboard.
Summery of compiling QT 5 in command line
1. Compiler
2. Sysroot
export PATH=$PATH:/home/first/buildroot/blrpi3_32/buildroot-2017.05/output/host/usr/bin
2. compile script
/home/first/buildroot/blrpi3_32/buildroot-2017.05/output/host/usr/bin/qmake $1 -spec
/home/first/Qt/5.9/Src/qtbase/mkspecs/arm-linux-gnueabihf-g++ CONFIG+=debug
CONFIG+=qml_debug
we need to specify:
1. full path of the qmake in buildroot
If we are not working inside the QT SRC the qmake will not know where the mkspcs.
and change all the compiler name to the buildroot compiler name
arm-linux-gnueabihf
#
# qmake configuration for building with arm-linux-gnueabihf-g++
#
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
# modifications to g++.conf
QMAKE_CC = arm-linux-gnueabihf-gcc
QMAKE_CXX = arm-linux-gnueabihf-g++
QMAKE_LINK = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++
# modifications to linux.conf
QMAKE_AR = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
QMAKE_NM = arm-linux-gnueabihf-nm -P
QMAKE_STRIP = arm-linux-gnueabihf-strip
load(qt_config)
running compile script (which rans qmake with the cross compiler)
will generate make files for us
run
make