added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,43 @@
From cae18dad41f11683aa8c99d6e884b3d59a6e6739 Mon Sep 17 00:00:00 2001
From: Mickael Reulier <mickael.reulier@st.com>
Date: Wed, 22 Mar 2017 13:52:49 +0100
Subject: [PATCH] linux-dmabuf: Add support for YUV Full color range
Add new flag yuv_full_color_range to dmabuf protocol for
YUV components color range.
If set, components are in full color range.
If not set, components are in limited color range.
Change-Id: Id4589f050d83d00298a834c444b01a13365ae6f2
Signed-off-by: Mickael Reulier <mickael.reulier@st.com>
---
unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml b/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
index 3b4861f..9f3df6e 100644
--- a/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
+++ b/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
@@ -185,6 +185,8 @@
<entry name="y_invert" value="1" summary="contents are y-inverted"/>
<entry name="interlaced" value="2" summary="content is interlaced"/>
<entry name="bottom_first" value="4" summary="bottom field first"/>
+ <entry name="yuv_full_color_range" value="8"
+ summary="For YUV buffers, components are in full color range"/>
</enum>
<request name="create">
@@ -210,6 +212,10 @@
'bottom_first' is specified. It is undefined whether 'bottom_first'
is ignored if 'interlaced' is not set.
+ Flag 'yuv_full_color_range' specifies YUV components color range.
+ If set, components are in full color range.
+ If not set, components are in limited color range.
+
This protocol does not convey any information about field rate,
duration, or timing, other than the relative ordering between the
two fields in one buffer. A compositor may have to estimate the
--
1.9.1

View File

@@ -0,0 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-linux-dmabuf-Add-support-for-YUV-Full-color-range.patch"

View File

@@ -0,0 +1,124 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
DEPENDS += "${@oe.utils.conditional('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}"
SRC_URI += " \
file://weston.ini \
file://utilities-terminal.png \
file://ST_1366x768.png \
file://OpenSTLinux_background_1024x600.png \
file://ST13345_Products_light_blue_24x24.png \
file://space.png \
file://weston-checkgpu.service \
file://weston_profile.sh \
file://README-CHECK-GPU \
file://72-galcore.rules \
\
file://73-pulseaudio-hdmi.rules \
file://default_pulseaudio_profile \
file://pulseaudio_hdmi_switch.sh \
\
file://weston-graphical-session.service \
file://systemd-graphical-weston-session.sh \
file://weston.service \
file://weston.socket \
"
SRC_URI:append:stm32mpcommon = " file://check-gpu "
FILES:${PN} += " ${datadir}/weston \
${sysconfdir}/etc/default \
${systemd_system_unitdir}/weston-launch.service \
${sbindir}/ \
${sysconfdir}/etc/default \
${sysconfdir}/etc/profile.d \
${sysconfdir}/xdg/weston/weston.ini \
/home/root \
${systemd_user_unitdir} \
"
CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini"
do_install:append() {
install -d ${D}${sysconfdir}/xdg/weston/
install -d ${D}${datadir}/weston/backgrounds
install -d ${D}${datadir}/weston/icon
install -m 0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston
install -m 0644 ${WORKDIR}/utilities-terminal.png ${D}${datadir}/weston/icon/utilities-terminal.png
install -m 0644 ${WORKDIR}/ST13345_Products_light_blue_24x24.png ${D}${datadir}/weston/icon/ST13345_Products_light_blue_24x24.png
install -m 0644 ${WORKDIR}/ST_1366x768.png ${D}${datadir}/weston/backgrounds/ST_1366x768.png
install -m 0644 ${WORKDIR}/OpenSTLinux_background_1024x600.png ${D}${datadir}/weston/backgrounds/OpenSTLinux_background_1024x600.png
install -m 0644 ${WORKDIR}/space.png ${D}${datadir}/weston/icon/
install -d ${D}${systemd_system_unitdir} ${D}${sbindir}
install -d ${D}/lib/systemd/system/
if [ -e ${D}/lib/systemd/system/weston.service ]; then
rm ${D}/lib/systemd/system/weston.service ${D}/lib/systemd/system/weston.socket
install -D -p -m0644 ${WORKDIR}/weston-graphical-session.service ${D}${systemd_system_unitdir}/weston-graphical-session.service
sed -i -e s:/etc:${sysconfdir}:g \
-e s:/usr/bin:${bindir}:g \
-e s:/var:${localstatedir}:g \
${D}${systemd_unitdir}/system/weston-graphical-session.service
install -d ${D}${sysconfdir}/systemd/system/multi-user.target.wants/
install -D -m 0755 ${WORKDIR}/systemd-graphical-weston-session.sh ${D}${bindir}/systemd-graphical-weston-session.sh
#ln -s /lib/systemd/system/weston-launch.service ${D}${sysconfdir}/systemd/system/multi-user.target.wants/display-manager.service
install -D -p -m0644 ${WORKDIR}/weston-checkgpu.service ${D}${systemd_system_unitdir}/weston-checkgpu.service
install -d ${D}${systemd_user_unitdir}
install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_user_unitdir}/weston.service
install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_user_unitdir}/weston.socket
fi
install -d ${D}${sysconfdir}/profile.d
install -m 0755 ${WORKDIR}/weston_profile.sh ${D}${sysconfdir}/profile.d/
if ${@bb.utils.contains('DISTRO_FEATURES','xwayland','true','false',d)}; then
# uncomment modules line for support of xwayland
sed -i -e 's,#xwayland=true,xwayland=true,g' ${D}${sysconfdir}/xdg/weston/weston.ini
fi
install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start
# /etc/default/weston
install -d ${D}${sysconfdir}/default
echo "WESTON_USER=weston" > ${D}${sysconfdir}/default/weston
# check GPU
install -d ${D}/home/root/
install -m 644 ${WORKDIR}/README-CHECK-GPU ${D}/home/root/
if ! test -f ${D}${base_sbindir}/check-gpu; then
install -d ${D}${base_sbindir}
echo '#!/bin/sh' > ${WORKDIR}/check-gpu.empty
echo '/bin/true' >> ${WORKDIR}/check-gpu.empty
install -m 755 ${WORKDIR}/check-gpu.empty ${D}${base_sbindir}/check-gpu
fi
# udev rules for galcore
install -D -p -m0644 ${WORKDIR}/72-galcore.rules ${D}${sysconfdir}/udev/rules.d/72-galcore.rules
# AUDIO: swith between analog stero and HDMI
install -d ${D}${sysconfdir}/default
install -m 0644 ${WORKDIR}/default_pulseaudio_profile ${D}${sysconfdir}/default/pulseaudio_profile
install -d ${D}${sysconfdir}/udev/rules.d
install -p -m 0644 ${WORKDIR}/73-pulseaudio-hdmi.rules ${D}${sysconfdir}/udev/rules.d/73-pulseaudio-hdmi.rules
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/pulseaudio_hdmi_switch.sh ${D}${bindir}/
}
do_install:append:stm32mpcommon() {
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${base_sbindir}
install -m 755 ${WORKDIR}/check-gpu ${D}${base_sbindir}
fi
}
SYSTEMD_SERVICE:${PN}:remove = "weston.service weston.socket"
SYSTEMD_SERVICE:${PN} += "weston-graphical-session.service weston-checkgpu.service"
#inherit useradd
USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,tty,audio,dialout weston"
GROUPADD_PARAM:${PN} = "-r wayland"

View File

@@ -0,0 +1,2 @@
SUBSYSTEMS=="graphics_class", KERNEL=="galcore", GROUP="video", MODE="0666"

View File

@@ -0,0 +1 @@
SUBSYSTEMS=="drm", ACTION=="change", RUN+="/usr/bin/pulseaudio_hdmi_switch.sh"

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,9 @@
Check GPU
=========
GPU can be deactivated by fuse or not present in some SOC
So in case the GPU is not present, you must configure weston on pix-man by creating this file :
/etc/default/weston with this content :
OPTARGS=--use-pixman

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,121 @@
#!/bin/sh -
#===============================================================================
#
# FILE: system-generator-check-gpu
#
# DESCRIPTION: The goal are to detect if the gpu are present/loaded or not
# ORGANIZATION: STMicroelectronics
# COPYRIGHT: Copyright (C) 2018, STMicroelectronics - All Rights Reserved
#===============================================================================
check_dt_status() {
gcnano_dir=$(ls /proc/device-tree/soc/ | grep gpu)
if [ -z "$gcnano_dir" ] || [ ! -d /proc/device-tree/soc/$gcnano_dir ];
then
echo "Gcnano in /proc/device-tree/soc/ is not available" > /dev/kmsg
force_no_dtb_gpu="1"
else
if [ ! -f /proc/device-tree/soc/$gcnano_dir/status ]; then
gcnano_status="okay"
else
if $(grep -q "okay" /proc/device-tree/soc/$gcnano_dir/status); then
gcnano_status="okay"
fi
fi
fi
}
check_load_module() {
local _timeout=0
if [ -n "$(cat /proc/modules | grep etnaviv)" ]; then
galcore_module=$(cat /proc/modules | grep ^etnaviv)
return
fi
while [ -z "$(cat /proc/modules | grep galcore)" ]; do
sleep 1
_timeout=$(($_timeout+1))
if [ "$_timeout" -eq "10" ]; then
echo "Time out check load galcore module expired" > /dev/kmsg
break
fi
done
galcore_module=$(cat /proc/modules | grep galcore)
}
check_devices() {
local _timeout=0
if [ -n "$(cat /proc/modules | grep etnaviv)" ]; then
galcore_device=$(cat /proc/modules | grep ^etnaviv)
return
fi
while [ -z "$(ls -l /dev/ | grep galcore)" ]; do
sleep 1
_timeout=$(($_timeout+1))
if [ "$_timeout" -eq "10" ]; then
echo "Time out check galcore device expired" > /dev/kmsg
break
fi
done
galcore_device=$(ls -l /dev/ | grep galcore)
}
check_default_weston_config() {
if [ "$force_no_dtb_gpu" = "1" ];
then
if [ -e /etc/default/weston ] && $(grep -q "Autogenerated" /etc/default/weston);
then
default_weston_status="Autogenerated"
fi
fi
}
#
# Main
#
gcnano_status="disabled"
galcore_module=""
galcore_device=""
default_weston_status=""
force_no_dtb_gpu=0
check_dt_status
check_default_weston_config
if [ "$default_weston_status" = "Autogenerated" ];
then
echo "Weston already configured"
exit 0
fi
check_load_module
check_devices
if [ "$gcnano_status" = "okay" ] && [ -n "$galcore_module" ] && [ -n "$galcore_device" ];
then
#echo "Gcnano is present and activated" > /dev/kmsg
if [ -f /etc/default/weston ] && $(grep -q "Autogenerated" /etc/default/weston) ;
then
sed -i "s/OPTARGS=--use-pixman/#OPTARGS=--use-pixman/g" /etc/default/weston
sed -i "/#Autogenerated/d" /etc/default/weston
fi
if [ ! -f /etc/default/weston ];
then
echo "#Autogenerated" > /etc/default/weston
echo "#OPTARGS=--use-pixman" >> /etc/default/weston
echo "WESTON_USER=weston" >> /etc/default/weston
fi
else
if [ -f /etc/default/weston ] && $(grep -q "Autogenerated" /etc/default/weston) ;
then
echo "Weston already configured on pixman" > /dev/kmsg
else
echo "Configure weston on pixman" > /dev/kmsg
echo "#Autogenerated" > /etc/default/weston
echo "OPTARGS=--use-pixman" >> /etc/default/weston
echo "WESTON_USER=weston" >> /etc/default/weston
fi
fi
dri_device=$(ls -l /dev/ | grep dri)
if [ -z "$dri_device" ];
then
exit 1
fi

View File

@@ -0,0 +1,3 @@
DEFAULT_PULSE_AUDIO_LOCAL_PROFILE=output:analog-stereo
DEFAULT_PULSE_AUDIO_HDMI_PROFILE=output:hdmi-stereo

View File

@@ -0,0 +1,39 @@
#!/bin/sh -
source /etc/default/pulseaudio_profile
PROFILE_LOCAL=$DEFAULT_PULSE_AUDIO_LOCAL_PROFILE
PROFILE_HDMI=$DEFAULT_PULSE_AUDIO_HDMI_PROFILE
HDMI_STATUS=$(cat /sys/class/drm/card0/*HDMI*/status)
if [ "$HDMI_STATUS" = "connected" ]; then
PROFILE=$PROFILE_HDMI
else
PROFILE=$PROFILE_LOCAL
fi
cat > /tmp/pulse_temp_switch.sh <<EOF
#!/bin/sh
cards=\$(pactl list cards | egrep -i 'Card #' | sed 's/Card //g')
index=0
for i in \$cards;
do
card_info=\$(pactl list cards | grep "Card \$i" -A15 | grep "alsa.card_name" | sed 's/ //g'| sed 's/alsa.card_name=\"//g'| sed 's/\"//g' | tr '\t' ' ' | sed 's/^\s*//g')
echo "\$i \$card_info"
# for each card, search alsa.card_name
found=\$(echo \$card_info | grep -n STM32MP | wc -l)
if [ \$found -eq 1 ];
then
echo "pactl set-card-profile \$index $PROFILE"
pactl set-card-profile \$index $PROFILE
break;
fi
index=\$((index+1))
done
EOF
chmod +x /tmp/pulse_temp_switch.sh
if [ "$USER" == "weston" ]; then
script -qc "/tmp/pulse_temp_switch.sh"
else
script -qc "su -l weston -c /tmp/pulse_temp_switch.sh"
fi
rm -f /tmp/pulse_temp_switch.sh

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

