I’m using a Yocto image based on the BSP 6.2 tdx-reference-multimedia-image on a Verdin iMX8MM. A 1920x1200 MIPI-DSI touch display is connected and working with weston.
Is it possible to switch on/off this display by command line? And not only the backlight.
Disabling the display in weston.ini and restarting weston is not an option for me.
I tried to add wlr-randr to my image with the following recipe:
I’m not 100% if it works but eventually, you can turn it off by using dpms:
# Use modetest to find out which id your connector has
modetest
.....
id encoder status name size (mm) modes encoders
236 235 connected eDP-1 300x190 1 235
modetest -M imx-drm -w 236:DPMS:3
This should turn off the display, and:
modetest -M imx-drm -w 236:DPMS:0
Should turn it on again. 236 is the id, you would have to change it to the number for your connector.
Unfortunately, you are right and this is not working as long as weston is running. It seems weston does not support DPMS and because it is the master device controlling the drm device it will block modetest from taking over the control. The only way to achieve a proper power-off would be to expand weston. There seems to be a weston plugin that tries to address this. Maybe you can make it work?
| Did not find CMake 'cmake'
| Found CMake: NO
| Build-time dependency wayland-scanner found: NO (tried pkgconfig)
|
| ../Weston-kiosk-shell-DPMS-0.2/meson.build:19:0: ERROR: Dependency "wayland-scanner" not found, tried pkgconfig
What do I have to add to the recipe so that wayland-scanner is found?
../Weston-kiosk-shell-DPMS-0.2/meson.build:43:0: ERROR: Include dir /usr/include/libweston-10 does not exist.
Why does the recipe search the directory in my host rootfs instead of the working directory tmp/work/cortexa53-mx8mm-tdx-linux/weston-kiosk-shell-dpms/0.2-r0/recipe-sysroot/usr/include?
Great to hear that it works and thanks a lot for sharing the solution, this will most likely help others to solve the issue as well!
Regarding the weston.ini file, there is the recipe openembedded-core/meta/recipes-graphics/wayland/weston-init.bb which addds the init file. You can just point to your weston.ini file by adding a bbappend:
weston-init.bbappend:
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
Then you can put your weston.ini into the weston-init directory in the folder where you store the weston-init.bbappend.
I am already modifying the weston.ini in a weston-init.bbappend. I was hoping that it is also possible to modify the weston.ini from within the extension recipe. This would have made it an all-in-one solution.