How use SGX / PowerVR on BBB in 2019 ?

Hello everyone,

My name is Remi, I’m french and it’s difficult for me to write with a good english.
So, I’m sorry in advance if I have trouble expressing myself to explain my problems.

I take this message to thank Robert Nelson for all his work on the BeagleBone!
I read a lot of his posts and learned a lot about embedded linux.
I love the BeagleBone Black board, there are a lot of GPIOs, i2c and serials. It’s a great system and open source too!
Congratulations to everyone who worked on this project!

I want, as many who have gone here, launch a Qt executable with the QtQuick module.
For this, I need to use the graphical acceleration with SGX.
The official Debian image of beagleboard.org is perfect for me. The image is very stable and has all the tools I need to work on the BBB.
After two weeks of research and tests, I know there is a old and new version of SDK sent by Texas Instrument.

For information, all my questions are at the end of this message.

I try to use SGX on kernel 4.14-ti, 4.14-bone, 4.9-ti, 4.9-bone, 4.4-ti, 4.4-bone but I was never able to launch properly pvrsrvctl…

Example with the last kernel available :
I download the last stable image on : https://beagleboard.org/latest-images
I choose the IoT version because I haven’t need of LXQT.
The current version on this day is : 4.14.71-ti-r80

I take the last 4.14-ti version with the new SDK SGX :

apt-get update
cd /opt/scripts/tools/
git pull
./update_kernel.sh --ti-kernel --lts-4_14
reboot
apt-get install ti-sgx-ti335x-modules-uname -r
depmod -a
git clone -b ti-img-sgx/1.14.3699939 git://git.ti.com/graphics/omap5-sgx-ddk-um-linux.git --depth=1
cd omap5-sgx-ddk-um-linux/
export DISCIMAGE=/
export TARGET_PRODUCT=ti335x
make install
sudo ln -s /usr/lib/arm-linux-gnueabihf/libgbm.so.1 /usr/lib/arm-linux-gnueabihf/libgbm.so.2
tree /lib/modules/uname -r/extra/
/lib/modules/4.14.94-ti-r95/extra/
├── libpruio.ko
└── ti335x
├── bc_example.ko
└── pvrsrvkm.ko
modprobe pvrsrvkm
=> New message on dmesg: pvrsrvkm: loading out-of-tree module taints kernel.
/usr/bin/pvrsrvctl --start --no-module
PVR:(Error): OpenServices: PVRDRMOpenRender failed [0, ]
PVR:(Error): PVRSRVInitSrvConnect: PVRSRVConnect failed [0, ]
PVR:(Error): SrvInit: PVRSRVInitSrvConnect failed (4) [0, ]
/usr/bin/pvrsrvctl: SrvInit failed (already initialized?) (err=PVRSRV_ERROR_INIT_FAILURE)

ls /dev/dri/
card0

I take the last 4.14-bone version with old SDK :

`

apt-get update
cd /opt/scripts/tools/
git pull
./update_kernel.sh --bone-kernel --lts-4_14
reboot
apt-get install ti-sgx-es8-modules-uname -r
{ Generate GFX_5.01.01.02_es8.x.tar.gz on my debian server }
tar xfv GFX_5.01.01.02_es8.x.tar.gz -C /
cd gfxinstall/
apt-get install lsb-release insserv -y
./sgx-install.sh
insserv -r /etc/init.d/sgx-startup.sh
reboot
tree /lib/modules/uname -r/extra/
/lib/modules/4.14.93-bone17/extra
├── es8.x
│ ├── bufferclass_ti.ko
│ ├── omaplfb.ko
│ └── pvrsrvkm.ko
└── libpruio.ko
modprobe pvrsrvkm
=> New message on dmesg: pvrsrvkm: loading out-of-tree module taints kernel.
/usr/local/bin/pvrsrvctl --start --no-module
SrvInit failed (already initialized?) (err=34)

sgx_init_test
----------------------- Start -----------------------
Try calling PVRSRVConnect with an invalid argument:
OK
Call PVRSRVConnect with a valid argument:
FAIL - PVRSRV_ERROR_BRIDGE_CALL_FAILED

`

When I want to reload the pvrsrvkm module (rmmod pvrsrvkm;modprobe pvrsrvkm), I have this new message on dmesg :
pvrsrvkm 56000000.sgx: Unable to reset SGX!
But I have access to sgx :

`

ls /sys/devices/platform/ocp/56000000.sgx/
driver driver_override modalias of_node power subsystem uevent

`

I know that Robert Nelson redirects everyone to the Texas Instrument forum for the SGX library but their support are not really good :frowning:
I found this post: http://e2e.ti.com/support/processors/f/791/p/759609/2811623 but the prolem isn’t solved and I have a different error…

Here is the list of my questions:

  • Could someone put me on a way to successfully use powervr on kernel 4.9 or 4.14 or 4.4 ?
  • Can we hope that in 2019 there will be official support to use graphics accelerator for the BBB?
  • PowerVR is make in 2005, Can we hope that someday there will be a hardware update of the BeagleBoneBlack with more RAM, CPU and video memory? With the same architecture and the same location of gpios but just more fast?

Thank you very much for reading to the end

Regards,
Rémi A.

A few developers tired of the current kernel/blob/mess situation have
a github group now:

https://github.com/openpvrsgx-devgroup

Regards,

Thank for your reply Robert.

I don’t see how I can integrate this on the last debian image. Unfortunately, I lack knowledge in the field.
I understand that there are people desperate to the point of remaking the drivers.

But I think it’s not easy to integrate the drivers with this github otherwise you would have already done ^^.
Do you think that one day, the beaglebone black will have better performances with an update hardware?

I admit that it’s been 4 years that I work with the BBB and I will love that it is more powerful!

Regards,
Rémi A.

Ok I found the BeagleBone AI. I hope there will be no problem to run Qt Quick with the graphics accelerator!
I can not wait to buy it =D !

I detail how use the new SGX drivers, the link is here:

https://elinux.org/BeagleBoneBlack/SGX_%2B_Qt_EGLFS_%2B_Weston

What do you think Robert? Do you think that the SGX drivers /GBM and Weston patched can appear in an official version of the BeagleBone?

I think it’s important to have these tools especially with the arrival of the next generation of BeagleBone. Many people need the GUI.

I hope this will help some people.

Regards,
Rémi A.

Hi Rémi,

Hi Robert,

Thank you very much, it’s a very good news!

I edited the wiki page’s to add “Fast installation with deb files”.
I reconfigured all packages with --libdir and --prefix arguments to not need to edit the config file /etc/ld.so.conf.d/arm-linux-gnueabihf.conf.
I built deb package with checkinstall command’s but there are no documentations files or dependency… I still have a lot to learn about linux ^^