View File

@@ -0,0 +1,16 @@
#!/bin/sh
case $1 in
start)
systemctl --user start pulseaudio
/bin/sleep 5
/usr/bin/psplash-drm-quit
;;
stop)
systemctl --user stop weston.service weston.socket
systemctl --user stop pulseaudio
;;
*)
echo "Help: $0 [start|stop]"
;;
esac

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 B

View File

@@ -0,0 +1,12 @@
[Unit]
Description=Check if the gpu are present and set the correct weston configuration
Before=weston-graphical-session.service
[Service]
ExecStart=-/sbin/check-gpu
Type=oneshot
RemainAfterExit=yes
TimeoutSec=0
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,55 @@
[Unit]
Description=Weston graphical session
# Make sure we are started after logins are permitted.
Requires=systemd-user-sessions.service
After=systemd-user-sessions.service
# if you want you can make it part of the graphical session
#Before=graphical.target
# not necessary but just in case
#ConditionPathExists=/dev/tty7
# D-Bus is necessary for contacting logind. Logind is required.
Wants=dbus.socket
After=dbus.socket
[Service]
Type=simple
Environment=XDG_SESSION_TYPE=wayland
ExecStartPre=/usr/bin/systemd-graphical-weston-session.sh start
ExecStart=/bin/systemctl --wait --user start weston.service
ExecStop=/usr/bin/systemd-graphical-weston-session.sh stop
RemainAfterExit=yes
# The user to run the session as. Pick one!
User=weston
Group=weston
# Make sure the working directory is the users home directory
WorkingDirectory=/home/weston
# Set up a full user session for the user, required by Weston.
PAMName=weston-autologin
# A virtual terminal is needed.
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
# Fail to start if not controlling the tty.
StandardInput=tty-fail
# Defaults to journal, in case it doesn't adjust it accordingly
#StandardOutput=journal
StandardError=journal
# Log this user with utmp, letting it show up with commands 'w' and 'who'.
UtmpIdentifier=tty7
UtmpMode=user
[Install]
Alias=display-manager.service
WantedBy=multi-user.target

View File

@@ -0,0 +1,73 @@
# This is a system unit for launching Weston with auto-login as the
# user configured here.
#
# Weston must be built with systemd support, and your weston.ini must load
# the plugin systemd-notify.so.
[Unit]
Description=Weston, a Wayland compositor, as a system service
Documentation=man:weston(1) man:weston.ini(5)
Documentation=http://wayland.freedesktop.org/
# Make sure we are started after logins are permitted.
Requires=systemd-user-sessions.service
After=systemd-user-sessions.service
# D-Bus is necessary for contacting logind. Logind is required.
Wants=dbus.socket
After=dbus.socket
After=psplash-drm-wait.service
After=weston-checkgpu.service
# Since we are part of the graphical session, make sure we are started before
# it is complete.
Before=graphical.target
# Prevent starting on systems without virtual consoles, Weston requires one
# for now.
ConditionPathExists=/dev/tty0
[Service]
# Requires systemd-notify.so Weston plugin.
#Type=notify
EnvironmentFile=-/etc/default/weston
Environment="XDG_RUNTIME_DIR=/home/weston"
Environment="WESTON_USER=weston"
Environment="WL_EGL_GBM_FENCE=0"
#ExecStart=/usr/bin/weston-launch -- --modules=systemd-notify.so --log=/home/weston/weston.log $OPTARGS
ExecStart=/usr/bin/weston-start --modules=systemd-notify.so --log=/home/weston/weston.log $OPTARGS
ExecStop=/usr/bin/killall weston
# Optional watchdog setup
#TimeoutStartSec=60
#WatchdogSec=20
# The user to run Weston as.
User=weston
Group=weston
# Make sure the working directory is the users home directory
WorkingDirectory=/home/weston
# Set up a full user session for the user, required by Weston.
PAMName=weston-autologin
# A virtual terminal is needed.
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
# Fail to start if not controlling the tty.
StandardInput=tty-fail
StandardOutput=journal
StandardError=journal
# Log this user with utmp, letting it show up with commands 'w' and 'who'.
UtmpIdentifier=tty7
UtmpMode=user
[Install]
# Note: If you only want weston to start on-demand, remove this line with a
# service drop file
Alias=display-manager.service
WantedBy=multi-user.target

View File

