Weston orientation

Hardware:
Colibri iMX6DL
with Viola Carrier Board Rev 1.2
TorizonCore 5.7.2

image

Hi,
We have 240x320 18bpp LCD display.
Running the example Weston docker container, we can see the following image on the screen…

The /etc/xdg/weston/weston.ini has been updated to…

[core]
idle-time=0
require-input=false
xwayland=true
modules=screen-share.so
# uncomment line below to use kiosk shell
#shell=kiosk-shell.so

[shell]
background-image=
background-color=0x00000000
panel-position=none
locking=false
allow-zap=false
num-workspaces=1

[keyboard]
vt-switching=false

# uncomment the [output] line below if you set any output configuration
[output]
# you must uncomment the "name” line and provide the name of the output interface being customized, otherwise, changes will not apply
name=DPI-1
# uncomment line below to configure screen rotation/flipping
transform=rotate-270
# uncomment line below to redirect the output; supported by kiosk shell
#mode=off
# uncomment line below to set an output resolution. Run for example 'cat /sys/class/drm/card1-HDMI-A-1/modes' to list the available modes.
mode=240x320@69.1
# or use the more detailed (mode=dotclock hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal hflag vflag)
#mode=146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
# uncomment line below to make this output a clone of another
#same-as=DPI-1

#For multi-display support and other configurations, please read the article: https://developer.toradex.com/knowledge-base/working-with-weston-on-torizoncore

Is there something we can check to see if the rotation is not getting applied?

Cheers Jon

Hello @jon2023 ,
Seems that the configuration in /etc/xdg/weston is not applied, and instead of that, the /etc/xdg/weston-dev configuration is applied.
You can see it in the Weston logs that you shared in this other topic:

Best regards,
Josep

Hi Josep,

Thanks for the update, much appreciated.

I’ve just check the /etc/xdg/weston-dev/weston.ini file, and we did a copy and paste from /etc/xdg/weston/weston.ini file and trimmed it down to make it easier to read…

image

We’ve tried a couple of different rotation, i.e.rotate-90, rotate-270 and also tried changing the background-color to see if that made any difference.

Let me know if there’s something we can try out :slight_smile:

Cheers Jon

Hello @jon2023 ,
Here is my test (with Torizon OS 6.4)

My screen for the tests was the 7" capacitive touch display parallel

torizon@colibri-imx6-10866299:~$ sudo tdx-info
Password:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.1.55-6.4.0+git.d23900f974e0 #1-TorizonCore SMP Mon May 22 09:17:34 UTC 2023
Kernel command line:      enable_wait_mode=off galcore.contiguousSize=50331648 root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/8eae83cf4b4722ba086810d3d40eb912f1e958af0d7eab940dc6f835365d2029/0
Distro name:              NAME="TorizonCore Upstream"
Distro version:           VERSION_ID=6.4.0-build.5
Hostname:                 colibri-imx6-10866299
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Colibri iMX6DL/S on Colibri Evaluation Board V3
Toradex version:          0017 V1.1B
Serial number:            10866299
Processor arch:           armv7l
------------------------------------------------------------

Check the available modes of the screen:

torizon@colibri-imx6-10866299:~$ cat /sys/class/drm/
card0/       card1/       card1-DPI-1/ renderD128/  version
torizon@colibri-imx6-10866299:~$ cat /sys/class/drm/card1-DPI-1/modes
800x480

Contents of /etc/xdg/weston/weston.ini (I took yours and changed the resolution to 800x480)

torizon@colibri-imx6-10866299:~$ cat /etc/xdg/weston/weston.ini
[core]
idle-time=0
require-input=false
xwayland=true
modules=screen-share.so
# uncomment line below to use kiosk shell
#shell=kiosk-shell.so

[shell]
background-image=
background-color=0x00000000
panel-position=none
locking=false
allow-zap=false
num-workspaces=1

[keyboard]
vt-switching=false

# uncomment the [output] line below if you set any output configuration
[output]
# you must uncomment the "name” line and provide the name of the output interface being customized, otherwise, changes will not apply
name=DPI-1
# uncomment line below to configure screen rotation/flipping
transform=rotate-270
# uncomment line below to redirect the output; supported by kiosk shell
#mode=off
# uncomment line below to set an output resolution. Run for example 'cat /sys/class/drm/card1-HDMI-A-1/modes' to list the available modes.
mode=800x480
# or use the more detailed (mode=dotclock hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal hflag vflag)
#mode=146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
# uncomment line below to make this output a clone of another
#same-as=DPI-1

#For multi-display support and other configurations, please read the article: https://developer.toradex.com/knowledge-base/working-with-weston-on-torizoncore

Contents of /var/sota/storage/docker-compose/docker-compose.yml
Here I added a bind mount of /etc/xdg/weston in the weston service

torizon@colibri-imx6-10866299:~$ cat /var/sota/storage/docker-compose/docker-compose.yml
services:
  kiosk:
    command: http://portainer:9000
    depends_on:
      portainer:
        condition: service_started
      weston:
        condition: service_started
    device_cgroup_rules:
    - c 226:* rmw
    environment:
      MACHINE: null
    image: torizon/chromium@sha256:9d363b140a5f4584392432b4ed548c0b6fd5466fbf41b28e834f31924fb62d6d
    platform: linux/arm
    security_opt:
    - seccomp:unconfined
    shm_size: 256mb
    volumes:
    - source: /tmp
      target: /tmp
      type: bind
    - source: /var/run/dbus
      target: /var/run/dbus
      type: bind
    - source: /dev/dri
      target: /dev/dri
      type: bind
  portainer:
    command: --templates https://feeds.toradex.com/portainer/5/$MACHINE/templates.json
      --logo https://docs.toradex.com/109812-torizon-logo-portainer.svg -H unix:///var/run/docker.sock
    image: portainer/portainer-ce@sha256:9fa1ec78b4e29d83593cf9720674b72829c9cdc0db7083a962bc30e64e27f64e
    ports:
    - published: 8840
      target: 9000
    restart: always
    volumes:
    - source: portainer_data
      target: /data
      type: volume
    - source: /var/run/docker.sock
      target: /var/run/docker.sock
      type: bind
  weston:
    cap_add:
    - CAP_SYS_TTY_CONFIG
    device_cgroup_rules:
    - c 4:0 rmw
    - c 4:7 rmw
    - c 4:1 rmw
    - c 13:* rmw
    - c 226:* rmw
    image: torizon/weston@sha256:804ee3cc495661a46816d86084a55b39a1aa725fc5ac24eafb49706d831fe615
    network_mode: host
    volumes:
    - source: /tmp
      target: /tmp
      type: bind
    - source: /dev
      target: /dev
      type: bind
    - source: /run/udev
      target: /run/udev
      type: bind
    - source: /etc/xdg/weston
      target: /etc/xdg/weston
      type: bind
version: '2.4'
volumes:
  portainer_data: {}

After rebooting I executed bash in the Weston container and ran weston-event

torizon@colibri-imx6-10866299:~$ docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS          PORTS                                                           NAMES
551c3bdb4bfc   torizon/chromium         "/usr/bin/start-brow…"   42 minutes ago   Up 11 minutes                                                                   torizon-kiosk-1
19c1bad5bcea   torizon/weston           "/usr/bin/entry.sh"      42 minutes ago   Up 37 minutes                                                                   torizon-weston-1
245c7539e958   portainer/portainer-ce   "/portainer --templa…"   55 minutes ago   Up 37 minutes   8000/tcp, 9443/tcp, 0.0.0.0:8840->9000/tcp, :::8840->9000/tcp   torizon-portainer-1
torizon@colibri-imx6-10866299:~$ docker exec -it torizon-weston-1 bash
root@colibri-imx6-10866299:/home/torizon# weston
weston                         weston-dnd                     weston-multi-resource          weston-simple-dmabuf-feedback  weston-subsurfaces
weston-calibrator              weston-editor                  weston-presentation-shm        weston-simple-dmabuf-v4l       weston-terminal
weston-clickdot                weston-eventdemo               weston-resizor                 weston-simple-egl              weston-touch-calibrator
weston-cliptest                weston-flower                  weston-scaler                  weston-simple-shm              weston-transformed
weston-confine                 weston-fullscreen              weston-screenshooter           weston-simple-touch
weston-content_protection      weston-image                   weston-simple-damage           weston-smoke
weston-debug                   weston-info                    weston-simple-dmabuf-egl       weston-stacking
root@colibri-imx6-10866299:/home/torizon# weston-eventdemo
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
resize width: 424, height: 303
redraw
focus x: 0, y: 0
resize width: 424, height: 303
redraw

The result , it works (the default orientation of the screen was landscape, now is portrait)

The output of weston-info (from inside the container)

root@colibri-imx6-10866299:/home/torizon# weston-info

*** Please use wayland-info instead
*** weston-info is deprecated and will be removed in a future version

interface: 'wl_compositor', version: 4, name: 1
interface: 'wl_subcompositor', version: 1, name: 2
interface: 'wp_viewporter', version: 1, name: 3
interface: 'zxdg_output_manager_v1', version: 2, name: 4
        xdg_output_v1
                output: 17
                name: 'DPI-1'
                logical_x: 0, logical_y: 0
                logical_width: 480, logical_height: 800
interface: 'wp_presentation', version: 1, name: 5
        presentation clock id: 1 (CLOCK_MONOTONIC)
interface: 'zwp_relative_pointer_manager_v1', version: 1, name: 6
interface: 'zwp_pointer_constraints_v1', version: 1, name: 7
interface: 'zwp_input_timestamps_manager_v1', version: 1, name: 8
interface: 'wl_data_device_manager', version: 3, name: 9
interface: 'wl_shm', version: 1, name: 10
        formats: 'XB30'(0x30334258) 'AB30'(0x30334241) 'XYUV'(0x56555958) 'YUYV'(0x56595559) 'NV12'(0x3231564e) 'YU12'(0x32315559) RGB565 XRGB8888 ARGB8888
interface: 'wl_drm', version: 2, name: 11
interface: 'wl_seat', version: 7, name: 12
        name: default
        capabilities: keyboard
        keyboard repeat rate: 40
        keyboard repeat delay: 400
interface: 'zwp_linux_dmabuf_v1', version: 4, name: 13
        formats:
        'UYVY'(0x59565955), modifier: 0x0600000000000002
        'UYVY'(0x59565955), modifier: 0x0600000000000001
        'UYVY'(0x59565955), modifier: 0x0000000000000000
        'UYVY'(0x59565955), modifier: 0x00ffffffffffffff
        'YUYV'(0x56595559), modifier: 0x0600000000000002
        'YUYV'(0x56595559), modifier: 0x0600000000000001
        'YUYV'(0x56595559), modifier: 0x0000000000000000
        'YUYV'(0x56595559), modifier: 0x00ffffffffffffff
        'Y410'(0x30313459), modifier: 0x0600000000000002
        'Y410'(0x30313459), modifier: 0x0600000000000001
        'Y410'(0x30313459), modifier: 0x0000000000000000
        'Y410'(0x30313459), modifier: 0x00ffffffffffffff
        'XYUV'(0x56555958), modifier: 0x0600000000000002
        'XYUV'(0x56555958), modifier: 0x0600000000000001
        'XYUV'(0x56555958), modifier: 0x0000000000000000
        'XYUV'(0x56555958), modifier: 0x00ffffffffffffff
        'AYUV'(0x56555941), modifier: 0x0600000000000002
        'AYUV'(0x56555941), modifier: 0x0600000000000001
        'AYUV'(0x56555941), modifier: 0x0000000000000000
        'AYUV'(0x56555941), modifier: 0x00ffffffffffffff
        'NV16'(0x3631564e), modifier: 0x0600000000000002
        'NV16'(0x3631564e), modifier: 0x0600000000000001
        'NV16'(0x3631564e), modifier: 0x0000000000000000
        'NV16'(0x3631564e), modifier: 0x00ffffffffffffff
        'NV12'(0x3231564e), modifier: 0x0600000000000002
        'NV12'(0x3231564e), modifier: 0x0600000000000001
        'NV12'(0x3231564e), modifier: 0x0000000000000000
        'NV12'(0x3231564e), modifier: 0x00ffffffffffffff
        'YV24'(0x34325659), modifier: 0x0600000000000002
        'YV24'(0x34325659), modifier: 0x0600000000000001
        'YV24'(0x34325659), modifier: 0x0000000000000000
        'YV24'(0x34325659), modifier: 0x00ffffffffffffff
        'YV16'(0x36315659), modifier: 0x0600000000000002
        'YV16'(0x36315659), modifier: 0x0600000000000001
        'YV16'(0x36315659), modifier: 0x0000000000000000
        'YV16'(0x36315659), modifier: 0x00ffffffffffffff
        'YV12'(0x32315659), modifier: 0x0600000000000002
        'YV12'(0x32315659), modifier: 0x0600000000000001
        'YV12'(0x32315659), modifier: 0x0000000000000000
        'YV12'(0x32315659), modifier: 0x00ffffffffffffff
        'YV11'(0x31315659), modifier: 0x0600000000000002
        'YV11'(0x31315659), modifier: 0x0600000000000001
        'YV11'(0x31315659), modifier: 0x0000000000000000
        'YV11'(0x31315659), modifier: 0x00ffffffffffffff
        'YVU9'(0x39555659), modifier: 0x0600000000000002
        'YVU9'(0x39555659), modifier: 0x0600000000000001
        'YVU9'(0x39555659), modifier: 0x0000000000000000
        'YVU9'(0x39555659), modifier: 0x00ffffffffffffff
        'YU24'(0x34325559), modifier: 0x0600000000000002
        'YU24'(0x34325559), modifier: 0x0600000000000001
        'YU24'(0x34325559), modifier: 0x0000000000000000
        'YU24'(0x34325559), modifier: 0x00ffffffffffffff
        'YU16'(0x36315559), modifier: 0x0600000000000002
        'YU16'(0x36315559), modifier: 0x0600000000000001
        'YU16'(0x36315559), modifier: 0x0000000000000000
        'YU16'(0x36315559), modifier: 0x00ffffffffffffff
        'YU12'(0x32315559), modifier: 0x0600000000000002
        'YU12'(0x32315559), modifier: 0x0600000000000001
        'YU12'(0x32315559), modifier: 0x0000000000000000
        'YU12'(0x32315559), modifier: 0x00ffffffffffffff
        'YU11'(0x31315559), modifier: 0x0600000000000002
        'YU11'(0x31315559), modifier: 0x0600000000000001
        'YU11'(0x31315559), modifier: 0x0000000000000000
        'YU11'(0x31315559), modifier: 0x00ffffffffffffff
        'YUV9'(0x39565559), modifier: 0x0600000000000002
        'YUV9'(0x39565559), modifier: 0x0600000000000001
        'YUV9'(0x39565559), modifier: 0x0000000000000000
        'YUV9'(0x39565559), modifier: 0x00ffffffffffffff
        'GR88'(0x38385247), modifier: 0x0600000000000002
        'GR88'(0x38385247), modifier: 0x0600000000000001
        'GR88'(0x38385247), modifier: 0x0000000000000000
        'GR88'(0x38385247), modifier: 0x00ffffffffffffff
        'R8  '(0x20203852), modifier: 0x0600000000000002
        'R8  '(0x20203852), modifier: 0x0600000000000001
        'R8  '(0x20203852), modifier: 0x0000000000000000
        'R8  '(0x20203852), modifier: 0x00ffffffffffffff
        'RG16'(0x36314752), modifier: 0x0600000000000002
        'RG16'(0x36314752), modifier: 0x0600000000000001
        'RG16'(0x36314752), modifier: 0x0000000000000000
        'RG16'(0x36314752), modifier: 0x00ffffffffffffff
        'AR15'(0x35315241), modifier: 0x0600000000000002
        'AR15'(0x35315241), modifier: 0x0600000000000001
        'AR15'(0x35315241), modifier: 0x0000000000000000
        'AR15'(0x35315241), modifier: 0x00ffffffffffffff
        'XB24'(0x34324258), modifier: 0x0600000000000002
        'XB24'(0x34324258), modifier: 0x0600000000000001
        'XB24'(0x34324258), modifier: 0x0000000000000000
        'XB24'(0x34324258), modifier: 0x00ffffffffffffff
        'XR24'(0x34325258), modifier: 0x0600000000000002
        'XR24'(0x34325258), modifier: 0x0600000000000001
        'XR24'(0x34325258), modifier: 0x0000000000000000
        'XR24'(0x34325258), modifier: 0x00ffffffffffffff
        'AB24'(0x34324241), modifier: 0x0600000000000002
        'AB24'(0x34324241), modifier: 0x0600000000000001
        'AB24'(0x34324241), modifier: 0x0000000000000000
        'AB24'(0x34324241), modifier: 0x00ffffffffffffff
        'AR24'(0x34325241), modifier: 0x0600000000000002
        'AR24'(0x34325241), modifier: 0x0600000000000001
        'AR24'(0x34325241), modifier: 0x0000000000000000
        'AR24'(0x34325241), modifier: 0x00ffffffffffffff
        'XB30'(0x30334258), modifier: 0x0600000000000002
        'XB30'(0x30334258), modifier: 0x0600000000000001
        'XB30'(0x30334258), modifier: 0x0000000000000000
        'XB30'(0x30334258), modifier: 0x00ffffffffffffff
        'AB30'(0x30334241), modifier: 0x0600000000000002
        'AB30'(0x30334241), modifier: 0x0600000000000001
        'AB30'(0x30334241), modifier: 0x0000000000000000
        'AB30'(0x30334241), modifier: 0x00ffffffffffffff