Okay, for the am335x family, i have these now setup thru the
"ti-sgx-ti33x-ddk-um" package..

Users can quickly get the correct bits by just running

cd /opt/scripts/tools/
git pull
sudo ./update_kernel.sh --ti-channel --lts-4_14 --sgx

Regards,

Side note... make sure mesa's libgbm-dev & libgbm1 are "NOT" installed..

I've rename'd TI's GBM fork as "ti-libgbm2 & ti-libgbm2-dev", so while
libgbm1 and ti-libgbm2 have no conflicts, the pkg-config and includes
of libgbm-dev and ti-libgbm2-dev do compete, thus anything built would
try to default to libgbm-dev's version first.

Thus, just makes sure your "purge" libgbm-dev (sudo apt remove
libgbm-dev --purge) and kmscube/etc will pickup the ti libgbm with no
issues..

Regards,

Hi Robert,

I test your script with kmscube, qt5 qml and with my custom cape with dts file (available on attached file).
I share with you all my results (sorry it’s a long post…)

Commands execute on start

`

#uname -r
4.9.78-ti-r94
#apt update

#cd /opt/scripts/tools/
#git pull
#./update_kernel.sh --ti-channel --lts-4_14 --sgx

The following NEW packages will be installed:
linux-image-4.14.108-ti-r101

The following NEW packages will be installed:
libpruio-modules-4.14.108-ti-r101

The following NEW packages will be installed:
ti-sgx-ti335x-modules-4.14.108-ti-r101

The following NEW packages will be installed:
ti-libgbm2 ti-sgx-ti33x-ddk-um

#reboot
#uname -r
4.14.108-ti-r101

`

With HDMI and KMSCUBE

`

root@beaglebone ~ #ls /sys/devices/platform/ocp/56000000.sgx
ls: cannot access ‘/sys/devices/platform/ocp/56000000.sgx’: No such file or directory

root@beaglebone ~ # /etc/init.d/ti-sgx-ti33x-ddk-um start
[ ok ] Starting ti-sgx-ti33x-ddk-um (via systemctl): ti-sgx-ti33x-ddk-um.service.
root@beaglebone ~ # dmesg |grep -i pvr
[ 317.740779] pvrsrvkm: loading out-of-tree module taints kernel.
root@beaglebone ~ # service ti-sgx-ti33x-ddk-um status
● ti-sgx-ti33x-ddk-um.service - LSB: Start daemon at boot time
Loaded: loaded (/etc/init.d/ti-sgx-ti33x-ddk-um; generated; vendor preset: enabled)
Active: active (exited) since Thu 2019-03-28 14:27:45 CET; 9min ago
Docs: man:systemd-sysv-generator(8)
Process: 314 ExecStart=/etc/init.d/ti-sgx-ti33x-ddk-um start (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/ti-sgx-ti33x-ddk-um.service

Mar 28 14:27:42 beaglebone systemd[1]: Starting LSB: Start daemon at boot time…
Mar 28 14:27:45 beaglebone systemd[1]: Started LSB: Start daemon at boot time.

`

hum I haven’t access to sgx drivers. I check my uEnv.txt file, and I comment “dtb=am335x-boneblack-overlay.dtb” line (why I have this line? idk…)

`

ls /sys/devices/platform/ocp/56000000.sgx
driver driver_override drm modalias of_node power subsystem uevent

dmesg |grep -i pvr
[ 12.544964] pvrsrvkm: loading out-of-tree module taints kernel.
[ 12.754997] [drm] Initialized pvr 1.14.3699939 20110701 for 56000000.sgx on minor 2
[ 12.939720] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]

`

Ok good! Your /etc/init.d/ti-sgx-ti33x-ddk-um script work fine now.

So to really test the SGX drivers, I run OGLES2Water from git://git.ti.com/graphics/img-pvr-sdk.git and it execute fine! Perfect!

I did not find a package with kms++ or kmscube, so I took my package directly.

`
root@beaglebone /opt # wget https://remi.avignon.me/bbb/kmsxx_1.0.0_armhf.deb
root@beaglebone /opt # dpkg -i kmsxx_1.0.0_armhf.deb

root@beaglebone /opt # kmscube
drmModeGetResources failed: Invalid argument
failed to initialize DRM

root@beaglebone /opt # ls -alh /sys/class/drm/
total 0
drwxr-xr-x 2 root root 0 Mar 28 15:01 .
drwxr-xr-x 63 root root 0 Mar 28 14:52 …
lrwxrwxrwx 1 root root 0 Mar 28 14:52 card0 → …/…/devices/platform/vgem/drm/card0
lrwxrwxrwx 1 root root 0 Mar 28 14:52 card1 → …/…/devices/platform/ocp/4830e000.lcdc/drm/card1
lrwxrwxrwx 1 root root 0 Mar 28 14:52 card1-HDMI-A-1 → …/…/devices/platform/ocp/4830e000.lcdc/drm/card1/card1-HDMI-A-1
lrwxrwxrwx 1 root root 0 Mar 28 14:53 card2 → …/…/devices/platform/ocp/56000000.sgx/drm/card2
lrwxrwxrwx 1 root root 0 Mar 28 14:53 renderD128 → …/…/devices/platform/ocp/56000000.sgx/drm/renderD128
-r–r--r-- 1 root root 4.0K Mar 28 14:52 version

root@beaglebone /opt # kmscube -d /dev/dri/card1

Display [0]: CRTC = 28, Connector = 30, format = 0x36314752

Mode chosen [1024x768] : Clock => 78750, Vertical refresh => 75, Type => 64
Horizontal => 1024, 1040, 1136, 1312, 0
Vertical => 768, 769, 772, 800, 0

Primary display => ConnectorId = 30, Resolution = 1024x768

loaded module : gbm_pvr.so
found valid GBM backend : gbm_pvr.so
failed to initialize
failed to initialize EGL

root@beaglebone /opt # apt remove libgbm-dev libgbm1
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package ‘libgbm-dev’ is not installed, so not removed
The following packages were automatically installed and are no longer required:
gconf-service gconf2 gconf2-common gksu keyboard-configuration libdbus-glib-1-2 libdrm-armada2 libetnaviv libevde
libgksu2-0 libgles2 libgles2-mesa libgnome-keyring-common libgnome-keyring0 libgtop-2.0-10 libgtop2-common libinp
libstartup-notification0 libutf8proc2 libwacom-bin libwacom-common libwacom2 libxcb-icccm4 libxcb-image0 libxcb-k
libxkbcommon-x11-0 lxmenu-data oxygen-icon-theme pcmanfm-qt-l10n qterminal-l10n qtermwidget5-data xserver-xorg-le
Use ‘apt autoremove’ to remove them.
The following additional packages will be installed:
libwayland-egl1 xserver-common
The following packages will be REMOVED:
libegl-mesa0 libegl1 libegl1-mesa libfm-qt3 libgbm1 libqt5gui5 libqt5multimedia5 libqt5multimediawidgets5 libqt5o
pcmanfm-qt qt5-gtk-platformtheme qterminal xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-inp
xserver-xorg-video-armada-etnaviv xserver-xorg-video-fbdev xserver-xorg-video-omap
The following NEW packages will be installed:
libwayland-egl1
The following packages will be upgraded:
xserver-common
1 upgraded, 1 newly installed, 28 to remove and 188 not upgraded.
Need to get 2,067 kB of archives.
After this operation, 21.2 MB disk space will be freed.
Do you want to continue? [Y/n] y

root@beaglebone /opt # kmscube -d /dev/dri/card1

Display [0]: CRTC = 28, Connector = 30, format = 0x36314752

Mode chosen [1024x768] : Clock => 78750, Vertical refresh => 75, Type => 64
Horizontal => 1024, 1040, 1136, 1312, 0
Vertical => 768, 769, 772, 800, 0

Primary display => ConnectorId = 30, Resolution = 1024x768

loaded module : gbm_pvr.so
found valid GBM backend : gbm_pvr.so
Using display 0x1 with EGL version 1.4
EGL Version “1.4 build 1.14@3699939 (MAIN)”
EGL Vendor “Imagination Technologies”
EGL Extensions “EGL_IMG_client_api_ogl EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_IMG_cl_image EGL_KHR_fence_sync EGL_IMG_context_priority EGL_IMG_hibernate_process EGL_IMG_image_plane_attribs EGL_KHR_surfaceless_context EGL_KHR_wait_sync EGL_KHR_create_context EGL_WL_bind_wayland_display EGL_EXT_image_dma_buf_import”

`

