[Letux-kernel] Step-by-Step instructions for demonstrating PVR/SGX on Pyra (OMAP5)

H. Nikolaus Schaller hns at goldelico.com
Mon Aug 5 17:57:34 CEST 2019

Here are some step-by step instruction how to make an SD card
to demonstrate PVR/SGX on Pyra:

# ssh into BeagleBone and become root
# insert empty (or to be overwritten) SD card into reader
wget -O makesd "http://git.goldelico.com/?p=gta04-makesd.git;a=blob_plain;hb=HEAD;f=makesd" && chmod +x makesd
DEV=/dev/sdb ./makesd pyra -r http://download.goldelico.com/letux-debian-rootfs/20190708-stretch-9.9-armhf-minimal.tbz -m http://download.goldelico.com/letux-kernel/letux-4.19.4-pvr-lpae/modules.tgz -f1 -k http://download.goldelico.com/letux-kernel/letux-4.19.4-pvr-lpae/uImage -d http://download.goldelico.com/letux-kernel/letux-4.19.4-pvr-lpae/device-trees.tbz
mkdir -p /media/letux/rootfs
mount /dev/sdb2 /media/letux/rootfs
cd /media/letux/rootfs
KVERSION=$(cd lib/modules && ls -1)
wget -O lib/modules/$KVERSION/kernel/pvrsrvkm.ko https://packages.pyra-handheld.com/images/extra/pvr/4.19.4-letux-lpae-zmatt-pyra/pvrsrvkm.ko
depmod -b . $KVERSION
wget -O sgx.tar.xz https://packages.pyra-handheld.com/images/extra/sgx.tar.xz
tar xvJf sgx.tar.xz
cp -R sgx/pvr/etc sgx/pvr/lib .
cp -R sgx/pvr/bin sgx/pvr/include ./usr
sed -i.bak "s/modprobe -q pvrsrvkm/modprobe -q -f pvrsrvkm/g" etc/init.d/rc.pvr    # ignore small diff in version code
ln -sf libgbm.so.1 usr/lib/arm-linux-gnueabihf/libgbm.so.2    # there is (will be) no libgbm.so.2 in Debian
mv root/tiler-ctl root/tiler-ctl.off    # disable tiler
# mv usr/bin/Xorg usr/bin/Xorg.off    # disable X11 - there is no X11 here!
cd $HOME
umount /dev/sdb*
# extract SD card and insert into Pyra

# boot Pyra
# login as root through console or ssh into Pyra (ssh root at through USB3 port)
yes | apt-get install libdrm-omap1 libgbm1   # needs some active internet connection on Pyra (e.g. ethernet over USB, wwan, wlan)
/etc/init.d/rc.pvr start    # does not start automatically
cat /proc/pvr/*    # check that PVR was loaded successfully
eglinfo    # get some info
gles1test1 100    # run demo

This is a setup similar to which I used for making this quick video:


* there is some conflict between libEGL and xcb which means if some X11 system is installed by LetuxOS,
  running eglinfo and gles1test1 will fail.
* this setup disables tiler rotation on the Pyra so that the text console on screen is tilted.
* for the 4GB RAM Pyra you must replace

	DEV=/dev/sdb ./makesd pyra -r ...


	DEV=/dev/sdb ./makesd pyra-4gb -r ...

  to get the correct U-Boot installed on SD card.
* I tried to build kmscube and could compile it (with a handful of warnings) but gbm fails to load
  some "omapdrm" driver.
* compare to the 6 years old video from the GTA04 :)


Now since I have a working sample, I can start to replace/rebuild individual components (mainly kernel module
variations and user-space setup) and check if it still works equally well or breaks. It is much easier to
develop something against a visible and tangible target instead of digging through the fog.

My next goal is to get the SGX driver code into drivers/staging/pvr so that is no longer needed to build it
outside the kernel. And to make it more universal, so that the same kernel tree and application binaries
can run on OMAP3/4/5. This still will be challenging, but seems to be doable now.

BR and thanks to all who did contribute and help on the Pyra forum to reach this milestone,

More information about the Letux-kernel mailing list