lvgl-demo: remove vestigial Wayland logic
In platforms that support wayland/xwayland, dey-image-lvgl images have most weston/wayland packages removed from the filesystem, save for the main wayland package (because DISTRO_FEATURES still contains "wayland"). Because of this, the wait_for_wayland() function is called in lvgl-demo-init, but the wayland display never gets created, causing the function to time out after 20 seconds. Get rid of this check to have the lvgl-demo launch as soon as possible. While at it, get rid of other wayland-related logic, since we only use LVGL's drm or fbdev backends at the moment. Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
parent
619ca8b2a8
commit
21d9c4f17b
|
|
@ -16,8 +16,6 @@
|
||||||
readonly DEMO_NAME="lvgl-demo"
|
readonly DEMO_NAME="lvgl-demo"
|
||||||
readonly DEMO_PATH="/usr/bin/${DEMO_NAME}"
|
readonly DEMO_PATH="/usr/bin/${DEMO_NAME}"
|
||||||
readonly DEMO_TITLE="LVGL Demo Application"
|
readonly DEMO_TITLE="LVGL Demo Application"
|
||||||
readonly DEMO_DISPLAY="##LVGL_DEMO_DISPLAY##"
|
|
||||||
readonly DEMO_ENV="##LVGL_DEMO_ENV##"
|
|
||||||
readonly PID_FILE="/run/${DEMO_NAME}.pid"
|
readonly PID_FILE="/run/${DEMO_NAME}.pid"
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
|
|
@ -54,21 +52,6 @@ check_is_running() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_for_wayland() {
|
|
||||||
local count=20
|
|
||||||
local wayland_socket="/run/user/0/${DEMO_DISPLAY}"
|
|
||||||
|
|
||||||
while [ ! -S "${wayland_socket}" ]; do
|
|
||||||
sleep 1
|
|
||||||
count=$((count-1))
|
|
||||||
if [ "${count}" = 0 ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
sleep 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
check_is_running || return
|
check_is_running || return
|
||||||
|
|
||||||
|
|
@ -89,15 +72,11 @@ stop() {
|
||||||
start() {
|
start() {
|
||||||
check_is_running && { log warning "start: ${DEMO_NAME} ALREADY running"; exit 0; }
|
check_is_running && { log warning "start: ${DEMO_NAME} ALREADY running"; exit 0; }
|
||||||
|
|
||||||
if [ -d "/usr/share/wayland" ]; then
|
# Disable the cursor when displaying at full screen on fbdev
|
||||||
wait_for_wayland
|
echo "0" > /sys/class/graphics/fbcon/cursor_blink
|
||||||
else
|
|
||||||
# Disable the cursor when displaying at full screen on fbdev
|
|
||||||
echo "0" > /sys/class/graphics/fbcon/cursor_blink
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Launch demo
|
# Launch demo
|
||||||
env ${DEMO_ENV} ${DEMO_PATH} >/dev/null 2>&1 &
|
env ${DEMO_PATH} >/dev/null 2>&1 &
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo $! > ${PID_FILE}
|
echo $! > ${PID_FILE}
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,6 @@ inherit cmake systemd update-rc.d
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
LVGL_DEMO_ENV ?= "DISPLAY=:0.0 XDG_RUNTIME_DIR=/run/user/0 WAYLAND_DISPLAY=\$\{DEMO_DISPLAY\}"
|
|
||||||
LVGL_DEMO_ENV:ccimx6ul ?= ""
|
|
||||||
|
|
||||||
do_configure:prepend() {
|
do_configure:prepend() {
|
||||||
if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then
|
if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then
|
||||||
# Add libsdl build dependency, SDL2_image has no cmake file
|
# Add libsdl build dependency, SDL2_image has no cmake file
|
||||||
|
|
@ -66,9 +63,6 @@ do_install:append() {
|
||||||
# Install wrapper bootscript to launch LVGL demo on boot
|
# Install wrapper bootscript to launch LVGL demo on boot
|
||||||
install -d ${D}${sysconfdir}/init.d
|
install -d ${D}${sysconfdir}/init.d
|
||||||
install -m 0755 ${WORKDIR}/lvgl-demo-init ${D}${sysconfdir}/lvgl-demo-init
|
install -m 0755 ${WORKDIR}/lvgl-demo-init ${D}${sysconfdir}/lvgl-demo-init
|
||||||
sed -i -e "s@##LVGL_DEMO_DISPLAY##@${WAYLAND_DISPLAY}@g" \
|
|
||||||
-e "s@##LVGL_DEMO_ENV##@${LVGL_DEMO_ENV}@g" \
|
|
||||||
"${D}${sysconfdir}/lvgl-demo-init"
|
|
||||||
ln -sf ${sysconfdir}/lvgl-demo-init ${D}${sysconfdir}/init.d/lvgl-demo-init
|
ln -sf ${sysconfdir}/lvgl-demo-init ${D}${sysconfdir}/init.d/lvgl-demo-init
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue