diff --git a/Runner/config/pkg_command_map.conf b/Runner/config/pkg_command_map.conf index b2aa8271..d580db57 100755 --- a/Runner/config/pkg_command_map.conf +++ b/Runner/config/pkg_command_map.conf @@ -126,7 +126,8 @@ centos:package-set:bluetooth=bluez atheros-firmware expect # Weston compositor and example-client mappings. # # Debian and Ubuntu provide the Weston compositor and example clients from -# the weston package. +# the weston package. CentOS splits the compositor and demo clients between +# weston and weston-demo. # --------------------------------------------------------------------------- apt:weston=weston @@ -146,6 +147,20 @@ apt:package-set:weston-runtime=weston # package sets. apt:package-set:weston-runtime=weston libdrm-tests mesa-utils +centos:weston=weston +centos:weston-simple-egl=weston-demo +centos:weston-simple-shm=weston-demo +centos:weston-clickdot=weston-demo +centos:weston-cliptest=weston-demo +centos:weston-editor=weston-demo +centos:weston-flower=weston-demo +centos:weston-resizor=weston-demo +centos:weston-scaler=weston-demo +centos:weston-smoke=weston-demo +centos:eglinfo=egl-utils +centos:seatd=seatd +centos:package-set:weston-runtime=weston weston-demo seatd egl-utils + # --------------------------------------------------------------------------- # X11 graphics validation package sets. # @@ -218,6 +233,10 @@ rpm:gst-launch-1.0=gstreamer1.0-tools rpm:gst-inspect-1.0=gstreamer1.0-tools rpm:efivar=efivar +# CentOS Stream uses the upstream KMSCube RPM name. Keep this explicit so +# command recovery queries the configured CentOS repositories for kmscube. +centos:kmscube=kmscube + # CentOS Stream 10 Bluetooth command ownership. Keep these OS-specific so # Yocto RPM images retain their existing package policy. hciconfig and hcitool # are deprecated BlueZ tools and are not shipped by CentOS Stream 10 @@ -368,8 +387,8 @@ ubuntu:package-set:urm=userspace-resource-manager userspace-resource-manager-tes # for example: # ./run.sh --overlay # -# Debian packages are currently available from qli-staging. Once promoted to -# qli, only the source selection in the caller needs to change. CentOS packages +# Debian packages are currently available from qli-staging. Ubuntu packages +# come from the repositories already configured by the image. CentOS packages # use the Qualcomm production RPM repositories. # # DKMS packages are skipped by lib_pkg_provider.sh when matching kernel headers @@ -379,8 +398,10 @@ ubuntu:package-set:urm=userspace-resource-manager userspace-resource-manager-tes # No qcom-distro mapping is provided, so Yocto remains no-op. # --------------------------------------------------------------------------- -# Qualcomm proprietary graphics overlay package set. -debian:package-set:graphics=kgsl-dkms adreno-common libgbm-msm1 adreno-gles1 adreno-gles2 adreno-egl1 adreno-vulkan-icd adreno-opencl-icd adreno-opencl-dev +# Qualcomm proprietary graphics packages required by Weston EGL validation. +# Keep this set focused on KGSL, EGL, GLES, and the MSM GBM backend. Vulkan, +# OpenCL, and development packages are unrelated to this test path. +debian:package-set:graphics=kgsl-dkms adreno-common libgbm-msm1 adreno-gles1 adreno-gles2 adreno-egl1 # Upstream Debian Mesa/freedreno userspace required by the default KMSCube run. debian:package-set:graphics-base=libegl-mesa0 libgl1-mesa-dri libgbm1 libegl1 libgles2 mesa-utils @@ -388,12 +409,14 @@ debian:package-set:graphics-base=libegl-mesa0 libgl1-mesa-dri libgbm1 libegl1 li # Ubuntu uses the same Mesa/freedreno base userspace as Debian. ubuntu:package-set:graphics-base=libegl-mesa0 libgl1-mesa-dri libgbm1 libegl1 libgles2 mesa-utils -# Qualcomm proprietary graphics overlay package set for Ubuntu. -ubuntu:package-set:graphics=kgsl-dkms adreno-common libgbm-msm adreno-gles1 adreno-gles2 adreno-egl1 adreno-vulkan-icd adreno-opencl-icd adreno-opencl-dev +# Ubuntu Resolute uses the current qcom-adreno binary package family from its +# image-configured Qualcomm repository. Do not mix these packages with the +# Debian adreno package family from qli or qli-staging. +ubuntu:package-set:graphics=kgsl-dkms qcom-adreno-common1 libgbm-msm qcom-adreno-gles1 qcom-adreno-gles2 qcom-adreno-egl1 -# CentOS Stream 10 Qualcomm graphics overlay. gbm-msm-backend is listed -# explicitly because graphics validation checks the installed GBM backend. -centos:package-set:graphics=gbm-msm-backend adreno-egl1 adreno-gles2 adreno-opencl-icd adreno-vulkan-icd +# CentOS Stream 10 Qualcomm graphics overlay. The RPM subpackage names follow +# the public pkg-rpm-adreno packaging and include only the Weston EGL runtime. +centos:package-set:graphics=kgsl-dkms gbm-msm-backend adreno-common adreno-gles1 adreno-gles2 adreno-egl1 # --------------------------------------------------------------------------- # Audio validation package recovery. diff --git a/Runner/suites/Multimedia/Display/Weston_Runtime_Preflight/README_Weston_Runtime_Preflight.md b/Runner/suites/Multimedia/Display/Weston_Runtime_Preflight/README_Weston_Runtime_Preflight.md index 2e1d8273..e8444ff0 100644 --- a/Runner/suites/Multimedia/Display/Weston_Runtime_Preflight/README_Weston_Runtime_Preflight.md +++ b/Runner/suites/Multimedia/Display/Weston_Runtime_Preflight/README_Weston_Runtime_Preflight.md @@ -69,7 +69,7 @@ Relaunch mode ./run.sh --allow-relaunch -This mode enables an explicit recovery attempt for a broken systemd-managed Weston runtime. +This mode enables an explicit recovery attempt for a broken or absent Weston runtime. On desktop distributions without a packaged `weston.service`, the shared helper starts Weston directly on the dynamically selected DRM device. CentOS installs `seatd` with the Weston runtime package set and starts `seatd.service` when the direct DRM launcher needs a seat provider. In this mode, if Weston runtime is unhealthy, the testcase may: @@ -79,7 +79,7 @@ stop weston.service reset failed systemd state -restart the systemd-managed Weston runtime +restart the systemd-managed Weston runtime or launch the validated direct DRM runtime re-check Weston service state, runtime directory, Wayland socket, and compositor process diff --git a/Runner/suites/Multimedia/Display/weston-clickdot/README.md b/Runner/suites/Multimedia/Display/weston-clickdot/README.md index 1208d4e9..96d68fd4 100644 --- a/Runner/suites/Multimedia/Display/weston-clickdot/README.md +++ b/Runner/suites/Multimedia/Display/weston-clickdot/README.md @@ -3,6 +3,8 @@ Runs `weston-clickdot` inside an existing Wayland/Weston session and validates the client created and committed a Wayland surface using `WAYLAND_DEBUG` output. +On CentOS, the shared dependency path provides `weston`, `weston-demo`, `seatd`, and `egl-utils`. With `--allow-relaunch`, the test starts `seatd.service` when needed, launches Weston on the selected DRM device, and adopts the generated Wayland socket. + ## What it validates - A connected DRM display is present (otherwise SKIP) diff --git a/Runner/suites/Multimedia/Display/weston-cliptest/README.md b/Runner/suites/Multimedia/Display/weston-cliptest/README.md index 3079655c..db9ab7a7 100644 --- a/Runner/suites/Multimedia/Display/weston-cliptest/README.md +++ b/Runner/suites/Multimedia/Display/weston-cliptest/README.md @@ -3,6 +3,8 @@ Runs `weston-cliptest` inside an existing Wayland/Weston session and validates the client created and committed a Wayland surface using `WAYLAND_DEBUG` output. +On CentOS, the shared dependency path provides `weston`, `weston-demo`, `seatd`, and `egl-utils`. With `--allow-relaunch`, the test starts `seatd.service` when needed, launches Weston on the selected DRM device, and adopts the generated Wayland socket. + ## What it validates - A connected DRM display is present (otherwise SKIP) diff --git a/Runner/suites/Multimedia/Display/weston-editor/README.md b/Runner/suites/Multimedia/Display/weston-editor/README.md index b28ec28c..529e6940 100644 --- a/Runner/suites/Multimedia/Display/weston-editor/README.md +++ b/Runner/suites/Multimedia/Display/weston-editor/README.md @@ -3,6 +3,8 @@ Runs `weston-editor` inside an existing Wayland/Weston session and validates the client created and committed a Wayland surface using `WAYLAND_DEBUG` output. +On CentOS, the shared dependency path provides `weston`, `weston-demo`, `seatd`, and `egl-utils`. With `--allow-relaunch`, the test starts `seatd.service` when needed, launches Weston on the selected DRM device, and adopts the generated Wayland socket. + ## What it validates - A connected DRM display is present (otherwise SKIP) @@ -27,4 +29,3 @@ a Wayland surface using `WAYLAND_DEBUG` output. cd Runner/suites/Multimedia/Display/weston-editor ./run.sh cat weston-editor.res - diff --git a/Runner/suites/Multimedia/Display/weston-flower/README.md b/Runner/suites/Multimedia/Display/weston-flower/README.md index a001993e..177ada3e 100644 --- a/Runner/suites/Multimedia/Display/weston-flower/README.md +++ b/Runner/suites/Multimedia/Display/weston-flower/README.md @@ -2,6 +2,8 @@ Runs `weston-flower` under a working Wayland session (existing Weston or private Weston started by helpers) and validates that the client actually exercised Wayland. +On CentOS, the shared dependency path provides `weston`, `weston-demo`, `seatd`, and `egl-utils`. With `--allow-relaunch`, the test starts `seatd.service` when needed, launches Weston on the selected DRM device, and adopts the generated Wayland socket. + ## What this test validates - A connected DRM display exists (otherwise SKIP) diff --git a/Runner/suites/Multimedia/Display/weston-resizor/README.md b/Runner/suites/Multimedia/Display/weston-resizor/README.md index 10a17af7..4f6b0e41 100644 --- a/Runner/suites/Multimedia/Display/weston-resizor/README.md +++ b/Runner/suites/Multimedia/Display/weston-resizor/README.md @@ -3,6 +3,8 @@ Runs `weston-resizor` inside an existing Wayland/Weston session and validates the client created and committed a Wayland surface using `WAYLAND_DEBUG` output. +On CentOS, the shared dependency path provides `weston`, `weston-demo`, `seatd`, and `egl-utils`. With `--allow-relaunch`, the test starts `seatd.service` when needed, launches Weston on the selected DRM device, and adopts the generated Wayland socket. + ## What it validates - A connected DRM display is present (otherwise SKIP) diff --git a/Runner/suites/Multimedia/Display/weston-scaler/README.md b/Runner/suites/Multimedia/Display/weston-scaler/README.md index 9fb9b093..240832db 100644 --- a/Runner/suites/Multimedia/Display/weston-scaler/README.md +++ b/Runner/suites/Multimedia/Display/weston-scaler/README.md @@ -2,6 +2,8 @@ Runs `weston-scaler` as a Wayland client and validates it actually ran in a usable Wayland session. +On CentOS, the shared dependency path provides `weston`, `weston-demo`, `seatd`, and `egl-utils`. With `--allow-relaunch`, the test starts `seatd.service` when needed, launches Weston on the selected DRM device, and adopts the generated Wayland socket. + ## What this test validates 1. **Display presence (DRM connector)** diff --git a/Runner/suites/Multimedia/Display/weston-smoke/README.md b/Runner/suites/Multimedia/Display/weston-smoke/README.md index 9fad7c9b..40b8051c 100644 --- a/Runner/suites/Multimedia/Display/weston-smoke/README.md +++ b/Runner/suites/Multimedia/Display/weston-smoke/README.md @@ -2,6 +2,8 @@ Runs `weston-smoke` under a working Wayland session (existing Weston or private Weston started by helpers) and validates that the client actually exercised Wayland. +On CentOS, the shared dependency path provides `weston`, `weston-demo`, `seatd`, and `egl-utils`. With `--allow-relaunch`, the test starts `seatd.service` when needed, launches Weston on the selected DRM device, and adopts the generated Wayland socket. + ## What this test validates - A connected DRM display exists (otherwise SKIP) @@ -23,4 +25,3 @@ Runs `weston-smoke` under a working Wayland session (existing Weston or private - `weston-smoke.res` contains `weston-smoke PASS/FAIL/SKIP` - `weston-smoke_run.log` contains WAYLAND_DEBUG output when protocol validation is enabled - `weston-smoke_stdout_*.log` contains extra logs (including screenshot helper output) - diff --git a/Runner/suites/Multimedia/Graphics/KMSCube/README_KMSCube.md b/Runner/suites/Multimedia/Graphics/KMSCube/README_KMSCube.md index 6e0b26c0..e7848206 100644 --- a/Runner/suites/Multimedia/Graphics/KMSCube/README_KMSCube.md +++ b/Runner/suites/Multimedia/Graphics/KMSCube/README_KMSCube.md @@ -116,13 +116,19 @@ ensure EPEL and the Qualcomm CentOS 10 aarch64 and noarch repositories, refresh DNF metadata, and install the documented Adreno overlay packages: ```text -adreno-egl1 adreno-gles2 adreno-opencl-icd adreno-vulkan-icd +kgsl-dkms gbm-msm-backend adreno-common adreno-gles1 adreno-gles2 adreno-egl1 ``` The `gbm-msm-backend` dependency is tracked explicitly because this suite validates the Qualcomm GBM backend before running KMSCube. Yocto execution continues to use image-provided components. +`modetest` remains optional on CentOS because no verified `libdrm-tests` +package is available there. When `kmscube` is absent, the suite requests the +`kmscube` RPM from the configured CentOS repositories. If those repositories +do not publish the package, the suite reports an actionable SKIP asking for +the package to be published or provisioned in the image. + When the requested GPU stack has been installed but the running kernel still uses the opposite `msm.skip_gpu` policy, the suite reports SKIP with a reboot requirement. For example, overlay mode with `msm skip_gpu=N` requires a reboot diff --git a/Runner/suites/Multimedia/Graphics/KMSCube/run.sh b/Runner/suites/Multimedia/Graphics/KMSCube/run.sh index 3e5bf905..83f42a76 100755 --- a/Runner/suites/Multimedia/Graphics/KMSCube/run.sh +++ b/Runner/suites/Multimedia/Graphics/KMSCube/run.sh @@ -508,7 +508,7 @@ if [ "$OS_ID" = "centos" ]; then if ! CHECK_DEPS_RECOVER="$CHECK_DEPS_RECOVER" \ CHECK_DEPS_NO_EXIT=1 \ check_dependencies kmscube; then - log_skip "$TESTNAME SKIP - required command kmscube is absent from the CentOS image" + log_skip "$TESTNAME SKIP - kmscube is unavailable from the configured CentOS repositories, publish or provision the kmscube package" echo "$TESTNAME SKIP" >"$RES_FILE" exit 0 fi diff --git a/Runner/suites/Multimedia/Graphics/weston-simple-egl/README_weston-simple-egl.md b/Runner/suites/Multimedia/Graphics/weston-simple-egl/README_weston-simple-egl.md index 058e193f..6700ac84 100755 --- a/Runner/suites/Multimedia/Graphics/weston-simple-egl/README_weston-simple-egl.md +++ b/Runner/suites/Multimedia/Graphics/weston-simple-egl/README_weston-simple-egl.md @@ -16,7 +16,7 @@ This suite validates OpenGL ES 2.0 through the `weston-simple-egl` Wayland clien ## Prerequisites -Yocto images must provide the required client and Weston runtime. On Ubuntu and Debian, the shared package provider ensures the mapped Weston and graphics packages. +Yocto images must provide the required client and Weston runtime. Debian and Ubuntu recover Weston from `weston`. CentOS recovers the compositor from `weston`, the example clients from `weston-demo`, the DRM seat provider from `seatd`, and `/usr/bin/eglinfo` from `egl-utils`. Overlay mode first accepts a complete image-provided Qualcomm EGL, GBM, and KGSL runtime. When graphics recovery is needed, it uses the distro-specific package family and repository policy. - `weston-simple-egl` (Binary Available in /usr/bin) be default - Write access to root filesystem (for environment setup) @@ -24,11 +24,13 @@ Yocto images must provide the required client and Weston runtime. On Ubuntu and ## Desktop distribution modes - `./run.sh --base` selects the upstream MSM/freedreno stack and ensures the OS-specific Mesa package set. -- `./run.sh --overlay` selects the Qualcomm KGSL/Adreno stack and ensures the OS-specific overlay package set. Package or DKMS changes can require a reboot before validation continues. -- Debian uses `libgbm-msm1`, while Ubuntu uses `libgbm-msm`. Set `GPU_OVERLAY_GBM_PACKAGE` only when an explicit override is required. +- `./run.sh --overlay` selects the Qualcomm KGSL/Adreno stack. A ready runtime is reused without package changes. Otherwise, the focused EGL/GLES package set is recovered and DKMS changes can require a reboot before validation continues. +- Debian uses the `adreno-*` packages from `qli-staging`. Ubuntu uses the `qcom-adreno-*` packages and existing image APT sources, never Debian `qli` or `qli-staging`. CentOS uses the `adreno-*` RPMs from the configured Qualcomm RPM repositories. +- The MSM GBM package is resolved from the distro package map: `libgbm-msm1` on Debian, `libgbm-msm` on Ubuntu, and `gbm-msm-backend` on CentOS. Set `GPU_OVERLAY_GBM_PACKAGE` only when an explicit override is required. - Desktop automatic mode runs `weston-simple-egl -b` when the client advertises that option. This is an unsynchronized EGL throughput benchmark with a minimum functional FPS gate, not a display-refresh measurement. - Yocto, other image-based runs, and `--strict-refresh-fps` keep the compositor-synchronized client mode. FPS evidence remains required by default. Use `--no-require-fps` only when connectivity and EGL execution are the intended coverage. - On Ubuntu, the test reuses an active GNOME Wayland session when Weston is not running. A root-launched test executes the client as the Wayland socket owner without stopping or restarting GDM. +- On desktop distributions without a packaged `weston.service`, `--allow-relaunch` starts Weston directly on the dynamically selected DRM device and validates the resulting Wayland socket before launching the client. On CentOS, the shared runtime preparation starts the packaged `seatd.service` when needed. It does not enable the service persistently. - GDM can throttle an unfocused greeter client. That path validates compositor connectivity and EGL startup while recording, but not performance-gating, any FPS samples. Examples: diff --git a/Runner/suites/Multimedia/Graphics/weston-simple-shm/weston-simple-shm_README.md b/Runner/suites/Multimedia/Graphics/weston-simple-shm/weston-simple-shm_README.md index 1382e078..559bd85e 100644 --- a/Runner/suites/Multimedia/Graphics/weston-simple-shm/weston-simple-shm_README.md +++ b/Runner/suites/Multimedia/Graphics/weston-simple-shm/weston-simple-shm_README.md @@ -74,6 +74,8 @@ Before running the testcase, ensure that: - the target has the required Wayland runtime environment - the display stack is already brought up on the system +On CentOS, the shared dependency path provides `weston`, `weston-demo`, `seatd`, and `egl-utils`. With `--allow-relaunch`, the test starts `seatd.service` when needed, launches Weston on the selected DRM device, and adopts the generated Wayland socket. + --- ## Test Location diff --git a/Runner/utils/lib_display.sh b/Runner/utils/lib_display.sh index 8a1d6bf7..df84a9ed 100755 --- a/Runner/utils/lib_display.sh +++ b/Runner/utils/lib_display.sh @@ -3012,12 +3012,31 @@ weston_prepare_runtime() { wr_wait_secs="${2:-10}" wr_validate_mode="${3:-runtime}" wr_allow_relaunch="${4:-0}" + wr_os_id="unknown" + wr_desktop_os=0 DISPLAY_WAYLAND_SOCKET="" DISPLAY_RUNTIME_MODEL="unknown" export DISPLAY_WAYLAND_SOCKET export DISPLAY_RUNTIME_MODEL + if command -v pkg_detect_os_id >/dev/null 2>&1; then + wr_os_id="$(pkg_detect_os_id 2>/dev/null || true)" + elif [ -r /etc/os-release ]; then + wr_os_id="$( + sed -n 's/^ID=//p' /etc/os-release | + head -n 1 | + tr -d '"' | + tr '[:upper:]' '[:lower:]' + )" + fi + + case "$wr_os_id" in + debian|ubuntu|centos|rhel|fedora) + wr_desktop_os=1 + ;; + esac + if [ -z "${DISPLAY_BUILD_FLAVOUR:-}" ]; then display_detect_build_flavour fi @@ -3138,6 +3157,14 @@ weston_prepare_runtime() { log_warn "Preparing Weston runtime relaunch, cleaning stale systemd state first" if command -v systemd_service_exists >/dev/null 2>&1 && systemd_service_exists weston.service; then + if [ "$wr_os_id" = "centos" ]; then + if ! command -v display_prepare_desktop_weston_seat >/dev/null 2>&1 || + ! display_prepare_desktop_weston_seat; then + log_fail "Weston relaunch attempt failed, desktop seat provider could not be prepared" + return 3 + fi + fi + if ! weston_restart_systemd_runtime "$wr_wait_secs"; then if command -v weston_log_runtime_snapshot >/dev/null 2>&1; then weston_log_runtime_snapshot "${wr_testname}: after-relaunch" @@ -3145,6 +3172,19 @@ weston_prepare_runtime() { log_fail "Weston relaunch attempt failed, systemd-managed Weston could not be recovered" return 3 fi + elif [ "$wr_desktop_os" -eq 1 ] && + command -v display_prepare_desktop_weston_runtime >/dev/null 2>&1; then + log_info "Relaunch path, starting desktop Weston directly on the selected DRM device" + + if ! display_prepare_desktop_weston_runtime \ + "$wr_testname" \ + "$wr_wait_secs"; then + if command -v weston_log_runtime_snapshot >/dev/null 2>&1; then + weston_log_runtime_snapshot "${wr_testname}: after-relaunch" + fi + log_fail "Weston relaunch attempt failed, desktop DRM runtime could not be prepared" + return 3 + fi elif command -v weston_restore_runtime >/dev/null 2>&1; then log_info "Attempting weston_restore_runtime" if ! weston_restore_runtime "$wr_wait_secs"; then @@ -3331,7 +3371,7 @@ weston_prepare_runtime() { # # Args: # $1 - package-set name, default: graphics -# $2 - Debusine source, default: qli-staging +# $2 - Debusine source, default: qli-staging on Debian and none elsewhere # $3 - Debusine suite, default: auto # # Return: @@ -3339,8 +3379,9 @@ weston_prepare_runtime() { # 1 - package-set recovery failed display_ensure_graphics_package_set() { graphics_set_name="${1:-graphics}" - graphics_source="${2:-qli-staging}" + graphics_source="${2:-}" graphics_suite="${3:-auto}" + graphics_os_id="" if [ -z "${TOOLS:-}" ] || [ ! -f "$TOOLS/lib_pkg_provider.sh" ]; then log_warn "Package provider helper not found; continuing without graphics package recovery" @@ -3353,6 +3394,23 @@ display_ensure_graphics_package_set() { # Load provider config first. Otherwise pkg_provider.conf can overwrite # caller-provided/default values such as apt_debusine_source. pkg_provider_init || true + graphics_os_id="$(pkg_detect_os_id 2>/dev/null || true)" + + case "$graphics_os_id" in + ubuntu) + graphics_source="none" + ;; + debian) + if [ -z "$graphics_source" ]; then + graphics_source="qli-staging" + fi + ;; + *) + if [ -z "$graphics_source" ]; then + graphics_source="none" + fi + ;; + esac old_graphics_source="${PKG_APT_DEBUSINE_SOURCE:-none}" old_graphics_suite="${PKG_APT_DEBUSINE_SUITE:-auto}" @@ -3381,6 +3439,51 @@ display_ensure_graphics_package_set() { pkg_ensure_package_set "$graphics_set_name" } +# Print the first package in a mapped set that matches an extended regex. +# Diagnostics are intentionally omitted because callers use command substitution. +display_package_set_member_matching() { + dpsmm_set_name="$1" + dpsmm_pattern="$2" + dpsmm_packages="" + + if [ -z "$dpsmm_set_name" ] || [ -z "$dpsmm_pattern" ] || + ! command -v pkg_lookup_package_set >/dev/null 2>&1; then + return 1 + fi + + dpsmm_packages="$(pkg_lookup_package_set "$dpsmm_set_name" 2>/dev/null || true)" + + for dpsmm_package in $dpsmm_packages; do + if printf '%s\n' "$dpsmm_package" | grep -Eq "$dpsmm_pattern"; then + printf '%s\n' "$dpsmm_package" + return 0 + fi + done + + return 1 +} + +# Print the first installed Qualcomm MSM GBM backend found in standard libdirs. +# Diagnostics are intentionally omitted because callers use command substitution. +display_find_msm_gbm_backend() { + for dfmgb_dir in \ + /usr/lib/gbm \ + /usr/lib64/gbm \ + /usr/lib/*/gbm \ + /lib/gbm \ + /lib64/gbm \ + /lib/*/gbm; do + [ -d "$dfmgb_dir" ] || continue + + if [ -f "$dfmgb_dir/msm_gbm.so" ]; then + printf '%s\n' "$dfmgb_dir/msm_gbm.so" + return 0 + fi + done + + return 1 +} + ############################################################################### # GLVND EGL vendor selection ############################################################################### @@ -4799,10 +4902,12 @@ display_get_primary_refresh_hz() { # - minimal Weston package/client recovery on apt systems # - the already validated base/overlay graphics-stack transitions # - the existing image-managed Yocto Weston lifecycle +# - explicit desktop relaunch through the shared direct DRM helper # - testcase FPS policy # # It does not create users, TTY sessions, PAM configuration, udev rules, -# systemd units, seatd instances, or standalone Weston processes. +# persistent systemd units, or standalone seatd instances. On CentOS, it may +# start the image-provided seatd.service for the direct DRM runtime. ############################################################################### display_ensure_weston_test_dependencies() { @@ -4845,9 +4950,20 @@ display_ensure_weston_test_dependencies() { dewtd_dependencies="$dewtd_client weston" ;; - centos|rhel|fedora) - # RPM package names vary by release and repository. Keep this path - # check-only until explicit validated mappings are added. + centos) + if [ "$dewtd_provider" = "rpm" ] && + command -v pkg_ensure_required_package_set_present >/dev/null 2>&1; then + if ! pkg_ensure_required_package_set_present weston-runtime; then + log_fail "Failed to ensure the minimal CentOS Weston runtime package set" + return 1 + fi + fi + + dewtd_dependencies="$dewtd_client weston" + ;; + + rhel|fedora) + # RPM package names can differ outside the validated CentOS path. dewtd_dependencies="$dewtd_client weston" ;; @@ -5228,6 +5344,63 @@ display_start_transient_weston_runtime() { return 0 } +# Ensure the CentOS Weston DRM launcher has a usable seat provider. +# The Weston RPM uses libseat, while the target-validated CentOS flow requires +# the packaged seatd service when the invoking shell is not a logind session. +# Other distributions keep their existing logind or image-managed seat policy. +display_prepare_desktop_weston_seat() { + dpdws_os_id="unknown" + dpdws_wait=0 + + if command -v pkg_detect_os_id >/dev/null 2>&1; then + dpdws_os_id="$(pkg_detect_os_id 2>/dev/null || true)" + elif [ -r /etc/os-release ]; then + dpdws_os_id="$( + sed -n 's/^ID=//p' /etc/os-release | + head -n 1 | + tr -d '"' | + tr '[:upper:]' '[:lower:]' + )" + fi + + [ "$dpdws_os_id" = "centos" ] || return 0 + + if ! command -v systemd_service_exists >/dev/null 2>&1 || + ! command -v systemd_service_is_active >/dev/null 2>&1 || + ! command -v systemd_service_start_safe >/dev/null 2>&1; then + log_error "Cannot prepare the CentOS Weston seat, shared systemd service helpers are unavailable" + return 1 + fi + + if ! systemd_service_exists seatd.service; then + log_error "Cannot prepare the CentOS Weston seat, seatd.service is unavailable after package recovery" + return 1 + fi + + if ! systemd_service_is_active seatd.service 2>/dev/null; then + log_info "Starting seatd.service for the CentOS Weston DRM runtime" + + if ! systemd_service_start_safe seatd.service; then + log_error "Failed to start seatd.service for the CentOS Weston DRM runtime" + return 1 + fi + fi + + while [ "$dpdws_wait" -lt 5 ]; do + if systemd_service_is_active seatd.service 2>/dev/null && + [ -S /run/seatd.sock ]; then + log_pass "CentOS Weston seat provider is ready, service=seatd.service socket=/run/seatd.sock" + return 0 + fi + + sleep 1 + dpdws_wait=$((dpdws_wait + 1)) + done + + log_error "CentOS Weston seat provider is not ready, expected active seatd.service and /run/seatd.sock" + return 1 +} + ############################################################################### # Desktop Weston runtime, manual command promoted to shared helper # @@ -5383,6 +5556,10 @@ display_prepare_desktop_weston_runtime() { return 1 fi + if ! display_prepare_desktop_weston_seat; then + return 1 + fi + if ! command -v display_select_primary_drm_device >/dev/null 2>&1; then log_error "Cannot start desktop Weston, DRM selection helper is unavailable" return 1 @@ -5565,16 +5742,21 @@ display_prepare_desktop_graphics_stack() { dpdgs_dkms_package="kgsl-dkms" dpdgs_dkms_before="" dpdgs_dkms_after="" + dpdgs_os_id="" + dpdgs_apt_source="none" + dpdgs_gbm_path="" + dpdgs_mapped_gbm_package="" - if [ -z "$dpdgs_gbm_package" ]; then - if command -v pkg_detect_os_id >/dev/null 2>&1 && - [ "$(pkg_detect_os_id 2>/dev/null || true)" = "ubuntu" ]; then - dpdgs_gbm_package="libgbm-msm" - else - dpdgs_gbm_package="libgbm-msm1" - fi + if command -v pkg_detect_os_id >/dev/null 2>&1; then + dpdgs_os_id="$(pkg_detect_os_id 2>/dev/null || true)" fi + case "$dpdgs_os_id" in + debian) + dpdgs_apt_source="qli-staging" + ;; + esac + case "$dpdgs_mode" in auto) log_info "Desktop graphics mode is auto, preserving the currently installed and booted stack" @@ -5583,6 +5765,9 @@ display_prepare_desktop_graphics_stack() { overlay) for dpdgs_helper in \ + display_detect_build_flavour \ + display_find_msm_gbm_backend \ + display_package_set_member_matching \ pkg_package_set_contains \ pkg_ensure_optional_package_set_present \ pkg_installed_package_version \ @@ -5595,6 +5780,46 @@ display_prepare_desktop_graphics_stack() { fi done + display_detect_build_flavour + dpdgs_gbm_path="$(display_find_msm_gbm_backend 2>/dev/null || true)" + + if [ "${DISPLAY_BUILD_FLAVOUR:-base}" = "overlay" ] && + [ -n "$dpdgs_gbm_path" ]; then + mrv_qcom_gpu_validate_boot_mode \ + kgsl \ + "$dpdgs_gpu_module" \ + "$dpdgs_gpu_device" \ + msm + dpdgs_rc=$? + + if [ "$dpdgs_rc" -eq 0 ] && + display_select_egl_vendor adreno; then + log_pass "Qualcomm overlay runtime is already ready, EGL vendor=${DISPLAY_EGL_VENDOR_JSON:-unknown} GBM backend=$dpdgs_gbm_path" + return 0 + fi + fi + + if [ -z "$dpdgs_gbm_package" ] || + ! pkg_package_set_contains graphics "$dpdgs_gbm_package"; then + dpdgs_mapped_gbm_package="$( + display_package_set_member_matching \ + graphics \ + '^(libgbm-msm1?|gbm-msm-backend)$' || true + )" + + if [ -n "$dpdgs_mapped_gbm_package" ] && + [ "$dpdgs_mapped_gbm_package" != "$dpdgs_gbm_package" ]; then + log_info "Using mapped Qualcomm GBM package for os=${dpdgs_os_id:-unknown}, package=$dpdgs_mapped_gbm_package" + fi + + dpdgs_gbm_package="$dpdgs_mapped_gbm_package" + fi + + if [ -z "$dpdgs_gbm_package" ]; then + log_fail "$dpdgs_testname FAIL - graphics package set has no supported Qualcomm MSM GBM backend package" + return 1 + fi + if ! pkg_package_set_contains graphics "$dpdgs_gbm_package"; then log_fail "$dpdgs_testname FAIL - graphics package set is incomplete, missing $dpdgs_gbm_package" return 1 @@ -5607,7 +5832,7 @@ display_prepare_desktop_graphics_stack() { if ! pkg_ensure_optional_package_set_present \ graphics \ - qli-staging \ + "$dpdgs_apt_source" \ auto \ --overlay; then log_fail "$dpdgs_testname FAIL - failed to ensure Qualcomm graphics overlay package set"