But on my HDMI monitor I don’t see a 3D cube but just a verticals blue lines!! It’s strange…
I recompile kmscube but I need libgbm-dev package ^^’…

`

root@beaglebone /opt/kmscube # apt autoremove
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
gconf-service gconf2 gconf2-common gksu keyboard-configuration libdbus-glib-1-2 libdrm-armada2 libetnaviv
libevdev2 libfm-data libfm-extra4 libfm-gtk-data libfm-gtk4 libfm-modules libfm-qt-l10n libfm4 libgbm1
libgconf-2-4 libgksu2-0 libgles2 libgles2-mesa libgnome-keyring-common libgnome-keyring0 libgtop-2.0-10
libgtop2-common libinput-bin libinput10 libmenu-cache-bin libmenu-cache3 libmtdev1 libpciaccess0 libqt5dbus5
libqt5network5 libstartup-notification0 libutf8proc2 libwacom-bin libwacom-common libwacom2 libxcb-icccm4
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-util0 libxcb-xinerama0 libxcb-xkb1
libxfont2 libxkbcommon-x11-0 lxmenu-data oxygen-icon-theme pcmanfm-qt-l10n qterminal-l10n qtermwidget5-data
xserver-xorg-legacy
0 upgraded, 0 newly installed, 54 to remove and 182 not upgraded.
After this operation, 61.0 MB disk space will be freed.
Do you want to continue? [Y/n] y

root@beaglebone ~ # kmscube -d /dev/dri/card1
kmscube: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory

root@beaglebone ~ # ln -s /usr/lib/libgbm.so.2.0.0 /usr/lib/libgbm.so.1

root@beaglebone ~ # kmscube -d /dev/dri/card1

Display [0]: CRTC = 28, Connector = 30, format = 0x36314752

Mode chosen [1024x768] : Clock => 78750, Vertical refresh => 75, Type => 64
Horizontal => 1024, 1040, 1136, 1312, 0
Vertical => 768, 769, 772, 800, 0

Primary display => ConnectorId = 30, Resolution = 1024x768

loaded module : gbm_pvr.so
found valid GBM backend : gbm_pvr.so
Using display 0x1 with EGL version 1.4
EGL Version “1.4 build 1.14@3699939 (MAIN)”
EGL Vendor “Imagination Technologies”
EGL Extensions “EGL_IMG_client_api_ogl EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_IMG_cl_image EGL_KHR_fence_sync EGL_IMG_context_priority EGL_IMG_hibernate_process EGL_IMG_image_plane_attribs EGL_KHR_surfaceless_context EGL_KHR_wait_sync EGL_KHR_create_context EGL_WL_bind_wayland_display EGL_EXT_image_dma_buf_import”
^CHandling signal number = 2
Cleanup of GL, GBM and DRM completed

`

Yeah now I can see the 3D cube in rotation!

With HMDI and Qt QML with EGLFS
Unfortunately, if we use we ti-sgx-common-ddk-um package’s, we will have conflicts with libegl1-mesa-dev and libgles2-mesa-dev packages and the libgbm1 package will be reinstall…

`

#apt install libqt5qml5 qml-module-qtquick-controls qt5-default qtdeclarative5-dev qtquickcontrols5-examples


`

dpkg: error processing archive /tmp/apt-dpkg-install-CHuAeE/57-libegl1-mesa-dev_18.1.9-1rcnee1~stretch+20190321_armhf.deb (–unpack):
trying to overwrite ‘/usr/include/EGL/egl.h’, which is also in package ti-sgx-common-ddk-um 1.14.3699939-git20171201.0-0rcnee8~stretch+20190326
Selecting previously unselected package libgles2-mesa-dev:armhf.
Preparing to unpack …/58-libgles2-mesa-dev_18.1.9-1rcnee1~stretch+20190321_armhf.deb …
Unpacking libgles2-mesa-dev:armhf (18.1.9-1rcnee1~stretch+20190321) …
dpkg: error processing archive /tmp/apt-dpkg-install-CHuAeE/58-libgles2-mesa-dev_18.1.9-1rcnee1~stretch+20190321_armhf.deb (–unpack):
trying to overwrite ‘/usr/include/GLES2/gl2.h’, which is also in package ti-sgx-common-ddk-um 1.14.3699939-git20171201.0-0rcnee8~stretch+20190326
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

You might want to run ‘apt --fix-broken install’ to correct these.
The following packages have unmet dependencies:
qtbase5-dev : Depends: libgles2-mesa-dev but it is not going to be installed or
libgles2-dev but it is not installable
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

$sudo apt --fix-broken install
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following additional packages will be installed:
libegl1-mesa-dev libgles2-mesa-dev
The following NEW packages will be installed:
libegl1-mesa-dev libgles2-mesa-dev
0 upgraded, 2 newly installed, 0 to remove and 175 not upgraded.
78 not fully installed or removed.
Need to get 140 kB of archives.
After this operation, 811 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://repos.rcn-ee.com/debian stretch/main armhf libegl1-mesa-dev armhf 18.1.9-1rcnee1~stretch+20190321 [59.7 kB]
Get:2 http://repos.rcn-ee.com/debian stretch/main armhf libgles2-mesa-dev armhf 18.1.9-1rcnee1~stretch+20190321 [80.7 kB]
Fetched 140 kB in 0s (174 kB/s)
E: Sub-process /usr/bin/dpkg returned an error code (1)

But it’s not a problem to compile and execute a Qt program :

`
cd /usr/lib/arm-linux-gnueabihf/qt5/examples/quickcontrols/extras/dashboard
qmake
make
export QT_QPA_PLATFORM=eglfs
export QT_QPA_EGLFS_INTEGRATION=none
./dashboard

`

Okay we can see the dashboard program on the monitor!

LVDS with my custom cape

My custom cape work fine on 4.9 kernel. I can compile my dts file to dtbo on 4.14 but I have a “Unable to handle kernel NULL pointer dereference at virtual address” error on boot.

`

$sudo dtc -O dtb -o /lib/firmware/CAPE-LVDS-1024-00A0.dtbo -b 0 -@ CAPE-LVDS-1024-00A0.dts
$sudo echo ‘CAPE=CAPE-LVDS-1024’ > /etc/default/capemgr
$sudo reboot

`

After reboot :

