BeagleBoneBlack/SGX + Qt EGLFS + Weston

From eLinux.org
< BeagleBoneBlack
Revision as of 17:36, 17 March 2019 by ReRRemi (talk | contribs) (Created page with "= Introduction = The SoC of [http://beagleboard.org/black BeagleBone Black] is an AM335x by [https://en.wikipedia.org/wiki/Texas_Instruments Texas Instruments].<br> The graphi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

The SoC of BeagleBone Black is an AM335x by Texas Instruments.
The graphic accelerator by Imagination Technologies is PowerVR chipset, the serie 5 (SGX530).
I don't have a very good english, thanks to the people who will be able to correct me ;-)


Sources

BeagleBoard

Texas Instruments

Imagination Technologies


Conditions

  1. We must have "-ti-" on the BBB kernel. Type uname -r to verify your kernel version
  2. We connect a screen to the BBB with a micro HDMI to HDMI cable
  3. We need an ethernet cable to connect the beaglebone to the internet
  4. A lot of place if you want install demos and Weston without Cross Compilation
  5. All orders will be in "root" mode here (sudo -i). Sorry if it's not secure ^^
  6. All packages are up to date (apt-get update).

For my tests I use :

  • Debian 9.3 2018-01-28 4GB SD IoT (kernel: 4.9.78-ti-r94)
  • Debian 9.5 2018-10-07 4GB SD LXQT (kernel: 4.14.71-ti-r80)

you can download the last image of BBB here


Install PowerVR Module

The OLD Version

It's not a good solution and I have not test.
The older version may run on versions lower or equal than 4.4.68-bone17.
The old version use the FBDEV.
So you need a lts/bone kernel to download :

cd /opt/scripts/tools/
git pull
./update_kernel.sh --kernel 4.4.`your version here`-bone17
reboot
apt-get install ti-sgx-es8-modules-`uname -r`
depmod -a

Build SGX userspace for 4.4.x (must be done on an x86, due to the TI 5.01.01.02 blob extractor)

git clone https://github.com/RobertCNelson/bb-kernel.git
cd bb-kernel/
git checkout origin/am33x-v4.4 -b tmp-sgx
./sgx_create_package.sh

Copy ./deploy/GFX_5.01.01.02_es8.x.tar.gz to BeagleBone/BeagleBone Black and install

tar xfv GFX_5.01.01.02_es8.x.tar.gz -C /
cd /opt/gfxinstall/
apt-get install lsb-release insserv
./sgx-install.sh
reboot

Verify omaplfb & pvrsrvkm loaded

debian@arm:~$ lsmod | grep omaplfb
omaplfb                12065  0 
pvrsrvkm              178782  1 omaplfb

But when I test with lastest 4.4-bone kernel, the omapfbl module was not loaded

The NEW Version

Check access of SGX drivers

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

If you are on 4.9.X kernel, you don't have access to the SGX drivers, update your dtb files for solve this problem:

cd /opt/source/dtb-4.9-ti/
git pull
make install
reboot

The git pull command patch the dtb files to apply this patch. And retry the command to verify the access of SGX drivers, it's very important else you can't continue this tutorial...

Installing the module

apt-get install ti-sgx-ti335x-modules-`uname -r`
depmod -a


The GBM Library

Introduction

The GBM library is patched by Texas Instruments for use the PowerVR module.
The library on /usr/lib/arm-linux-gnueabihf/libgbm.so.1.0.0 is not a good library for use the graphic accelerator.

Add news directories of libs

Edit /etc/ld.so.conf.d/arm-linux-gnueabihf.conf file, and add /usr/lib and /usr/local/lib after the first line.

cat /etc/ld.so.conf.d/arm-linux-gnueabihf.conf
# Multiarch support
/lib/arm-linux-gnueabihf
/usr/lib
/usr/local/lib
/usr/lib/arm-linux-gnueabihf

After your file saved, type ldconfig to reload the new directories of libraries.

Download/Install library

cd /opt/
git clone git://git.ti.com/glsdk/libgbm.git -b next
cd libgbm/
git apply 0001-Hack-gbm.pc.in-add-ldl-at-Libs-to-pass-the-QT5-confi.patch
./autogen.sh
make install
cd /opt/
rm -r libgbm
ln -s /usr/local/lib/libgbm.so.2.0.0 /usr/local/lib/libgbm.so.2

How get the GOOD library

Note: If you want just use the graphic accelerator, this part is not important.
I explain how I sought to get the patches from Texas Instruments. You can go to the next step if you want.
I created a SD with am335x-evm-linux-XX.XX.XX.XX.img image and the graphic accelerator work fine on the BeagleBone Black. So I download the last SDK of AM335X from this page. Must be done on an x86 because this repo is very big, I use 05.02.00.10 PSDK for this example:

$ cd /opt/
$ git clone git://arago-project.org/git/projects/oe-layersetup.git tisdk
$ cd tisdk
$ ./oe-layertool-setup.sh -f configs/processor-sdk/processor-sdk-05.02.00.10-config.txt
$ find /opt/tisdk/sources -iname "*libgbm*"
/opt/tisdk/sources/meta-ti/recipes-graphics/gbm/libgbm_10.0.0.bb
/opt/tisdk/sources/meta-processor-sdk/recipes-graphics/gbm/libgbm_10.0.0.bbappend
/opt/tisdk/sources/meta-processor-sdk/recipes-graphics/gbm/libgbm
$cat /opt/tisdk/sources/meta-ti/recipes-graphics/gbm/libgbm_10.0.0.bb
BRANCH = "next"
SRC_URI = "git://git.ti.com/glsdk/libgbm.git;protocol=git;branch=${BRANCH}"
$ls /opt/tisdk/sources/meta-processor-sdk/recipes-graphics/gbm/libgbm
0001-Hack-gbm.pc.in-add-ldl-at-Libs-to-pass-the-QT5-confi.patch

I have the git source with the branch and I know there is only one patch !


The SGX SDK

Download/Install SGX SDK

cd /opt/
git clone -b ti-img-sgx/1.14.3699939 git://git.ti.com/graphics/omap5-sgx-ddk-um-linux.git
cd omap5-sgx-ddk-um-linux/
export DISCIMAGE=/
export TARGET_PRODUCT=ti335x
make install
cd /usr/lib/
ln -s libGLESv2.so.1.14.3699939 libGLESv2.so.1
mkdir /usr/local/lib/gbm/
cd /usr/local/lib/gbm/
ln -s ../../../lib/libpvrGBMWSEGL.so.1.14.3699939 gbm_pvr.so
rm -r /opt/omap5-sgx-ddk-um-linux

File powervr.ini

As explained on the texas instruments wiki, the configuration of the /etc/powervr.ini file is important. I advise you to configure your file as mine:

cat /etc/powervr.ini
[default]
WindowSystem=libpvrDRMWSEGL.so
DefaultPixelFormat=RGB565


The PVR Tools and Examples

Download