@@ -0,0 +1,41 @@
#!/bin/sh
weston_args=$*
if [ -z "$WESTON_USER" ]; then
WESTON_USER=weston
fi
# for associated service: pulseaudio
if [ ! -d "/var/run/pulse" ]; then
su -c "mkdir -p /var/run/pulse"
su -c "chown -R weston.weston /var/run/pulse"
fi
## Module support
start_application_dir=/usr/share/weston-start-at-startup
start_local_application_dir=/usr/local/weston-start-at-startup
systemctl --user restart pulseaudio
if [ "$USER" == "$WESTON_USER" ]; then
# Load and run application at startup
if [ -d "$start_application_dir" ]; then
for m in "$start_application_dir"/*; do
echo "($m)"
(sleep 5 && $m)&
done
fi
if [ -d "$start_local_application_dir" ]; then
for m in "$start_local_application_dir"/*; do
echo "($m)"
(sleep 5 && $m)&
done
fi
fi
if [ -f /home/weston/weston.log ]; then
mv /home/weston/weston.log /home/weston/weston-previous.log
fi
exec /usr/bin/weston $weston_args

View File

@@ -0,0 +1,105 @@
[core]
#modules=cms-colord.so
#xwayland=true
shell=desktop-shell.so
#gbm-format=xrgb2101010
backend=drm-backend.so
idle-time=0
repaint-window=100
require-input=false
[keyboard]
keymap_layout=us
[shell]
background-image=/usr/share/weston/backgrounds/OpenSTLinux_background_1024x600.png
background-color=0xff002244
background-type=scale-crop
clock-format=minutes
panel-color=0x90a1a1a1
panel-position=bottom
locking=false
animation=none
startup-animation=none
close-animation=none
focus-animation=none
binding-modifier=ctrl
#num-workspaces=6
#cursor-theme=whiteglass
#cursor-size=24
[launcher]
icon=/usr/share/weston/icon/utilities-terminal.png
path=/usr/bin/weston-terminal
[launcher]
icon=/usr/share/weston/icon/space.png
path=/bin/true
[launcher]
icon=/usr/share/weston/icon_flower.png
path=/usr/bin/weston-flower
[launcher]
icon=/usr/share/weston/icon/space.png
path=/bin/true
[launcher]
icon=/usr/share/weston/icon/ST13345_Products_light_blue_24x24.png
path=/usr/local/demo/demo_launcher.py
[launcher]
icon=/usr/share/weston/icon/space.png
path=/bin/true
[input-method]
path=/usr/libexec/weston-keyboard
# HDMI connector
# If the hdmi cable is plugged, weston uses the hdmi output (else dsi output).
# Use the command "systemctl restart weston@root" after pluging/unpluging the hdmi cable.
[output]
name=HDMI-A-1
mode=1280x720
# DSI connector
[output]
name=DSI-1
mode=preferred
transform=rotate-90
app-ids=1000
# LTDC connector
[output]
name=DPI-1
mode=preferred
[libinput]
touchscreen_calibrator=true
calibration_helper=/bin/echo
#enable-tap=true
#tap-and-drag=true
#tap-and-drag-lock=true
#disable-while-typing=false
#middle-button-emulation=true
#left-handed=true
#rotation=90
#accel-profile=flat
#accel-speed=.9
#natural-scroll=true
#scroll-method=edge
# For button-triggered scrolling:
#scroll-method=button
#scroll-button=BTN_RIGHT
#[touchpad]
#constant_accel_factor = 50
#min_accel_factor = 0.16
#max_accel_factor = 1.0
[screen-share]
command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
#start-on-startup=false
#[xwayland]
#path=/usr/bin/Xwayland

View File

@@ -0,0 +1,30 @@
[Unit]
Description=Weston, a Wayland compositor, as a user service
Documentation=man:weston(1) man:weston.ini(5)
Documentation=https://wayland.freedesktop.org/
# Activate using a systemd socket
Requires=weston.socket
After=weston.socket
# Since we are part of the graphical session, make sure we are started before
Before=graphical-session.target
[Service]
Type=notify
TimeoutStartSec=60
WatchdogSec=20
# Defaults to journal
#StandardOutput=journal
StandardError=journal
EnvironmentFile=-/etc/default/weston
Environment="XDG_RUNTIME_DIR=/home/weston"
Environment="WESTON_USER=weston"
Environment="WL_EGL_GBM_FENCE=0"
# add a ~/.config/weston.ini and weston will pick-it up
ExecStart=/usr/bin/weston-start --modules=systemd-notify.so --log=/home/weston/weston.log $OPTARGS
ExecStop=/usr/bin/killall weston
[Install]
WantedBy=graphical-session.target

View File

@@ -0,0 +1,139 @@
#!/bin/sh
# Weston
#uncomment some part of the following line if you like:
# - see the weston log
# LOG_FILE: file on which the log are writed
# - use a software compositor instead of egl compositor
# USE_PIXMAN: populate the variable to use the software compositor on
# weston
# - add some new option to weston application
# ST_WESTON_ADDONS
# - debug weston via openvt
# DEBUG_OPENGL_VIA_OPENVT: file on which the all stdout, sdterr trace
# are stocked
#LOG_FILE=/tmp/weston.log
#USE_PIXMAN=1
#ST_WESTON_ADDONS
#DEBUG_OPENGL_VIA_OPENVT=/tmp/opengl.log
mkdir -p $XDG_RUNTIME_DIR
chmod 0700 $XDG_RUNTIME_DIR
# psplash management
case "$1" in
start)
PSPLASH_PID=`pgrep psplash`
if [ ! -z $PSPLASH_PID ]; then
echo -n "Stop psplash: "
/usr/bin/psplash-write QUIT
#kill -9 $PSPLASH_PID
echo "done."
fi
PSPLASH_PID=`pgrep psplash-drm`
if [ ! -z $PSPLASH_PID ]; then
echo -n "Stop psplash: "
echo QUIT > /tmp/splash_fifo
#kill -9 $PSPLASH_PID
echo "done."
fi
;;
*)
;;
esac
#log file managment on weston CMD line
CMD_LINE_WESTON=""
if [ -z $LOG_FILE ];
then
CMD_LINE_WESTON=" "
else
if [ -f $LOG_FILE ]; then
rm $LOG_FILE
fi
CMD_LINE_WESTON="--log=$LOG_FILE"
fi
if [ -z "$ST_WESTON_IDLE_TIME" ];
then
ST_WESTON_IDLE_TIME=648000
fi
#compositor managment on CMD line
if [ -z $USE_PIXMAN ];
then
echo "";
else
CMD_LINE_WESTON="$CMD_LINE_WESTON --use-pixman"
fi
#Addons paramaters
if [ -n $ST_WESTON_ADDONS ];
then
CMD_LINE_WESTON="$CMD_LINE_WESTON $ST_WESTON_ADDONS"
fi
# See how we were called.
case "$1" in
start)
if [ ! -z $LOG_FILE ];
then
echo "[SERVICE] start.........." >> $LOG_FILE
fi
echo "Starting Weston"
if [ -n "$DEBUG_OPENGL_VIA_OPENVT" ];
then
echo "[DEBUG] use script /tmp/launch_basic_weston.sh"
echo "[DEBUG] output saved on file $DEBUG_OPENGL_VIA_OPENVT"
#generate a wrapper script to launch weston
cat > /tmp/launch_basic_weston.sh << EOF
/usr/bin/weston $CMD_LINE_WESTON 2>&1 > $DEBUG_OPENGL_VIA_OPENVT
EOF
chmod +x /tmp/launch_basic_weston.sh
openvt -s -w -- /tmp/launch_basic_weston.sh
else
echo "/usr/bin/weston $CMD_LINE_WESTON"
openvt -s -w -- /usr/bin/weston $CMD_LINE_WESTON
# weston --tty=1 $CMD_LINE_WESTON
fi
;;
stop)
echo "Stopping Weston"
if [ ! -z $LOG_FILE ];
then
echo "[SERVICE] stop.........." >> $LOG_FILE
fi
pid_weston=`pidof weston`
kill -9 $pid_weston
;;
status)
if pidof weston >/dev/null
then
echo "Weston: running"
echo "CMDLINE of weston:"
echo " /usr/bin/weston $CMD_LINE_WESTON"
else
echo "Weston: not running"
exit 3
fi
exit 0
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: weston.sh {start|stop|status|restart}"
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,7 @@
[Unit]
Description=Weston, a Wayland compositor
Documentation=man:weston(1) man:weston.ini(5)
Documentation=https://wayland.freedesktop.org/
[Socket]
ListenStream=%t/wayland-0

View File

@@ -0,0 +1,13 @@
export XDG_RUNTIME_DIR=/run/user/`id -u weston`
export ELM_ENGINE=wayland_shm
export ECORE_EVAS_ENGINE=wayland_shm
export ECORE_EVAS_ENGINE=wayland_shm
export GDK_BACKEND=wayland
export PULSE_RUNTIME_PATH=/run/user/`id -u weston`
export USE_PLAYBIN3=1
export WAYLAND_DISPLAY=wayland-0
if [ -e $XDG_RUNTIME_DIR/wayland-1 ]; then
export WAYLAND_DISPLAY=wayland-1
fi

View File

@@ -0,0 +1,60 @@
From 454b7a0237be35a9b2d76b5ad5611c0b0ea7a802 Mon Sep 17 00:00:00 2001
From: Yannick Fertre <yannick.fertre@foss.st.com>
Date: Wed, 10 May 2023 17:26:33 +0200
Subject: [PATCH 1/4] Clone mode not supported
Display controller doesn't support several outputs.
During a head changed, get & close the weston head which is enabled.
Then an output can enabled (only one even if several output have
connected).
Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
---
compositor/main.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/compositor/main.c b/compositor/main.c
index 15f9d4e..3c239ba 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -2570,22 +2570,29 @@ drm_heads_changed(struct wl_listener *listener, void *arg)
/* We need to collect all cloned heads into outputs before enabling the
* output.
*/
+ while ((head = weston_compositor_iterate_heads(compositor, head))) {
+ enabled = weston_head_is_enabled(head);
+
+ if (enabled) {
+ drm_head_disable(head);
+ weston_head_reset_device_changed(head);
+ }
+ }
+
while ((head = weston_compositor_iterate_heads(compositor, head))) {
connected = weston_head_is_connected(head);
enabled = weston_head_is_enabled(head);
- changed = weston_head_is_device_changed(head);
forced = drm_head_should_force_enable(wet, head);
if ((connected || forced) && !enabled) {
+ /*
+ * Prepare & enable only the first head connected.
+ * CRTC doesn't support several output.
+ */
drm_head_prepare_enable(wet, head);
- } else if (!(connected || forced) && enabled) {
- drm_head_disable(head);
- } else if (enabled && changed) {
- weston_log("Detected a monitor change on head '%s', "
- "not bothering to do anything about it.\n",
- weston_head_get_name(head));
+ weston_head_reset_device_changed(head);
+ break;
}
- weston_head_reset_device_changed(head);
}
if (drm_process_layoutputs(wet) < 0)
--
2.25.1