`

U-Boot SPL 2018.01-00002-g9aa111a004 (Jan 20 2018 - 12:45:29)

Trying to boot from MMC2

U-Boot 2018.01-00002-g9aa111a004 (Jan 20 2018 - 12:45:29 -0600), Build: jenkins-github_Bootloader-Builder-32

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver ‘omap_hsmmc’
No match for driver ‘omap_hsmmc’
Some drivers were not found
Reset Source: Power-on reset has occurred.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Board: BeagleBone Black
not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] …
board_rev=[00C0] …
Card did not respond to voltage select!
mmc_init: -95, time 13
Card did not respond to voltage select!
mmc_init: -95, time 13
Card did not respond to voltage select!
mmc_init: -95, time 12
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
Card did not respond to voltage select!
mmc_init: -95, time 12
Card did not respond to voltage select!
mmc_init: -95, time 12
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1…
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt …
Checking for: /boot.scr …
Checking for: /boot/boot.scr …
Checking for: /boot/uEnv.txt …
gpio: pin 55 (gpio 55) value is 1
2269 bytes read in 15 ms (147.5 KiB/s)
Loaded environment from /boot/uEnv.txt
debug: [dtb=am335x-boneblack-audio.dtb] …
Using: dtb=am335x-boneblack-audio.dtb …
Checking if uname_r is set in /boot/uEnv.txt…
gpio: pin 56 (gpio 56) value is 1
Running uname_boot …
loading /boot/vmlinuz-4.14.108-ti-r101 …
9916928 bytes read in 645 ms (14.7 MiB/s)
uboot_overlays: dtb=am335x-boneblack-audio.dtb in /boot/uEnv.txt, unable to use [uboot_base_dtb=am335x-boneblack-uboot.dtb] …
loading /boot/dtbs/4.14.108-ti-r101/am335x-boneblack-audio.dtb …
58369 bytes read in 32 ms (1.7 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] …
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo …
1440 bytes read in 137 ms (9.8 KiB/s)
uboot_overlays: uboot loading of [/lib/firmware/BB-HDMI-TDA998x-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]…
uboot_overlays: uboot loading of [/lib/firmware/BB-ADC-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_adc=1]…
uboot_overlays: add [enable_uboot_cape_universal=1] to /boot/uEnv.txt to enable…
loading /boot/initrd.img-4.14.108-ti-r101 …
4564404 bytes read in 313 ms (13.9 MiB/s)
debug: [console=ttyO0,115200n8 consoleblank=0 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] …
debug: [bootz 0x82000000 0x88080000:45a5b4 88000000] …

Flattened Device Tree blob at 88000000

Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8fba5000, end 8ffff5b4 … OK
reserving fdt memory region: addr=88000000 size=6f000
Loading Device Tree to 8fb33000, end 8fba4fff … OK

Starting kernel …

[ 0.000799] timer_probe: no matching timers found
[ 0.892356] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 1.132417] omap_voltage_late_init: Voltage driver support not added
[ 1.139288] PM: Cannot get wkup_m3_ipc handle
rootfs: recovering journal
rootfs: clean, 76105/233392 files, 603170/932864 blocks
[ 11.609499] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
[ 11.682248] pgd = dc5dc000
[ 11.704331] [0000000c] pgd=00000000
[ 11.735064] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 11.740433] Modules linked in: nf_defrag_ipv4 nf_nat_ipv4(+) nf_nat nf_conntrack iptable_mangle iptable_filter spidev pru_rproc pruss pruss_intc ip_tables x_tables
[ 11.755165] CPU: 0 PID: 328 Comm: capemgr.sh Not tainted 4.14.108-ti-r101 #1
[ 11.762244] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 11.768365] task: db57ad00 task.stack: dc3f4000
[ 11.772935] PC is at __of_overlay_create+0x43c/0xb24
[ 11.777923] LR is at __of_overlay_create+0x448/0xb24
[ 11.782907] pc : [] lr : [] psr: 20070113
[ 11.789201] sp : dc3f5d58 ip : db45de30 fp : dc3f5dec
[ 11.794446] r10: 00000000 r9 : c111e714 r8 : db415580
[ 11.799693] r7 : 00000009 r6 : 00000009 r5 : db48c18d r4 : db45de20
[ 11.806248] r3 : c0ad4630 r2 : 00000000 r1 : 0000002f r0 : 00000000
[ 11.812805] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 11.819970] Control: 10c5387d Table: 9c5dc019 DAC: 00000051
[ 11.825741] Process capemgr.sh (pid: 328, stack limit = 0xdc3f4218)
[ 11.832034] Stack: (0xdc3f5d58 to 0xdc3f6000)
[ 11.836412] 5d40: 00000000 014000c0
[ 11.844630] 5d60: 00000000 c0cf1050 dc3f5d94 dc3f5d78 c016d838 db4155a0 db415584 c15c8fb0
[ 11.852846] 5d80: c1504dc8 dc3f5d90 db415598 c0cfdea8 dc3f5dac 00000000 c0cfdea8 db488000
[ 11.861063] 5da0: c11a619c dc3f5db0 00000028 c0ad4630 db45c010 e028fcc0 000000e0 b0742391
[ 11.869280] 5dc0: c1504dc8 db45c010 00000028 db78fe18 00000000 c1504dc8 db78fe18 c114cd00
[ 11.877497] 5de0: dc3f5dfc dc3f5df0 c0ad5b00 c0ad4fc8 dc3f5e74 dc3f5e00 c08a2b48 c0ad5aec
[ 11.885714] 5e00: 00000039 dc3f5e10 c0385a98 c08a383c 00000000 c1504dc8 db78fe20 0000003a
[ 11.893932] 5e20: dc229c10 0000003a db78fe10 db488000 db45c25b dc229c10 dc229c10 e028f22d
[ 11.902150] 5e40: c0871578 b0742391 dc3f5e70 dacd8c40 c1504dc8 db78fe10 dacd82c0 dc229c10
[ 11.910367] 5e60: 00000000 db45c010 dc3f5eb4 dc3f5e78 c08a3cbc c08a26d4 00000000 dc3f5fb0
[ 11.918583] 5e80: 0000081f b0742391 023da5cc c08a3b6c daccc100 00000000 00000000 dc3f5f68
[ 11.926802] 5ea0: dacd82c0 daccc110 dc3f5ecc dc3f5eb8 c086f960 c08a3b78 c086f938 daccc100
[ 11.935019] 5ec0: dc3f5ee4 dc3f5ed0 c0384698 c086f944 0000000e daccc100 dc3f5f1c dc3f5ee8
[ 11.943236] 5ee0: c0383ce4 c0384654 00000000 00000000 db7a6d88 c0383bec daccdcc0 023d85c8
[ 11.951453] 5f00: dc3f5f68 00000000 023d85c8 0000000e dc3f5f34 dc3f5f20 c02fa114 c0383bf8
[ 11.959670] 5f20: 0000000e daccdcc0 dc3f5f64 dc3f5f38 c02fa318 c02fa0f8 daccdcc0 c031cbbc
[ 11.967888] 5f40: c1504dc8 daccdcc0 00000000 00000000 daccdcc0 023d85c8 dc3f5fa4 dc3f5f68
[ 11.976104] 5f60: c02fa590 c02fa270 00000000 00000000 c031ca7c b0742391 023d624c 023d85c8
[ 11.984321] 5f80: 0000000e 00000001 00000004 c0108f44 dc3f4000 00000004 00000000 dc3f5fa8
[ 11.992538] 5fa0: c0108d40 c02fa540 023d85c8 0000000e 00000001 023d85c8 0000000e 00000001
[ 12.000755] 5fc0: 023d85c8 0000000e 00000001 00000004 0000000e bec63740 023d8205 023d6234
[ 12.008972] 5fe0: 00000000 bec63514 0049f43f b6ebaaf6 20000030 00000001 00000000 00000000
[ 12.017205] [] (__of_overlay_create) from [] (of_overlay_create+0x20/0x24)
[ 12.025873] [] (of_overlay_create) from [] (capemgr_load_slot+0x480/0x5d0)
[ 12.034530] [] (capemgr_load_slot) from [] (slots_store+0x150/0x328)
[ 12.042669] [] (slots_store) from [] (dev_attr_store+0x28/0x34)
[ 12.050373] [] (dev_attr_store) from [] (sysfs_kf_write+0x50/0x54)
[ 12.058332] [] (sysfs_kf_write) from [] (kernfs_fop_write+0xf8/0x1d4)
[ 12.066558] [] (kernfs_fop_write) from [] (__vfs_write+0x28/0x48)
[ 12.074429] [] (__vfs_write) from [] (vfs_write+0xb4/0x1c0)
[ 12.081775] [] (vfs_write) from [] (SyS_write+0x5c/0xbc)
[ 12.088869] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x54)
[ 12.096481] Code: e584902c e5843034 e584403c e584a028 (e590500c)
[ 13.215003] using random self ethernet address
[ 13.227732] using random host ethernet address
[ 13.409476] using random self ethernet address
[ 13.419818] using random host ethernet address
[ 13.793883] Mass Storage Function, version: 2009/09/11
[ 13.807368] LUN: removable file: (no medium)
[ 14.166946] usb0: HOST MAC b0:d5:cc:f7:3b:8d
[ 14.207023] usb0: MAC b0:d5:cc:f7:3b:8e
[ 14.234180] usb1: HOST MAC b0:d5:cc:f7:3b:90
[ 14.261026] usb1: MAC b0:d5:cc:f7:3b:91
[ 14.435021] —[ end trace 0dc2ea06b937bcc3 ]—
[FAILED] Failed to start LSB: Start daemon at boot time.
See ‘systemctl status capemgr.service’ for details.
[ 14.567681] configfs-gadget gadget: high-speed config #1: c
Stopping LSB: Start busybox udhcpd at boot time…
[ OK ] Stopped LSB: Start busybox udhcpd at boot time.
[ OK ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
[ OK ] Found device /dev/ttyGS0.
[ 19.779171] random: crng init done
[ 19.782690] random: 7 urandom warning(s) missed due to ratelimiting
[ TIME ] Timed out waiting for device dev-ttyS0.device.
[DEPEND] Dependency failed for Serial Getty on ttyS0.
[
* ] (2 of 2) A start job is running for…Board Startup (2min 2s / no limit)[ 127.821749] net eth0: initializing cpsw version 1.12 (0)
[ 127.904898] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[ ***] (2 of 2) A start job is running for…Board Startup (2min 4s / no limit)[ 129.952976] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ OK ] Started Raise network interfaces.
[ OK ] Reached target Network.
Starting The PHP 7.0 FastCGI Process Manager…
Starting A high performance web server and a reverse proxy server…
Starting Permit User Sessions…
Starting dnsmasq - A lightweight DHCP and caching DNS server…
Starting OpenBSD Secure Shell server…
[ OK ] Reached target Network is Online.
Starting LSB: Advanced IEEE 802.11 management daemon…
Starting LSB: Shell In A Box Daemon…
Starting LSB: starts custom boot from CKSquare…
[ OK ] Started Permit User Sessions.
[ OK ] Started LSB: Advanced IEEE 802.11 management daemon.
[ OK ] Started LSB: starts custom boot from CKSquare.
[ OK ] Started OpenBSD Secure Shell server.
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttyGS0.
[ OK ] Reached target Login Prompts.
[ OK ] Started dnsmasq - A lightweight DHCP and caching DNS server.
[ OK ] Reached target Host and Network Name Lookups.
[ OK ] Started LSB: Shell In A Box Daemon.
[ OK ] Started Generic Board Startup.
Starting BB WL18xx Bluetooth Service…
[ OK ] Started A high performance web server and a reverse proxy server.
[ OK ] Started BB WL18xx Bluetooth Service.
[ OK ] Started The PHP 7.0 FastCGI Process Manager.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
Starting Update UTMP about System Runlevel Changes…
[ OK ] Started Update UTMP about System Runlevel Changes.
[ 277.139344] systemd[1]: systemd-journald.service: State ‘stop-sigabrt’ timed out. Terminating.
[ 367.392239] systemd[1]: systemd-journald.service: State ‘stop-sigterm’ timed out. Killing.
[ 367.401233] systemd[1]: systemd-journald.service: Killing process 255 (systemd-journal) with signal SIGKILL.
[ 457.647890] systemd[1]: systemd-journald.service: Processes still around after SIGKILL. Ignoring.
[ 547.901246] systemd[1]: systemd-journald.service: State ‘stop-final-sigterm’ timed out. Killing.
[ 547.910848] systemd[1]: systemd-journald.service: Killing process 255 (systemd-journal) with signal SIGKILL.

`

