[Openpvrsgx-devgroup] trying to get SGX 1.14 running on DM3730 (SGX530)

H. Nikolaus Schaller hns at goldelico.com
Wed Nov 20 20:14:35 CET 2019


Hi,
I spent a little time to better analyse what is going
wrong when using the am335x UM code on the DM3730.

Not much...

pvrsrvctl --start --no-module

works fine as expected.

Then, running gles1test1 fails with no primary display.

I did an strace and found that it is calling the
DRM_IOCTL_VERSION ioctl for all 16 cards between
/dev/dri/card0 and /dev/dri/card15.

It finds as expected card0 (the SGX) and card1 (the DISPC).

First I though that the cards may be swapped - Tony mentioned
that as a risk. But they are exactly the same as on BeagleBone
black.

On the BBB it does the same ioctl on /dev/dri/card0 and succeeds.

There are no other syscalls involved. Just open(), ioctl() and
close().

On one architecture it is found on the other it isn't.

So I tried to find a difference. The ioctl is handled in
drivers/gpu/drm/drm_ioctl.c so I added a prink to the handler
to show what the DRM subsystem is reporting to user-space.

It is exactly the same:

Pyra: (OMAP5)

[   53.013185] drm_version: maj=1 min=14 patch=3699939 name=pvr date=20110701 desc=Imagination Technologies PVR DRM

vs. GTA04 (DM3730)

[  144.491760] drm_version: maj=1 min=14 patch=3699939 name=pvr date=20110701 desc=Imagination Technologies PVR DRM

vs. BBB (AM335x)

[   68.505033] drm_version: maj=1 min=14 patch=3699939 name=pvr date=20110701 desc=Imagination Technologies PVR DRM

So there must be some other factor for which the loop over
the dri/cards does not find something.

What I could imagine (but is difficult to test) is that
the strings printed by printk do not properly arrive in
user-space.

I.e. if drm_copy_field leaves some user-space bytes uninitialized
and the user-space code still checks for them. It might have a bug
and e.g. expect a \0 for the strings although the length is passed.
This could be a strcmp() instead of a strncmp().

Or there is some other factor tested before the gles1test1
does run the ioctl() loop but only manifests itself after
doing the ioctl().

BTW: pvrsrvctl also calls this ioctl twice and seems to
successfully find the card... This would also be an indicator
for user-space memory corruption or missing initialization.

So at the moment I have no idea how to find out more.

BR,
Nikolaus



More information about the openpvrsgx-devgroup mailing list