View File

@@ -0,0 +1,33 @@
From 953cbf79c877b4bb4af7c54cfaa779da346513f5 Mon Sep 17 00:00:00 2001
From: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
Date: Fri, 24 Mar 2023 11:58:06 +0100
Subject: [PATCH 2/4] Disable request to EGL_DRM_RENDER_NODE_FILE_EXT
Depending on GPU userland implementationn the reqest of EGL_DRM_RENDER_NODE_FILE_EXT
return /dev/dri/renderD128 but this interface are not always present.
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
---
libweston/renderer-gl/egl-glue.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libweston/renderer-gl/egl-glue.c b/libweston/renderer-gl/egl-glue.c
index 8a0381c..90f499f 100644
--- a/libweston/renderer-gl/egl-glue.c
+++ b/libweston/renderer-gl/egl-glue.c
@@ -481,9 +481,9 @@ gl_renderer_set_egl_device(struct gl_renderer *gr)
gl_renderer_log_extensions(gr, "EGL device extensions", extensions);
/* Try to query the render node using EGL_DRM_RENDER_NODE_FILE_EXT */
- if (weston_check_egl_extension(extensions, "EGL_EXT_device_drm_render_node"))
- gr->drm_device = gr->query_device_string(gr->egl_device,
- EGL_DRM_RENDER_NODE_FILE_EXT);
+/* if (weston_check_egl_extension(extensions, "EGL_EXT_device_drm_render_node"))*/
+/* gr->drm_device = gr->query_device_string(gr->egl_device,*/
+/* EGL_DRM_RENDER_NODE_FILE_EXT);*/
/* The extension is not supported by the Mesa version of the system or
* the query failed. Fallback to EGL_DRM_DEVICE_FILE_EXT */
--
2.25.1