My dts file dates from the old school, I created it for the first debian version (3.8.13-bone50) and I adapted it for kernel 4.4 and 4.9.
I think I have to use the new way for kernel 1.14. This problem has nothing to do with SGX.

I hope that my tests will be useful to you to continue the integration of the libraries to use the graphic acceleration.

Best regards,
Rémi A.

CAPE-LVDS-1024-00A0.dts (4.92 KB)

Hi Robert,

I test your script with kmscube, qt5 qml and with my custom cape with dts file (available on attached file).
I share with you all my results (sorry it's a long post...)

Commands execute on start
#uname -r
4.9.78-ti-r94
#apt update
#cd /opt/scripts/tools/
#git pull
#./update_kernel.sh --ti-channel --lts-4_14 --sgx
...
The following NEW packages will be installed:
  linux-image-4.14.108-ti-r101
...
The following NEW packages will be installed:
  libpruio-modules-4.14.108-ti-r101
...
The following NEW packages will be installed:
  ti-sgx-ti335x-modules-4.14.108-ti-r101
...
The following NEW packages will be installed:
  ti-libgbm2 ti-sgx-ti33x-ddk-um
...
#reboot
#uname -r
4.14.108-ti-r101

With HDMI and KMSCUBE
root@beaglebone ~ #ls /sys/devices/platform/ocp/56000000.sgx
ls: cannot access '/sys/devices/platform/ocp/56000000.sgx': No such file or directory
root@beaglebone ~ # /etc/init.d/ti-sgx-ti33x-ddk-um start
[ ok ] Starting ti-sgx-ti33x-ddk-um (via systemctl): ti-sgx-ti33x-ddk-um.service.
root@beaglebone ~ # dmesg |grep -i pvr
[ 317.740779] pvrsrvkm: loading out-of-tree module taints kernel.
root@beaglebone ~ # service ti-sgx-ti33x-ddk-um status
● ti-sgx-ti33x-ddk-um.service - LSB: Start daemon at boot time
   Loaded: loaded (/etc/init.d/ti-sgx-ti33x-ddk-um; generated; vendor preset: enabled)
   Active: active (exited) since Thu 2019-03-28 14:27:45 CET; 9min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 314 ExecStart=/etc/init.d/ti-sgx-ti33x-ddk-um start (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/ti-sgx-ti33x-ddk-um.service

Mar 28 14:27:42 beaglebone systemd[1]: Starting LSB: Start daemon at boot time...
Mar 28 14:27:45 beaglebone systemd[1]: Started LSB: Start daemon at boot time.

hum I haven't access to sgx drivers. I check my uEnv.txt file, and I comment "dtb=am335x-boneblack-overlay.dtb" line (why I have this line? idk..)
ls /sys/devices/platform/ocp/56000000.sgx
driver driver_override drm modalias of_node power subsystem uevent
dmesg |grep -i pvr
[ 12.544964] pvrsrvkm: loading out-of-tree module taints kernel.
[ 12.754997] [drm] Initialized pvr 1.14.3699939 20110701 for 56000000.sgx on minor 2
[ 12.939720] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]

Ok good! Your /etc/init.d/ti-sgx-ti33x-ddk-um script work fine now.

So to really test the SGX drivers, I run OGLES2Water from git://git.ti.com/graphics/img-pvr-sdk.git and it execute fine! Perfect!

I did not find a package with kms++ or kmscube, so I took my package directly.
root@beaglebone /opt # wget https://remi.avignon.me/bbb/kmsxx_1.0.0_armhf.deb
root@beaglebone /opt # dpkg -i kmsxx_1.0.0_armhf.deb
root@beaglebone /opt # kmscube
drmModeGetResources failed: Invalid argument
failed to initialize DRM

root@beaglebone /opt # ls -alh /sys/class/drm/
total 0
drwxr-xr-x 2 root root 0 Mar 28 15:01 .
drwxr-xr-x 63 root root 0 Mar 28 14:52 ..
lrwxrwxrwx 1 root root 0 Mar 28 14:52 card0 -> ../../devices/platform/vgem/drm/card0
lrwxrwxrwx 1 root root 0 Mar 28 14:52 card1 -> ../../devices/platform/ocp/4830e000.lcdc/drm/card1
lrwxrwxrwx 1 root root 0 Mar 28 14:52 card1-HDMI-A-1 -> ../../devices/platform/ocp/4830e000.lcdc/drm/card1/card1-HDMI-A-1
lrwxrwxrwx 1 root root 0 Mar 28 14:53 card2 -> ../../devices/platform/ocp/56000000.sgx/drm/card2
lrwxrwxrwx 1 root root 0 Mar 28 14:53 renderD128 -> ../../devices/platform/ocp/56000000.sgx/drm/renderD128
-r--r--r-- 1 root root 4.0K Mar 28 14:52 version

root@beaglebone /opt # kmscube -d /dev/dri/card1
### Display [0]: CRTC = 28, Connector = 30, format = 0x36314752
        Mode chosen [1024x768] : Clock => 78750, Vertical refresh => 75, Type => 64
        Horizontal => 1024, 1040, 1136, 1312, 0
        Vertical => 768, 769, 772, 800, 0
### Primary display => ConnectorId = 30, Resolution = 1024x768
loaded module : gbm_pvr.so
found valid GBM backend : gbm_pvr.so
failed to initialize
failed to initialize EGL

root@beaglebone /opt # apt remove libgbm-dev libgbm1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'libgbm-dev' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  gconf-service gconf2 gconf2-common gksu keyboard-configuration libdbus-glib-1-2 libdrm-armada2 libetnaviv libevde
  libgksu2-0 libgles2 libgles2-mesa libgnome-keyring-common libgnome-keyring0 libgtop-2.0-10 libgtop2-common libinp
  libstartup-notification0 libutf8proc2 libwacom-bin libwacom-common libwacom2 libxcb-icccm4 libxcb-image0 libxcb-k
  libxkbcommon-x11-0 lxmenu-data oxygen-icon-theme pcmanfm-qt-l10n qterminal-l10n qtermwidget5-data xserver-xorg-le
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libwayland-egl1 xserver-common
The following packages will be REMOVED:
  libegl-mesa0 libegl1 libegl1-mesa libfm-qt3 libgbm1 libqt5gui5 libqt5multimedia5 libqt5multimediawidgets5 libqt5o
  pcmanfm-qt qt5-gtk-platformtheme qterminal xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-inp
  xserver-xorg-video-armada-etnaviv xserver-xorg-video-fbdev xserver-xorg-video-omap
The following NEW packages will be installed:
  libwayland-egl1
The following packages will be upgraded:
  xserver-common
1 upgraded, 1 newly installed, 28 to remove and 188 not upgraded.
Need to get 2,067 kB of archives.
After this operation, 21.2 MB disk space will be freed.
Do you want to continue? [Y/n] y

root@beaglebone /opt # kmscube -d /dev/dri/card1
### Display [0]: CRTC = 28, Connector = 30, format = 0x36314752
        Mode chosen [1024x768] : Clock => 78750, Vertical refresh => 75, Type => 64
        Horizontal => 1024, 1040, 1136, 1312, 0
        Vertical => 768, 769, 772, 800, 0
### Primary display => ConnectorId = 30, Resolution = 1024x768
loaded module : gbm_pvr.so
found valid GBM backend : gbm_pvr.so
Using display 0x1 with EGL version 1.4
EGL Version "1.4 build 1.14@3699939 (MAIN)"
EGL Vendor "Imagination Technologies"
EGL Extensions "EGL_IMG_client_api_ogl EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_IMG_cl_image EGL_KHR_fence_sync EGL_IMG_context_priority EGL_IMG_hibernate_process EGL_IMG_image_plane_attribs EGL_KHR_surfaceless_context EGL_KHR_wait_sync EGL_KHR_create_context EGL_WL_bind_wayland_display EGL_EXT_image_dma_buf_import"

But on my HDMI monitor I don't see a 3D cube but just a verticals blue lines!! It's strange...
I recompile kmscube but I need libgbm-dev package ^^'...

That is strange, i never had libgbm-dev installed and got kmscube to work..

root@beaglebone /opt/kmscube # apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  gconf-service gconf2 gconf2-common gksu keyboard-configuration libdbus-glib-1-2 libdrm-armada2 libetnaviv
  libevdev2 libfm-data libfm-extra4 libfm-gtk-data libfm-gtk4 libfm-modules libfm-qt-l10n libfm4 libgbm1
  libgconf-2-4 libgksu2-0 libgles2 libgles2-mesa libgnome-keyring-common libgnome-keyring0 libgtop-2.0-10
  libgtop2-common libinput-bin libinput10 libmenu-cache-bin libmenu-cache3 libmtdev1 libpciaccess0 libqt5dbus5
  libqt5network5 libstartup-notification0 libutf8proc2 libwacom-bin libwacom-common libwacom2 libxcb-icccm4
  libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-util0 libxcb-xinerama0 libxcb-xkb1
  libxfont2 libxkbcommon-x11-0 lxmenu-data oxygen-icon-theme pcmanfm-qt-l10n qterminal-l10n qtermwidget5-data
  xserver-xorg-legacy
0 upgraded, 0 newly installed, 54 to remove and 182 not upgraded.
After this operation, 61.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
...

root@beaglebone ~ # kmscube -d /dev/dri/card1
kmscube: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory

root@beaglebone ~ # ln -s /usr/lib/libgbm.so.2.0.0 /usr/lib/libgbm.so.1

Wonder if i should just auto-create that symlink to...

root@beaglebone ~ # kmscube -d /dev/dri/card1
### Display [0]: CRTC = 28, Connector = 30, format = 0x36314752
        Mode chosen [1024x768] : Clock => 78750, Vertical refresh => 75, Type => 64
        Horizontal => 1024, 1040, 1136, 1312, 0
        Vertical => 768, 769, 772, 800, 0
### Primary display => ConnectorId = 30, Resolution = 1024x768
loaded module : gbm_pvr.so
found valid GBM backend : gbm_pvr.so
Using display 0x1 with EGL version 1.4
EGL Version "1.4 build 1.14@3699939 (MAIN)"
EGL Vendor "Imagination Technologies"
EGL Extensions "EGL_IMG_client_api_ogl EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_IMG_cl_image EGL_KHR_fence_sync EGL_IMG_context_priority EGL_IMG_hibernate_process EGL_IMG_image_plane_attribs EGL_KHR_surfaceless_context EGL_KHR_wait_sync EGL_KHR_create_context EGL_WL_bind_wayland_display EGL_EXT_image_dma_buf_import"
^CHandling signal number = 2
Cleanup of GL, GBM and DRM completed

Yeah now I can see the 3D cube in rotation!

With HMDI and Qt QML with EGLFS
Unfortunately, if we use we ti-sgx-common-ddk-um package's, we will have conflicts with libegl1-mesa-dev and libgles2-mesa-dev packages and the libgbm1 package will be reinstall...

#apt install libqt5qml5 qml-module-qtquick-controls qt5-default qtdeclarative5-dev qtquickcontrols5-examples
...
dpkg: error processing archive /tmp/apt-dpkg-install-CHuAeE/57-libegl1-mesa-dev_18.1.9-1rcnee1~stretch+20190321_armhf.deb (--unpack):
trying to overwrite '/usr/include/EGL/egl.h', which is also in package ti-sgx-common-ddk-um 1.14.3699939-git20171201.0-0rcnee8~stretch+20190326
Selecting previously unselected package libgles2-mesa-dev:armhf.
Preparing to unpack .../58-libgles2-mesa-dev_18.1.9-1rcnee1~stretch+20190321_armhf.deb ...
Unpacking libgles2-mesa-dev:armhf (18.1.9-1rcnee1~stretch+20190321) ...
dpkg: error processing archive /tmp/apt-dpkg-install-CHuAeE/58-libgles2-mesa-dev_18.1.9-1rcnee1~stretch+20190321_armhf.deb (--unpack):
trying to overwrite '/usr/include/GLES2/gl2.h', which is also in package ti-sgx-common-ddk-um 1.14.3699939-git20171201.0-0rcnee8~stretch+20190326
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

Ah crap, so the reason i split those files into a 2nd common package
was to fix that possibility..

Fixed with: ti-sgx-ti33x-ddk-um (1.14.3699939-git20171201.0-0rcnee9~stretch+20190… · rcn-ee/repos@25a4d08 · GitHub

...
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
qtbase5-dev : Depends: libgles2-mesa-dev but it is not going to be installed or
                        libgles2-dev but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

$sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libegl1-mesa-dev libgles2-mesa-dev
The following NEW packages will be installed:
  libegl1-mesa-dev libgles2-mesa-dev
0 upgraded, 2 newly installed, 0 to remove and 175 not upgraded.
78 not fully installed or removed.
Need to get 140 kB of archives.
After this operation, 811 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 Index of /debian stretch/main armhf libegl1-mesa-dev armhf 18.1.9-1rcnee1~stretch+20190321 [59.7 kB]
Get:2 Index of /debian stretch/main armhf libgles2-mesa-dev armhf 18.1.9-1rcnee1~stretch+20190321 [80.7 kB]
Fetched 140 kB in 0s (174 kB/s)
E: Sub-process /usr/bin/dpkg returned an error code (1)

But it's not a problem to compile and execute a Qt program :
cd /usr/lib/arm-linux-gnueabihf/qt5/examples/quickcontrols/extras/dashboard
qmake
make
export QT_QPA_PLATFORM=eglfs
export QT_QPA_EGLFS_INTEGRATION=none
./dashboard

Okay we can see the dashboard program on the monitor!

LVDS with my custom cape

My custom cape work fine on 4.9 kernel. I can compile my dts file to dtbo on 4.14 but I have a "Unable to handle kernel NULL pointer dereference at virtual address" error on boot.
$sudo dtc -O dtb -o /lib/firmware/CAPE-LVDS-1024-00A0.dtbo -b 0 -@ CAPE-LVDS-1024-00A0.dts
$sudo echo 'CAPE=CAPE-LVDS-1024' > /etc/default/capemgr
$sudo reboot

So kernel "overlays" are broken, upgrade your version of u-boot and
add this define in /boot/uEnv.txt

sudo /opt/scripts/tools/developers/update_bootloader.sh

enable_uboot_overlays=1
uboot_overlay_addr4=/lib/firmware/CAPE-LVDS-1024-00A0.dtbo
disable_uboot_overlay_video=1

Then reboot and run:

sudo /opt/scripts/tools/version.sh

to see if everything is happy..

My dts file dates from the old school, I created it for the first debian version (3.8.13-bone50) and I adapted it for kernel 4.4 and 4.9.
I think I have to use the new way for kernel 1.14. This problem has nothing to do with SGX.

I hope that my tests will be useful to you to continue the integration of the libraries to use the graphic acceleration.

Regards,

Ok perfect, that work very fine! Thanks

That is strange, i never had libgbm-dev installed and got kmscube to work…

But it’s very strange, because if I do just: apt remove libgbm1 --purge
I can execute normaly kmscube but I have a black screen.

`

root@beaglebone ~ # ll /usr/lib/libgb*
lrwxrwxrwx 1 root root 15 Mar 26 18:40 /usr/lib/libgbm.so → libgbm.so.2.0.0
lrwxrwxrwx 1 root root 15 Mar 26 18:40 /usr/lib/libgbm.so.2 → libgbm.so.2.0.0
-rw-r–r-- 1 root root 9.5K Mar 26 18:40 /usr/lib/libgbm.so.2.0.0
root@beaglebone ~ # whereis kmscube
kmscube: /usr/bin/kmscube
root@beaglebone ~ # ldd /usr/bin/kmscube
linux-vdso.so.1 (0xbeff6000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6f27000)
libdrm.so.2 => /usr/lib/arm-linux-gnueabihf/libdrm.so.2 (0xb6f0b000)
libgbm.so.2 => /usr/lib/libgbm.so.2 (0xb6ef8000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6ee5000)
libEGL.so.1 => /usr/lib/libEGL.so.1 (0xb6ed3000)
libIMGegl.so.1 => /usr/lib/libIMGegl.so.1 (0xb6eae000)
libdrm_omap.so.1 => /usr/lib/arm-linux-gnueabihf/libdrm_omap.so.1 (0xb6e9b000)
libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 (0xb6e7d000)
libsrv_um.so.1 => /usr/lib/libsrv_um.so.1 (0xb6e46000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6d58000)
/lib/ld-linux-armhf.so.3 (0xb6fc3000)
libudev.so.1 => /lib/arm-linux-gnueabihf/libudev.so.1 (0xb6d41000)
libwayland-server.so.0 => /usr/lib/arm-linux-gnueabihf/libwayland-server.so.0 (0xb6d26000)
libffi.so.6 => /usr/lib/arm-linux-gnueabihf/libffi.so.6 (0xb6d10000)
libdbm.so.1 => /usr/lib/libdbm.so.1 (0xb6cfe000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6cda000)
libGLdispatch.so.0 => /usr/lib/arm-linux-gnueabihf/libGLdispatch.so.0 (0xb6c5c000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6c46000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6c1d000)

`
After the command “apt autoremove”, the kmscube is displayed correctly on the screen!

Hey Remi,

I believe you solved this issue since you already posted this article in the wiki:

https://elinux.org/BeagleBoneBlack/SGX_%2B_Qt_EGLFS_%2B_Weston

I used your article to enable EGLFS support for Qt on my BeagleBone Black. Many thanks for the clear and detailed article!

Best regards
Bora

Hi Bora,

Thank you very much for your feedback. I am very happy to know that my article was able to help you!

Best regards,
Rémi

Hi Everyone,

I want to test whether 2D acceleration makes QtWebEngine (Chromium) reactive enough on the BBB.
I tried Rémi’s procedure, and I can run the OGLES2 demos and kmscube. However, when I try to use a QWebEngineView in a Qt application, I get a segmentation fault (other Qt apps are fine).

I checked with ldd that my app is linked with libgbm2 and not libgbm1, so that does not seem to be the problem.

Has anyone tried QtWebEngine with this setup? Could it be that the debian package for QtWebEngine is incompatible?

Best regards,
Mathieu

Hi Mathieu,

Sorry I don’t work with QtWebEngine module. It’s not available on my working version (Qt 5.6.3).

Type this commands before execute your application :

`

export QT_LOGGING_RULES=*=true
export QSG_INFO=1
export QT_QPA_EGLFS_DEBUG=1
export QT_DEBUG_PLUGINS=1

`

May be you’ll have more informations for your problem.

Good luck,

Best regards,
Rémi A.