Skip to content

Running 3D applications on HSDK

Palmyr3 edited this page Sep 14, 2018 · 21 revisions

chocolate doom

fbset > /etc/fb.modes && SDL_NOMOUSE=1 chocolate-doom

kmscube

MESA_LOADER_DRIVER_OVERRIDE=imx-drm kmscube --device /dev/dri/card1

glxgears

X&
DISPLAY=:0 glxgears

Weston

Generic preparation:

mkdir -m 0700 /tmp/weston
export XDG_RUNTIME_DIR=/tmp/weston
export MESA_LOADER_DRIVER_OVERRIDE=imx-drm

With X11 back-end:

export DISPLAY=:0
X &
weston &

With FBDEV back-end:

weston --backend=fbdev-backend.so --tty=63 &

With DRM back-end via GPU:

weston --backend=drm-backend.so --tty=63 &

With DRM back-end via software renderer:

export MESA_LOADER_DRIVER_OVERRIDE=kms_swrast
weston --backend=drm-backend.so --tty=63 &

or use Pixman SW renderer:

weston --backend=drm-backend.so --tty=63 --use-pixman &

In graphical terminal window execute:

glmark2-es2-wayland

Screen capture in Wayland

See https://github.com/wayland-project/weston/tree/master/wcap for more details.

To start screen capturing press Windows-R keys on the keyboard attached to the target:

[00:00:30.617] starting recorder for output screen0, file capture.wcap

To stop press Windows-R again. This will produce capture.wcap:

[00:00:38.640] stopping recorder, total file size 1M, 113 frames

This will produce file capture.wcap in folder where Wayland was started. Now to decode real frames from this blob say wcap-decode --all capture.wcap and then check wcap-frame-X.png.

Weston event tracer

To start recording event trace press MODIFIER-Shift-Space-T keys (by default MODIFIER is Win key, but that's customizable via weston.ini and [shell] binding-modifier option) on the keyboard attached to the target:

[00:00:25.559] Opened timeline file 'weston-timeline-1970-01-01_00-00-25.log'

To stop press MODIFIER-Shift-Space-T again:

[00:00:53.395] Timeline log file closed.

This trace could be visualized with Wesgr, see https://github.com/ppaalanen/wesgr.

Xserver

Simple DRM device (no 3D acceleration)

cat /etc/Xorg/xorg.conf
Section "Device"
        Identifier      "Driver0"
        Screen          0
        Driver          "modesetting"
        Option          "kmsdev" "/dev/dri/card1"
EndSection

Note kmsdev must point to the bitstreamer device! For example on HSDK board /dev/dri/card0 refers to Vivante GPU, so we have to specify /dev/dri/card1 instaead.

DisplayLink USB2.0-to-HDMI/DVI adapter (UDL) in Qemu

It's possible to pass-through host's USB device to Qemu guest.

Note vendorid and productid values match lsusb output for DisplayLink adapter:

# lsusb | grep DisplayLink
Bus 001 Device 010: ID 17e9:411c DisplayLink

Below is an example with x86 client:

qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "root=/dev/vda" -net nic,model=virtio -net user -serial mon:stdio -device usb-ehci,id=usb,bus=pci.0,addr=0x4 --device usb-host,vendorid=0x17e9,productid=0x411c -display none

Linux kernel and rootfs could be build with stock Buildroot this way:

make qemu_x86_defconfig
Clone this wiki locally