diff --git a/.gitlab-ci/common/init-stage2.sh b/.gitlab-ci/common/init-stage2.sh index 426ff879563..4e7921f7ce5 100755 --- a/.gitlab-ci/common/init-stage2.sh +++ b/.gitlab-ci/common/init-stage2.sh @@ -187,22 +187,14 @@ if [ -n "$HWCI_START_XORG" ]; then fi if [ -n "$HWCI_START_WESTON" ]; then - WESTON_X11_SOCK="/tmp/.X11-unix/X0" if [ -n "$HWCI_START_XORG" ]; then echo "Please consider dropping HWCI_START_XORG and instead using Weston XWayland for testing." + # shellcheck disable=2034 WESTON_X11_SOCK="/tmp/.X11-unix/X1" fi - WAYLAND_DISPLAY=wayland-0 - # Display server is Weston Xwayland when HWCI_START_XORG is not set or Xorg when it's - export DISPLAY=:0 - mkdir -p /tmp/.X11-unix - - weston --config="/install/common/weston.ini" --socket="$WAYLAND_DISPLAY" --renderer=gl & + . /install/common/weston.sh --renderer=gl BACKGROUND_PIDS="$! $BACKGROUND_PIDS" - export WAYLAND_DISPLAY - - while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done fi set +x diff --git a/.gitlab-ci/common/weston.sh b/.gitlab-ci/common/weston.sh new file mode 100755 index 00000000000..5ab5b40f4d7 --- /dev/null +++ b/.gitlab-ci/common/weston.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +CI_COMMON_DIR=$(dirname -- "${BASH_SOURCE[0]}") + +# init-stage2.sh overwrites this when xorg is already started +WESTON_X11_SOCK=${WESTON_X11_SOCK:-/tmp/.X11-unix/X0} +mkdir -p /tmp/.X11-unix +export DISPLAY=:0 + +WAYLAND_DISPLAY=wayland-0 +weston --config="$CI_COMMON_DIR/weston.ini" --socket="$WAYLAND_DISPLAY" "$@" & +export WAYLAND_DISPLAY + +while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done diff --git a/.gitlab-ci/piglit/piglit-traces.sh b/.gitlab-ci/piglit/piglit-traces.sh index cc996083d78..1789b28b211 100755 --- a/.gitlab-ci/piglit/piglit-traces.sh +++ b/.gitlab-ci/piglit/piglit-traces.sh @@ -90,18 +90,7 @@ elif [ "$PIGLIT_PLATFORM" = "mixed_glx_egl" ]; then SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl" else SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD --platform glx --api gl --profile core" - # copy-paste from init-stage2.sh, please update accordingly - { - WESTON_X11_SOCK="/tmp/.X11-unix/X0" - WAYLAND_DISPLAY=wayland-0 - export DISPLAY=:0 - mkdir -p /tmp/.X11-unix - - weston --config="/install/common/weston.ini" --socket="$WAYLAND_DISPLAY" --renderer=gl & - export WAYLAND_DISPLAY - - while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done - } + . /install/common/weston.sh --renderer=gl fi # If the job is parallel at the gitlab job level, will take the corresponding diff --git a/src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml b/src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml index e4b12d19fc9..650b1c0b48a 100644 --- a/src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml +++ b/src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml @@ -41,12 +41,7 @@ llvmpipe: export LD_LIBRARY_PATH="$CI_PROJECT_DIR/install/lib" export LIBGL_DRIVERS_PATH="$CI_PROJECT_DIR/install/lib/dri" section_start weston "weston: prepare" - WAYLAND_DISPLAY=wayland-0 - export DISPLAY=:0 - mkdir -p /tmp/.X11-unix - weston --config="$CI_PROJECT_DIR/install/common/weston.ini" --socket="$WAYLAND_DISPLAY" & - export WAYLAND_DISPLAY - while [ ! -S /tmp/.X11-unix/X0 ]; do sleep 1; done + . "$CI_PROJECT_DIR/install/common/weston.sh" section_end weston $CI_PROJECT_DIR/install/deqp-runner.sh