interface: 'weston_direct_display_v1', version: 1, name: 14
interface: 'zwp_linux_explicit_synchronization_v1', version: 2, name: 15
interface: 'weston_content_protection', version: 1, name: 16
interface: 'wl_output', version: 3, name: 17
        x: 0, y: 0, scale: 1,
        physical_width: 154 mm, physical_height: 86 mm,
        make: 'unknown', model: 'unknown',
        subpixel_orientation: unknown, output_transform: 270°,
        mode:
                width: 800 px, height: 480 px, refresh: 60.053 Hz,
                flags: current preferred
interface: 'xdg_wm_base', version: 3, name: 18
interface: 'weston_screenshooter', version: 1, name: 19

Best regards,
Josep

Thanks Josep,

I’ll try it with including the additional volume bind mount…

/etc/xdg/weston

Thanks for looking into it.
Cheers Jon

Hello @jon2023

Please keep us updated on your test results :slight_smile:

Best regards,
Josep

Hi Josep,

I’ve followed the steps above (upto step 3). But not sure what I need to do for step 4 (the /var/sota/storage/docker-compose/docker-compose.yml)

The details are listed below…

Step 1 - Check the available modes of the screen:
$ dir /sys/class/drm
image

Step 2 – Check the supported modes
$ cat /sys/class/drm/card1-DPI-1/modes

Step3 – Check the contents of weston.ini
$ cat /etc/xdg/weston/weston.ini

And $ cat /etc/xdg/weston-dev/weston.ini

Step 4 – Check the contents of $ cat /var/sota/storage/docker-compose/docker-compose.yml

Looks like the “torizon” user doesn’t have permission to access the docker-compose.yml file

NOTE: *** Not sure how to access/make changes at this point ***

Step 5- Reboot the torizon device

Not sure how to “…executed bash in the Weston container and ran weston-event ”, so tried running the follow steps to see if there is any change to the rotation…

Step 6

$ docker run -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ --device-cgroup-rule=‘c 4:* rmw’ --device-cgroup-rule=‘c 13:* rmw’ --device-cgroup-rule=‘c 199:* rmw’ --device-cgroup-rule=‘c 226:* rmw’ torizon/weston:$CT_TAG_WESTON --developer weston-launch --tty=/dev/tty7 --user=torizon


Step 7
$ docker run -d --rm --name=wayland-app -v /dev/dri:/dev/dri -v /tmp:/tmp --device-cgroup-rule=‘c 226:* rmw’ torizon/weston:$CT_TAG_WESTON weston-terminal

Step 8
$ docker ps

Step 9
$ docker exec -it weston bash

Step 10
root@colibri-imx6-11096746:/home/torizon# weston



root@colibri-imx6-11096746:/home/torizon# weston-info


Can see in the above details that the width & height settings don’t seem to be rotated.

If you can explain what I need to do for step 4, I can then try and follow it up and see if it updates :slight_smile:

Cheers Jon

Hello @jon2023

You can run the command with sudo, to gain access to the file.
sudo cat /var/sota/storage/docker-compose/docker-compose.yml

Best regards,
Josep

Hi Josep,

Thanks for the details.
I’ve managed to update the /var/sota/storage/docker-compose/docker-compose.yml to include the additional volumes.
Then tried running the (github) weston container, but the rotate-270 setting didn’t work.

After check the (container) weston.ini file…

It looks like it get overridden by the (github) weston container file from https://github.com/toradex/debian-docker-images/blob/buster/weston/weston.ini

Which seems to be confirmed from the posting…

I’ll keep looking into it.
Is it possible to copy a local weston.ini file (via Docker-compose.yml, Dockerfile/Dockerfile.debug) into the container? (if that’s the correct terminology)

Cheers Jon

I quick update,

I can see a couple of lines in the example Dockerfile…

COPY weston.ini /etc/xdg/weston/weston.ini
COPY weston-dev.ini /etc/xdg/weston-dev/weston.ini

I’ll try this, and see what happens

Cheers Jon

Hello @jon2023

any updates?

Best regards,
Josep

Hi Josep,

Following the steps below…
$ docker ps
$ docker exec -it torizon-weston-1 bash
/home/torizon# weston
/home/torizon# weston-eventdemo

I can see the same results with the correct orientation…

I think I need to look into how/if this is the same technique used for an Avalonia application, but I think that would be a different question, so I can close this now :slight_smile:

Cheers Jon