View File

@@ -0,0 +1,46 @@
From 3ca655e561099b11c70961c5132bbab8fa3f0c63 Mon Sep 17 00:00:00 2001
From: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com>
Date: Tue, 9 May 2023 15:06:09 +0200
Subject: [PATCH 3/4] Revert "compositor: improve opacity handling for scaled
surfaces"
This reverts commit 81912dc2a69f24c8fbcb43a2bc1f7860f3085c01.
---
libweston/compositor.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 6cfcba2..ff029f7 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -1581,6 +1581,7 @@ weston_view_update_transform_enable(struct weston_view *view)
surfbox = pixman_region32_extents(&surfregion);
view_compute_bbox(view, surfbox, &view->transform.boundingbox);
+ pixman_region32_fini(&surfregion);
if (view->alpha == 1.0 &&
matrix->type == WESTON_MATRIX_TRANSFORM_TRANSLATE) {
@@ -1598,19 +1599,7 @@ weston_view_update_transform_enable(struct weston_view *view)
matrix->d[12],
matrix->d[13]);
}
- } else if (view->alpha == 1.0 &&
- matrix->type < WESTON_MATRIX_TRANSFORM_ROTATE &&
- pixman_region32_n_rects(&surfregion) == 1 &&
- (pixman_region32_equal(&surfregion, &view->surface->opaque) ||
- view->surface->is_opaque)) {
- /* The whole surface is opaque and it is only translated and
- * scaled and after applying the scissor, the result is still
- * a single rectangle. In this case the boundingbox matches the
- * view exactly and can be used as opaque area. */
- pixman_region32_copy(&view->transform.opaque,
- &view->transform.boundingbox);
}
- pixman_region32_fini(&surfregion);
return 0;
}
--
2.25.1

View File

@@ -0,0 +1,78 @@
From 0e3325c8409aa73e9a4168caa4b41f26155770ca Mon Sep 17 00:00:00 2001
From: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com>
Date: Tue, 9 May 2023 15:06:25 +0200
Subject: [PATCH 4/4] Revert "compositor: set transform.opaque for surfaces
without alpha channel"
This reverts commit e2426960d479a84ad66ee865404a925d66d9a55b.
---
libweston/compositor.c | 46 +++++++++++++++++-------------------------
1 file changed, 18 insertions(+), 28 deletions(-)
diff --git a/libweston/compositor.c b/libweston/compositor.c
index ff029f7..867cb57 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -1525,20 +1525,15 @@ weston_view_update_transform_disable(struct weston_view *view)
view->geometry.x, view->geometry.y);
if (view->alpha == 1.0) {
- if (view->surface->is_opaque) {
- pixman_region32_copy(&view->transform.opaque,
- &view->transform.boundingbox);
- } else {
- pixman_region32_copy(&view->transform.opaque,
- &view->surface->opaque);
- if (view->geometry.scissor_enabled)
- pixman_region32_intersect(&view->transform.opaque,
- &view->transform.opaque,
- &view->geometry.scissor);
- pixman_region32_translate(&view->transform.opaque,
- view->geometry.x,
- view->geometry.y);
- }
+ pixman_region32_copy(&view->transform.opaque,
+ &view->surface->opaque);
+ if (view->geometry.scissor_enabled)
+ pixman_region32_intersect(&view->transform.opaque,
+ &view->transform.opaque,
+ &view->geometry.scissor);
+ pixman_region32_translate(&view->transform.opaque,
+ view->geometry.x,
+ view->geometry.y);
}
}
@@ -1585,20 +1580,15 @@ weston_view_update_transform_enable(struct weston_view *view)
if (view->alpha == 1.0 &&
matrix->type == WESTON_MATRIX_TRANSFORM_TRANSLATE) {
- if (view->surface->is_opaque) {
- pixman_region32_copy(&view->transform.opaque,
- &view->transform.boundingbox);
- } else {
- pixman_region32_copy(&view->transform.opaque,
- &view->surface->opaque);
- if (view->geometry.scissor_enabled)
- pixman_region32_intersect(&view->transform.opaque,
- &view->transform.opaque,
- &view->geometry.scissor);
- pixman_region32_translate(&view->transform.opaque,
- matrix->d[12],
- matrix->d[13]);
- }
+ pixman_region32_copy(&view->transform.opaque,
+ &view->surface->opaque);
+ if (view->geometry.scissor_enabled)
+ pixman_region32_intersect(&view->transform.opaque,
+ &view->transform.opaque,
+ &view->geometry.scissor);
+ pixman_region32_translate(&view->transform.opaque,
+ matrix->d[12],
+ matrix->d[13]);
}
return 0;
--
2.25.1

View File

@@ -0,0 +1,23 @@
FILESEXTRAPATHS:prepend:stm32mpcommon := "${THISDIR}/${PN}:"
SRC_URI:append:stm32mpcommon = " \
file://0001-Clone-mode-not-supported.patch \
file://0002-Disable-request-to-EGL_DRM_RENDER_NODE_FILE_EXT.patch \
file://0003-Revert-compositor-improve-opacity-handling-for-scale.patch \
file://0004-Revert-compositor-set-transform.opaque-for-surfaces-.patch \
"
SIMPLECLIENTS="egl,touch,dmabuf-v4l,dmabuf-egl"
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms wayland egl clients', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \
${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'sysvinit', 'launcher-libseat', '', d)} \
image-jpeg \
screenshare \
shell-desktop \
shell-fullscreen \
shell-kiosk \
"