added my Recipes
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
PACKAGECONFIG = " ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl glesv2', '', d)} \
|
||||
"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${bindir}/
|
||||
install -m 0755 ${B}/util/cairo-trace/cairo-trace ${D}${bindir}/
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
PACKAGECONFIG = "gstreamer"
|
||||
DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base"
|
||||
@@ -0,0 +1,16 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
|
||||
|
||||
PACKAGECONFIG_GL = ""
|
||||
PACKAGECONFIG ??= " \
|
||||
${PACKAGECONFIG_GL} \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
|
||||
${@bb.utils.contains("TUNE_FEATURES", "neon","arm-neon","",d)} \
|
||||
kmsdrm \
|
||||
"
|
||||
|
||||
EXTRA_OECMAKE += " \
|
||||
-DSDL_VIVANTE=OFF \
|
||||
-DSDL_VULKAN=OFF \
|
||||
-DSDL_OPENGL=OFF \
|
||||
"
|
||||
@@ -0,0 +1,5 @@
|
||||
PACKAGECONFIG = "drm osmesa freetype2 gbm egl gles1 gles2 \
|
||||
x11 glew glu glx \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
|
||||
"
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From f1482e88c2295b9c7288f5b273335a8e18039de8 Mon Sep 17 00:00:00 2001
|
||||
From: Fabio Berton <fabio.berton@ossystems.com.br>
|
||||
Date: Wed, 12 Jun 2019 14:18:31 -0300
|
||||
Subject: [PATCH] Allow enable DRI without DRI drivers
|
||||
Organization: O.S. Systems Software LTDA.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
|
||||
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
|
||||
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
||||
---
|
||||
meson.build | 2 +-
|
||||
meson_options.txt | 6 ++++++
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 0e50bb26c0a..de065c290d6 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -137,7 +137,7 @@ with_dri_r200 = dri_drivers.contains('r200')
|
||||
with_dri_nouveau = dri_drivers.contains('nouveau')
|
||||
with_dri_swrast = dri_drivers.contains('swrast')
|
||||
|
||||
-with_dri = dri_drivers.length() != 0 and dri_drivers != ['']
|
||||
+with_dri = get_option('dri') or (dri_drivers.length() != 0 and dri_drivers != [''])
|
||||
|
||||
gallium_drivers = get_option('gallium-drivers')
|
||||
if gallium_drivers.contains('auto')
|
||||
diff --git a/meson_options.txt b/meson_options.txt
|
||||
index fcd49efea27..0529200b3bb 100644
|
||||
--- a/meson_options.txt
|
||||
+++ b/meson_options.txt
|
||||
@@ -34,6 +34,12 @@ option(
|
||||
choices : ['auto', 'true', 'false'],
|
||||
description : 'enable support for dri3'
|
||||
)
|
||||
+option(
|
||||
+ 'dri',
|
||||
+ type : 'boolean',
|
||||
+ value : false,
|
||||
+ description : 'enable support for dri'
|
||||
+)
|
||||
option(
|
||||
'dri-drivers',
|
||||
type : 'array',
|
||||
@@ -0,0 +1 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
SRC_URI += "file://0001-linux-dmabuf-Add-support-for-YUV-Full-color-range.patch"
|
||||
|
||||
@@ -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"
|
||||
@@ -0,0 +1,2 @@
|
||||
SUBSYSTEMS=="graphics_class", KERNEL=="galcore", GROUP="video", MODE="0666"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
SUBSYSTEMS=="drm", ACTION=="change", RUN+="/usr/bin/pulseaudio_hdmi_switch.sh"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -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 |
121
meta-st/meta-st-openstlinux/recipes-graphics/wayland/weston-init/check-gpu
Executable file
121
meta-st/meta-st-openstlinux/recipes-graphics/wayland/weston-init/check-gpu
Executable 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
|
||||
@@ -0,0 +1,3 @@
|
||||
DEFAULT_PULSE_AUDIO_LOCAL_PROFILE=output:analog-stereo
|
||||
DEFAULT_PULSE_AUDIO_HDMI_PROFILE=output:hdmi-stereo
|
||||
|
||||
@@ -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 |
@@ -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 |
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 \
|
||||
"
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
From 8cb96d48a8f3fc49bd9e63255e41eb0976d82f8c Mon Sep 17 00:00:00 2001
|
||||
From: Christophe Priouzeau <christophe.priouzeau@st.com>
|
||||
Date: Tue, 23 Apr 2019 17:18:15 +0200
|
||||
Subject: [PATCH] NV12-format-support
|
||||
|
||||
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
|
||||
---
|
||||
pixman/pixman-access.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
pixman/pixman.c | 3 +-
|
||||
pixman/pixman.h | 5 +++-
|
||||
3 files changed, 85 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c
|
||||
index 8dfd35f..a462b27 100644
|
||||
--- a/pixman/pixman-access.c
|
||||
+++ b/pixman/pixman-access.c
|
||||
@@ -845,6 +845,46 @@ fetch_scanline_yv12 (bits_image_t *image,
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+fetch_scanline_nv12 (bits_image_t *image,
|
||||
+ int x,
|
||||
+ int line,
|
||||
+ int width,
|
||||
+ uint32_t * buffer,
|
||||
+ const uint32_t *mask)
|
||||
+{
|
||||
+ uint8_t *bits = (uint8_t *) image->bits;
|
||||
+ int stride = image->rowstride * sizeof (uint32_t);
|
||||
+ int offset_uv = stride * image->height;
|
||||
+ uint8_t *y_line, *uv_line;
|
||||
+ int i;
|
||||
+
|
||||
+ y_line = bits + (stride * line);
|
||||
+ uv_line = bits + offset_uv + (stride * (line >>1));
|
||||
+
|
||||
+ for (i = 0; i < width; i++)
|
||||
+ {
|
||||
+ int16_t y, u, v;
|
||||
+ int32_t r, g, b;
|
||||
+
|
||||
+ y = *(y_line + x + i) - 16;
|
||||
+ u = *(uv_line + ((x + i) & ~1)) - 128;
|
||||
+ v = *(uv_line + ((x + i) & ~1) + 1) - 128;
|
||||
+
|
||||
+ /* R = 1.164(Y - 16) + 1.596(V - 128) */
|
||||
+ r = 0x012b27 * y + 0x019a2e * v;
|
||||
+ /* G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128) */
|
||||
+ g = 0x012b27 * y - 0x00d0f2 * v - 0x00647e * u;
|
||||
+ /* B = 1.164(Y - 16) + 2.018(U - 128) */
|
||||
+ b = 0x012b27 * y + 0x0206a2 * u;
|
||||
+
|
||||
+ *buffer++ = 0xff000000 |
|
||||
+ (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) |
|
||||
+ (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) |
|
||||
+ (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/**************************** Pixel wise fetching *****************************/
|
||||
|
||||
#ifndef PIXMAN_FB_ACCESSORS
|
||||
@@ -1036,6 +1076,40 @@ fetch_pixel_yv12 (bits_image_t *image,
|
||||
(b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0);
|
||||
}
|
||||
|
||||
+static uint32_t
|
||||
+fetch_pixel_nv12 (bits_image_t *image,
|
||||
+ int offset,
|
||||
+ int line)
|
||||
+{
|
||||
+ uint8_t *bits = (uint8_t *) image->bits;
|
||||
+ int stride = image->rowstride * sizeof (uint32_t);
|
||||
+ int offset_uv = stride * image->height;
|
||||
+ uint8_t *y_bits, *uv_bits;
|
||||
+ int16_t y, u, v;
|
||||
+ int32_t r, g, b;
|
||||
+
|
||||
+ y_bits = bits + (stride * line) + offset;
|
||||
+ uv_bits = bits + offset_uv + (stride * (line >>1)) + (offset & ~1);
|
||||
+
|
||||
+ y = *y_bits - 16;
|
||||
+ u = *uv_bits- 128;
|
||||
+ v = *(uv_bits + 1) - 128;
|
||||
+
|
||||
+ /* R = 1.164(Y - 16) + 1.596(V - 128) */
|
||||
+ r = 0x012b27 * y + 0x019a2e * v;
|
||||
+
|
||||
+ /* G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128) */
|
||||
+ g = 0x012b27 * y - 0x00d0f2 * v - 0x00647e * u;
|
||||
+
|
||||
+ /* B = 1.164(Y - 16) + 2.018(U - 128) */
|
||||
+ b = 0x012b27 * y + 0x0206a2 * u;
|
||||
+
|
||||
+ return 0xff000000 |
|
||||
+ (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) |
|
||||
+ (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) |
|
||||
+ (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0);
|
||||
+}
|
||||
+
|
||||
/*********************************** Store ************************************/
|
||||
|
||||
#ifndef PIXMAN_FB_ACCESSORS
|
||||
@@ -1509,6 +1583,11 @@ static const format_info_t accessors[] =
|
||||
fetch_pixel_yv12, fetch_pixel_generic_float,
|
||||
NULL, NULL },
|
||||
|
||||
+ { PIXMAN_nv12,
|
||||
+ fetch_scanline_nv12, fetch_scanline_generic_float,
|
||||
+ fetch_pixel_nv12, fetch_pixel_generic_float,
|
||||
+ NULL, NULL },
|
||||
+
|
||||
{ PIXMAN_null },
|
||||
};
|
||||
|
||||
diff --git a/pixman/pixman.c b/pixman/pixman.c
|
||||
index c09b528..d8a2d24 100644
|
||||
--- a/pixman/pixman.c
|
||||
+++ b/pixman/pixman.c
|
||||
@@ -1070,6 +1070,7 @@ pixman_format_supported_source (pixman_format_code_t format)
|
||||
/* YUV formats */
|
||||
case PIXMAN_yuy2:
|
||||
case PIXMAN_yv12:
|
||||
+ case PIXMAN_nv12:
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
@@ -1092,7 +1093,7 @@ PIXMAN_EXPORT pixman_bool_t
|
||||
pixman_format_supported_destination (pixman_format_code_t format)
|
||||
{
|
||||
/* YUV formats cannot be written to at the moment */
|
||||
- if (format == PIXMAN_yuy2 || format == PIXMAN_yv12)
|
||||
+ if (format == PIXMAN_yuy2 || format == PIXMAN_yv12 || format == PIXMAN_nv12)
|
||||
return FALSE;
|
||||
|
||||
return pixman_format_supported_source (format);
|
||||
diff --git a/pixman/pixman.h b/pixman/pixman.h
|
||||
index d644589..e8fa8da 100644
|
||||
--- a/pixman/pixman.h
|
||||
+++ b/pixman/pixman.h
|
||||
@@ -691,6 +691,8 @@ struct pixman_indexed
|
||||
#define PIXMAN_TYPE_RGBA 9
|
||||
#define PIXMAN_TYPE_ARGB_SRGB 10
|
||||
#define PIXMAN_TYPE_RGBA_FLOAT 11
|
||||
+#define PIXMAN_TYPE_NV12 12
|
||||
+
|
||||
|
||||
#define PIXMAN_FORMAT_COLOR(f) \
|
||||
(PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_ARGB || \
|
||||
@@ -772,7 +774,8 @@ typedef enum {
|
||||
|
||||
/* YUV formats */
|
||||
PIXMAN_yuy2 = PIXMAN_FORMAT(16,PIXMAN_TYPE_YUY2,0,0,0,0),
|
||||
- PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0)
|
||||
+ PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0),
|
||||
+ PIXMAN_nv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_NV12,0,0,0,0)
|
||||
} pixman_format_code_t;
|
||||
|
||||
/* Querying supported format values. */
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# look for files in the layer first
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
SRC_URI += "file://0001-NV12-format-support.patch"
|
||||
@@ -0,0 +1,5 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
PACKAGECONFIG = "${XORG_CRYPTO} "
|
||||
|
||||
DEPENDS += "libxshmfence"
|
||||
Reference in New Issue
Block a user