Contributing to PyraOS


More progress with Stretch:
Code:
# 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-lxde.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
cd $HOME
umount /dev/sdb*
# extract SD card and insert into Pyra

# boot Pyra
# ssh or access console into Pyra (ssh root@192.168.0.202 through USB3 port)
yes | apt-get install libdrm-omap1    # needs some active internet connection on Pyra (ethernet over USB, wwan, wlan)
/etc/init.d/rc.pvr start    # does not start automatically
cat /proc/pvr/*    # check that PVR was loaded successfully
sgx_clipblit_test    # run 3D demo
eglinfo    # get some info
leads to
Code:
root@letux:~# /etc/init.d/rc.pvr start
[  641.137519] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
[  641.178769] omap_hwmod: gpu: _wait_target_disable failed
[  641.195573] omap_hwmod: gpu: _wait_target_disable failed
Module bc_example failed to load. Retrying.
Running /sbin/depmod
Continuing to load PowerVR services
Loaded PowerVR consumer services.
root@letux:~# cat /proc/pvr/*
Registered nodes
Addr     Type     Class    Index Ref pvDev     Size Res
0879702f ?7       3D          0   1  70e09523    0  c89a74d5
Command Queues
Queue    CmdPtr      Pid Command Size DevInd  DSC  SSC  #Data ...
Version SGX_DDK sgxddk MAIN@3699939 (release) omap_linux
System Version String: SGX revision = 116
root@letux:~# sgx_clipblit_test
----------------- SGX CLipBlit test -----------------
---------------------- Start ------------------------
Call PVRSRVConnect with a valid argument:
 OK
Get number of devices from PVRSRVEnumerateDevices:
 OK
.... Reported 1 devices
.... Device Number  | Device Type
            0000    | PVRSRV_DEVICE_ID_SGX
Attempt to acquire device 0:
 OK
Getting SGX Client info
 OK
.... ui32ProcessID:16482
Display Class API: enumerate devices
 OK
PVRSRVEnumerateDeviceClass() returns 0 display device(s)
 FAIL - PVRSRV_ERROR_NO_DC_DEVICES_FOUND(134)
Aborted
root@letux:~#
This means the SGX is up and running and the firmware was loaded successfully.
So the final (?) question is now quite different: why does it enumerate devices but fail with PVRSRV_ERROR_NO_DC_DEVICES_FOUND?
Some thoughts - please help if you know answers:
  • X11 is running and showing a Log In window - could that be a problem?
  • What I do not know is if TILER code is included in the newly built kernel or not. Probably yes.
 
Xorg has to be stopped, and the tiler rotation has to be set to 0 for the sgx to work.
Although im not 100% sure about xorg needing to be stopped, I think i remember messing about with some windowed mode things where they just showed up in the corner of the screen. (but that might have also been because i was running stuff through glshim.)
Also don't forget to patch the lib mentioned in a previous post, Im not sure what exactly it patched, but it was needed.
Even when it works the module will stll complain quite a bit.

I'll see if I can get it running tomorow.
 
  • Like
Reactions: rSl
Even If I can't understand some of the concepts, I love to read these thread. It is the only one that seems to be interesting on the boards now, even the Pyra "progress" report are not relevant anymore :D.
 
Xorg has to be stopped, and the tiler rotation has to be set to 0 for the sgx to work.
Ok. I now tried this:
Code:
# boot
mv /usr/bin/Xorg /usr/bin/Xorg.off
killall Xorg
./tiler-ctl 0
/etc/init.d/rc.pvr start
sgx_clipblit_test
with no difference (except that the console cursor is blinking for rotation 0).
Also don't forget to patch the lib mentioned in a previous post, Im not sure what exactly it patched, but it was needed.
I thought (I should have read you post more carefully) that this is already applied to the libs in https://packages.pyra-handheld.com/images/extra/sgx.tar.xz but I can give it a try.

Edit: unless I have done something wrong with
Code:
printf '\xe0' | dd of=/lib/libsrv_um.so bs=1 seek=$((16#98eb)) count=1 conv=notrunc
the sgx.tar.xz is already patched.
 
Last edited:
Isn't it
Code:
./tiler-ctl 1
to stop the tiler. I don't have my note in hand, but I remember something like that in tiler control. Or was it in the code of tile-ctl itself? Can't remember.
 
Isn't it
to stop the tiler. I don't have my note in hand, but I remember something like that in tiler control. Or was it in the code of tile-ctl itself? Can't remember.
Well, my tiler-ctl scrip takes the rotation in degrees as argument (0/90/180/270). This translates to parameter value 1.
But anyways this a good hint. It may make a difference to stop X11 and rotate TILER to 0 from starting TILER not at all. So I am currently trying to remove TILER setup during boot completely.

Edit: I have now tiler and Xorg disabled so that I see a tilted console login: on the panel.
Code:
root@letux:~# /etc/init.d/rc.pvr start    # does not start automatically
[   43.048190] pvrsrvkm: bad vermagic: kernel tainted.
[   43.056889] Disabling lock debugging due to kernel taint
[   43.062639] pvrsrvkm: loading out-of-tree module taints kernel.
[   43.084780] omap_hwmod: gpu: _wait_target_disable failed
[   43.092788] [drm] Initialized pvr 1.14.3699939 20110701 for 5600fe00.sgx on minor 1
[   43.158220] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
[   43.210789] omap_hwmod: gpu: _wait_target_disable failed
[   43.228366] omap_hwmod: gpu: _wait_target_disable failed
Module bc_example failed to load. Retrying.
Running /sbin/depmod
Continuing to load PowerVR services
Loaded PowerVR consumer services.
root@letux:~# cat /proc/pvr/*    # check that PVR was loaded successfully
Registered nodes
Addr     Type     Class    Index Ref pvDev     Size Res
a7c6135e ?7       3D          0   1  cdce285e    0  1018fb9c
Command Queues
Queue    CmdPtr      Pid Command Size DevInd  DSC  SSC  #Data ...
Version SGX_DDK sgxddk MAIN@3699939 (release) omap_linux
System Version String: SGX revision = 116
root@letux:~# sgx_clipblit_test    # run 3D demo
----------------- SGX CLipBlit test -----------------
---------------------- Start ------------------------
Call PVRSRVConnect with a valid argument:
 OK
Get number of devices from PVRSRVEnumerateDevices:
 OK
.... Reported 1 devices
.... Device Number  | Device Type
            0000    | PVRSRV_DEVICE_ID_SGX
Attempt to acquire device 0:
 OK
Getting SGX Client info
 OK
.... ui32ProcessID:4155
Display Class API: enumerate devices
 OK
PVRSRVEnumerateDeviceClass() returns 0 display device(s)
 FAIL - PVRSRV_ERROR_NO_DC_DEVICES_FOUND(134)
Aborted
root@letux:~# cat /etc/powervr.ini
[default]
#WindowSystem=libpvrws_WAYLAND.so
root@letux:~#
So this error comes from something else. If I understand correctly it means that the sgx driver (or library?) does not find any display. Which means that we somehow should tell the kernel or the setup that there is an LCD panel and framebuffer available... Maybe something wrong with the powervr.ini?
 
Last edited:
  • Like
Reactions: rSl
this is all verry exciting progress here! not that i understand much, but...
reading http://processors.wiki.ti.com/index.php/SGXDbg#Integration_with_DRI.2FDRM_.28Xorg.29
...
  • Now one is ready to run X- apps. But before that set 2 variables as below-
export LD_LIBRARY_PATH=/usr/local/XSGX/lib (assuming one has done the make install step correctly, then one will find XSGX folder under /usr/local of your file system)

export DISPLAY=:0
  • Now one can run unit test app under /opt/gfxlibraries/gfx_rel_es3.x as -
./xgles1test1

maybe a trivial "export DISPLAY=:0" does it? ;)
 
ah ok, nevermind then. would have been too easy.
good thing is, i'm reading ti's techdocs now and getting more pro by the hour. xD
 
Hey everybody! Just wanted to let you know the build system is underway! It's relatively barebones at the moment but its open to clone and contribute. Right now its configured to clone my kernel fork and notaz's uboot fork, but that will be adjusted once everything from the beginning of this thread has been stabilized.

https://dev.pyra-handheld.com/imagebuild/pyra-docker
 
I just tried it with the 4.19.4-letux-lpae-zmatt-pyra kernel/module, and that works.

and "works" in the case means that it can run eglinfo , gles1test1 and gles2test1 , the other programs all give errors, but I don't think that's ever been any other way.
(run it as "gles1test1 100" otherwise it'll only draw one frame and exit).

(On PyraOS, which installs the sgx stuff to /opt/omap5-sgx-ddk-um-linux, has the patched lib, and sets up the library path to include /opt/omap5-sgx-ddk-um-linux/lib )

  • systemctl stop lightdm
  • insmod pvrsrvkm.ko
  • /usr/share/pyra/scripts/letux/tiler-ctl 0
  • cd /opt/omap5-sgx-ddk-um-linux/bin
  • ./pvrsrvctl --start --no-module
  • ./gles1test1 100

pyra-sgx.jpg
 
Last edited:
I just tried it with the 4.19.4-letux-lpae-zmatt-pyra kernel/module, and that works.

and "works" in the case means that it can run eglinfo , gles1test1 and gles2test1 , the other programs all give errors, but I don't think that's ever been any other way.
(run it as "gles1test1 100" otherwise it'll only draw one frame and exit).
Great!

I had not yet tried the egl stuff on my setup, but it fails with this error
Code:
root@letux:~# echo $DISPLAY
:0
root@letux:~# eglinfo
libEGL warning: DRI3: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
Unable to initialise egl
    egl error 'EGL_NOT_INITIALIZED' (0x3001)
root@letux:~#
It does not depend on Xorg is running or not or if tiler-ctl is 0 or 90.

So the question is what the differences between your setup and mine are. At the moment I can see these:
  • 4.19.4-letux-lpae-zmatt-pyra kernel/modules vs. letux-4.19.4-pvr-lpae kernel. Where can I find sources and binary of that specific version to check if that contains the important difference (maybe just some additional .config?)
  • what is the /etc/powervr.ini of PyraOS setup?
  • why does eglinfo call xcb_connect although we have no X?
 
source and binaries are here : https://packages.pyra-handheld.com/...yra/linux-4.19.4-letux-lpae-zmatt-pyra.tar.xz
( dtbs are slightly hidden at usr/lib/linux-image-4.19.4-letux-lpae-zmatt-pyra/ )

/etc/powervr.ini doesn't even exist on PyraOS, I must have forgotten to create that.

output of eglinfo : https://dev.pyra-handheld.com/snippets/413
It looks like it tries a lot of different configs, the xcb_connect is probably part of that.
Thanks! I'll look into it asap.

A quick test shows: I can delete powervr.ini without change. So we can exclude this.

Some other ideas/compares:
  • could you please run cat /proc/pvr/* - maybe it shows some difference to mine? - would indicate a kernel module/firmware load issue.
  • does your dmsg show something like omap_hwmod: gpu: _wait_target_disable failed - would indicate some kernel incompatibility since I do not yet use the 4.19.4-letux-lpae-zmatt-pyra
  • does PyraOS have a real libgbm.so.2 or a symlink to libgbm.so.1?
 
Code:
insmod pvrsrvkm.ko
[  227.827404] pvrsrvkm: loading out-of-tree module taints kernel.
[  227.857967] omap_hwmod: gpu: _wait_target_disable failed
[  227.865738] [drm] Initialized pvr 1.14.3699939 20110701 for 5600fe00.sgx on minor 1

./pvrsrvctl --start --no-module
[  315.227256] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
[  315.251678] omap_hwmod: gpu: _wait_target_disable failed

cat /proc/pvr/*
Registered nodes
Addr     Type     Class    Index Ref pvDev     Size Res
1b9101d2 ?7       3D          0   1  25702b85    0  cc7966db
Command Queues
Queue    CmdPtr      Pid Command Size DevInd  DSC  SSC  #Data ...
Version SGX_DDK sgxddk MAIN@3699939 (release) omap_linux
System Version String: SGX revision = 116

The "omap_hwmod: gpu: _wait_target_disable failed" gets output every frame drawn, so you can ignore that.
I think it was something to do with the second gpu core not being used properly, but i'm not 100% sure.

libgbm.so.2 is just a symlink, and libgbm.so.1 is the standard debian package.
 
The "omap_hwmod: gpu: _wait_target_disable failed" gets output every frame drawn, so you can ignore that.
I think it was something to do with the second gpu core not being used properly, but i'm not 100% sure.

libgbm.so.2 is just a symlink, and libgbm.so.1 is the standard debian package.
Hm. Then it looks exactly the same...
Maybe, trying 4.19.4-letux-lpae-zmatt-pyra or the doing a diff on it will reveal something.
If those are also the same, it would be a subtle difference between the LetuxOS and PyraOS user space setup.

Independently of these thoughs, I just did a tiny test: running eglinfo before running modprobe + pvrsrvctl did also result in the same "xcb_connect failed" error. So something seems to differ with libEGL and its error message wants to tell us something.

What does ls -l /dev/dri/ report on your setup? For me I see card0 and renderD128 (before starting the SGX). And after loading I see in addition a card1 and renderD129.

Some background what we are talking about for the readers: https://en.wikipedia.org/wiki/Direct_Rendering_Manager#Software_architecture
 
Last edited:
  • Like
Reactions: rSl
Such interesting thread to read.:)

If i can suggest (but i'm not really an expert here so please excuse me if my suggestions sound wrong) could it be a problem of few nodes created by the system? not enough for the PVR driver to work correctly?
On the Pandora cat /proc/pvr/* shows:
Code:
cat /proc/pvr/*
Registered nodes
Addr     Type     Class    Index Ref pvDev     Size Res
cb1e9cc0 ?9       buffer      2   1  cac1b600   28    (null)
cb1e9f00 ?9       buffer      2   1  cac1b380   28    (null)
cb1e9e40 ?9       buffer      2   1  cac1b0c0   28    (null)
cb1e9840 ?9       buffer      2   1  cb21cf80   28    (null)
cb1e9900 ?9       buffer      2   1  cb21cd40   28    (null)
cb1e99c0 ?9       buffer      2   1  cb21ca80   28    (null)
cb1e9a80 ?9       buffer      2   1  cb21c800   28    (null)
cb1e9b40 ?9       buffer      2   1  cb21c580   28    (null)
cb1e9c00 ?9       buffer      2   1  cb21c300   28    (null)
cb265600 ?9       buffer      2   1  cb21c000   28    (null)
cb291a80 ?9       display     1   1  cac854c0   48    (null)
cb265cc0 ?7       3D          0   1  caef8000    0  cad58180
Command Queues
Queue    CmdPtr      Pid Command Size DevInd  DSC  SSC  #Data ...
Version 1.4.14.2514 (release)
System Version String: SGX revision = 1.0.3

so here seems to be missing a display and some buffers..

The "omap_hwmod: gpu: _wait_target_disable failed" gets output every frame drawn, so you can ignore that.
I think it was something to do with the second gpu core not being used properly, but i'm not 100% sure.

here is explained https://e2e.ti.com/support/legacy_forums/omap/f/849/t/349903
 
  • Like
Reactions: rSl
I just tried it with a fresh 4.19.63, straight from the letux git, using letux_lpae_defconfig with CONFIG_DRM_LEGACY enabled manually, and that also works fine.
(meaning it runs gles1test1)
 
  • Like
Reactions: rSl
Back
Top