Skip to content
Snippets Groups Projects
Commit 3c2bbda1 authored by Vignesh Raman's avatar Vignesh Raman
Browse files

kci-gitlab: Add drm scenario


Add a drm scenario that includes a job to run IGT tests for vkms.
It also includes helper scripts to build deqp-runner and IGT,
which are based on the mesa-ci project.

The xfails are added from drm-ci (drivers/gpu/drm/ci/xfails)
Refer to Documentation/gpu/automated_testing.rst for details
regarding fails/flakes/skips files.

Signed-off-by: default avatarVignesh Raman <vignesh.raman@collabora.com>
parent 01c66417
No related branches found
No related tags found
No related merge requests found
Showing
with 1326 additions and 6 deletions
...@@ -7551,6 +7551,7 @@ S: Maintained ...@@ -7551,6 +7551,7 @@ S: Maintained
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
F: Documentation/gpu/vkms.rst F: Documentation/gpu/vkms.rst
F: drivers/gpu/drm/ci/xfails/vkms* F: drivers/gpu/drm/ci/xfails/vkms*
F: tools/ci/gitlab-ci/scenarios/drm/xfails/vkms*
F: drivers/gpu/drm/vkms/ F: drivers/gpu/drm/vkms/
   
DRM DRIVER FOR VIRTUALBOX VIRTUAL GPU DRM DRIVER FOR VIRTUALBOX VIRTUAL GPU
......
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2025 Collabora, Vignesh Raman <vignesh.raman@collabora.com>
#
# Based on the build-deqp-runner.sh script from the mesa project:
# https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/.gitlab-ci/container/build-deqp-runner.sh
#
# shellcheck disable=SC2086 # we want word splitting
set -uex
DEQP_RUNNER_GIT_URL="${DEQP_RUNNER_GIT_URL:-https://gitlab.freedesktop.org/mesa/deqp-runner.git}"
DEQP_RUNNER_GIT_TAG="${DEQP_RUNNER_GIT_TAG:-v0.20.0}"
git clone $DEQP_RUNNER_GIT_URL --single-branch --no-checkout
pushd deqp-runner
git checkout $DEQP_RUNNER_GIT_TAG
RUST_TARGET="${RUST_TARGET:-}"
# When CC (/usr/lib/ccache/gcc) variable is set, the rust compiler uses
# this variable when cross-compiling arm32 and build fails for zsys-sys.
# So unset the CC variable when cross-compiling for arm32.
SAVEDCC=${CC:-}
if [ "$RUST_TARGET" = "armv7-unknown-linux-gnueabihf" ]; then
unset CC
fi
cargo install --locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local \
${EXTRA_CARGO_ARGS:-} \
--path .
CC=$SAVEDCC
popd
rm -rf deqp-runner
# remove unused test runners
if [ -z "${DEQP_RUNNER_GIT_TAG:-}" ]; then
rm -f /usr/local/bin/igt-runner
fi
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2025 Collabora, Vignesh Raman <vignesh.raman@collabora.com>
#
# Based on the build-igt.sh script from the drm-ci project:
# https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/ci/build-igt.sh
set -ex
function generate_testlist {
set +x
while read -r line; do
if [ "$line" = "TESTLIST" ] || [ "$line" = "END TESTLIST" ]; then
continue
fi
tests=$(echo "$line" | tr ' ' '\n')
for test in $tests; do
output=$(/igt/libexec/igt-gpu-tools/"$test" --list-subtests || true)
if [ -z "$output" ]; then
echo "$test"
else
echo "$output" | while read -r subtest; do
echo "$test@$subtest"
done
fi
done
done < /igt/libexec/igt-gpu-tools/test-list.txt > /igt/libexec/igt-gpu-tools/ci-testlist.txt
set -x
}
git clone https://gitlab.freedesktop.org/drm/igt-gpu-tools.git --single-branch --no-checkout
pushd igt-gpu-tools
git checkout $IGT_VERSION
if [[ "$KCI_KERNEL_ARCH" = "arm" ]]; then
. ../tools/ci/gitlab-ci/scenarios/drm/create-cross-file.sh armhf
EXTRA_MESON_ARGS="--cross-file /cross_file-armhf.txt"
fi
MESON_OPTIONS="-Doverlay=disabled \
-Dchamelium=disabled \
-Dvalgrind=disabled \
-Dman=enabled \
-Dtests=enabled \
-Drunner=enabled \
-Dlibunwind=enabled \
-Dprefix=/igt"
if [[ "$KCI_KERNEL_ARCH" = "arm64" ]] || [[ "$KCI_KERNEL_ARCH" = "arm" ]]; then
MESON_OPTIONS="$MESON_OPTIONS -Dxe_driver=disabled"
fi
mkdir -p /igt
meson build $MESON_OPTIONS $EXTRA_MESON_ARGS
ninja -C build -j${FDO_CI_CONCURRENT:-4} || ninja -C build -j 1
ninja -C build install
if [[ "$KCI_KERNEL_ARCH" = "arm64" ]]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/igt/lib/aarch64-linux-gnu
elif [[ "$KCI_KERNEL_ARCH" = "arm" ]]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/igt/lib
else
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/igt/lib/x86_64-linux-gnu
fi
echo "Generating ci-testlist.txt"
generate_testlist
export INSTALL_PATH="${CI_PROJECT_DIR}/artifacts/"
INSTALL_PATH+="igt-install-${KCI_KERNEL_ARCH}"
mkdir -p "$INSTALL_PATH"
tar -cf $INSTALL_PATH/igt.tar /igt
popd
rm -rf igt-gpu-tools
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2025 Collabora, Vignesh Raman <vignesh.raman@collabora.com>
#
# Based on the build-rust.sh script from the mesa project:
# https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/.gitlab-ci/container/build-rust.sh
# Note that this script is not actually "building" rust, but build- is the
# convention for the shared helpers for putting stuff in our containers.
set -ex
# cargo (and rustup) wants to store stuff in $HOME/.cargo, and binaries in
# $HOME/.cargo/bin. Make bin a link to a public bin directory so the commands
# are just available to all build jobs.
mkdir -p "$HOME"/.cargo
ln -s /usr/local/bin "$HOME"/.cargo/bin
# Pick a specific snapshot from rustup so the compiler doesn't drift on us.
RUST_VERSION=1.78.0-2024-05-02
# For rust in Mesa, we use rustup to install. This lets us pick an arbitrary
# version of the compiler, rather than whatever the container's Debian comes
# with.
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
--proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--default-toolchain $RUST_VERSION \
--profile minimal \
-y
rustup component add clippy rustfmt
# Set up a config script for cross compiling -- cargo needs your system cc for
# linking in cross builds, but doesn't know what you want to use for system cc.
cat > /root/.cargo/config <<EOF
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
EOF
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2025 Collabora, Vignesh Raman <vignesh.raman@collabora.com>
#
# Based on the create-cross-file.sh script from the mesa project:
# https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/.gitlab-ci/container/create-cross-file.sh
arch=$1
cross_file="/cross_file-$arch.txt"
meson env2mfile --cross --debarch "$arch" -o "$cross_file"
# Explicitly set ccache path for cross compilers
sed -i \
"s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" \
"$cross_file"
# Rely on qemu-user being configured in binfmt_misc on the host
# shellcheck disable=SC1003 # how this sed doesn't seems to work for me locally
sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
# Add a line for rustc, which meson env2mfile is missing.
cc=$(sed -n "s|^c\s*=\s*\[?'\(.*\)'\]?|\1|p" < "$cross_file")
if [[ "$arch" = "arm64" ]]; then
rust_target=aarch64-unknown-linux-gnu
elif [[ "$arch" = "armhf" ]]; then
rust_target=armv7-unknown-linux-gnueabihf
elif [[ "$arch" = "i386" ]]; then
rust_target=i686-unknown-linux-gnu
elif [[ "$arch" = "ppc64el" ]]; then
rust_target=powerpc64le-unknown-linux-gnu
elif [[ "$arch" = "s390x" ]]; then
rust_target=s390x-unknown-linux-gnu
else
echo "Needs rustc target mapping"
fi
# shellcheck disable=SC1003 # single-quoted string ends in a backslash
sed -i \
-e '/\[binaries\]/a\' \
-e "rust = ['rustc', '--target=$rust_target', '-C', 'linker=$cc']" \
"$cross_file"
# Set up cmake cross compile toolchain file for dEQP builds
toolchain_file="/toolchain-$arch.cmake"
if [[ "$arch" = "arm64" ]]; then
GCC_ARCH="aarch64-linux-gnu"
DE_CPU="DE_CPU_ARM_64"
elif [[ "$arch" = "armhf" ]]; then
GCC_ARCH="arm-linux-gnueabihf"
DE_CPU="DE_CPU_ARM"
fi
if [[ -n "$GCC_ARCH" ]]; then
{
echo "set(CMAKE_SYSTEM_NAME Linux)";
echo "set(CMAKE_SYSTEM_PROCESSOR arm)";
echo "set(CMAKE_C_COMPILER /usr/lib/ccache/$GCC_ARCH-gcc)";
echo "set(CMAKE_CXX_COMPILER /usr/lib/ccache/$GCC_ARCH-g++)";
echo "set(CMAKE_CXX_FLAGS_INIT \"-Wno-psabi\")"; # makes ABI warnings quiet for ARMv7
echo "set(ENV{PKG_CONFIG} \"/usr/bin/$GCC_ARCH-pkgconf\")";
echo "set(DE_CPU $DE_CPU)";
} > "$toolchain_file"
fi
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# #
# Copyright (C) 2024 Collabora, Helen Koike <helen.koike@collabora.com> # Copyright (C) 2024 Collabora, Helen Koike <helen.koike@collabora.com>
# DRM-specific scenario configurations based on drivers/gpu/drm/ci/build.yml
# Write here specific configurations and extensions for the given scenario variables:
FDO_DISTRIBUTION_TAG: "2025-01-21-drm"
FDO_DISTRIBUTION_EXEC: ./tools/ci/gitlab-ci/scenarios/drm/prepare-container.sh
IGT_VERSION: a73311079a5d8ac99eb25336a8369a2c3c6b519b
DEQP_RUNNER_GIT_URL: https://gitlab.freedesktop.org/mesa/deqp-runner.git
DEQP_RUNNER_GIT_TAG: v0.20.0
# Example - overwrite kernel combinations in the pipeline build:x86_64:
# build:arm64: variables:
# variables: KCI_KCONFIGS_ENABLE: "DRM_VKMS DRM_BOCHS"
# KCI_KCONFIGS_ENABLE: "CONFIG1 CONFIG2"
# KCI_DEFCONFIG: "my/custom/config1" .igt:
stage: build
script:
- FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash ./tools/ci/gitlab-ci/scenarios/drm/build-igt.sh
artifacts:
when: always
paths:
- artifacts/
# Build IGT for testing on devices
# TODO: Fix cross compilation issue
.igt:arm32:
extends:
- .arm32-config
- .use-debian/arm64_build
- .igt
igt:arm64:
extends:
- .arm64-config
- .use-debian/arm64_build
- .igt
igt:x86_64:
extends:
- .x86_64-config
- .use-debian/x86_64_build
- .igt
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2025 Collabora, Vignesh Raman <vignesh.raman@collabora.com>
set -ex
############### Install Smatch
. ./tools/ci/gitlab-ci/ci-scripts/install-smatch.sh
############### Install Rust toolchain
. ./tools/ci/gitlab-ci/scenarios/drm/build-rust.sh
############### Build dEQP runner
. ./tools/ci/gitlab-ci/scenarios/drm/build-deqp-runner.sh
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2025 Collabora, Vignesh Raman <vignesh.raman@collabora.com>
#
# Based on the igt_runner.sh script from the drm-ci project:
# https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/ci/igt_runner.sh
set -ex
STATUS_FILE="${1}"
export IGT_FORCE_DRIVER=${DRIVER_NAME}
export PATH=$PATH:/igt/bin/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\
/igt/lib/aarch64-linux-gnu:\
/igt/lib/x86_64-linux-gnu:\
/igt/lib:\
/igt/lib64
# Uncomment the below to debug problems with driver probing
: '
ls -l /dev/dri/
cat /sys/kernel/debug/devices_deferred
cat /sys/kernel/debug/device_component/*
'
# Dump drm state to confirm that kernel was able to find a connected display:
set +e
cat /sys/kernel/debug/dri/*/state
set -e
if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-skips.txt" ]; then
IGT_SKIPS="--skips /install/xfails/$DRIVER_NAME-$GPU_VERSION-skips.txt"
fi
if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-flakes.txt" ]; then
IGT_FLAKES="--flakes /install/xfails/$DRIVER_NAME-$GPU_VERSION-flakes.txt"
fi
if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-fails.txt" ]; then
IGT_FAILS="--baseline /install/xfails/$DRIVER_NAME-$GPU_VERSION-fails.txt"
fi
TESTLIST="/igt/libexec/igt-gpu-tools/ci-testlist.txt"
# If the job is parallel at the gitab job level, take the corresponding fraction
# of the caselist.
if [ -n "$CI_NODE_INDEX" ]; then
sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" $TESTLIST
fi
# core_getversion checks if the driver is loaded and probed correctly
# so run it in all shards
if ! grep -q "core_getversion" $TESTLIST; then
# Add the line to the file
echo "core_getversion" >> $TESTLIST
fi
set +e
igt-runner \
run \
--igt-folder /igt/libexec/igt-gpu-tools \
--caselist $TESTLIST \
--output /results \
-vvvv \
$IGT_SKIPS \
$IGT_FLAKES \
$IGT_FAILS \
--jobs 1
ret=$?
set -e
deqp-runner junit \
--testsuite IGT \
--results /results/failures.csv \
--output /results/junit.xml \
--limit 50 \
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
cd $oldpath
echo $ret > ${STATUS_FILE}
exit $ret
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2025 Collabora, Vignesh Raman <vignesh.raman@collabora.com>
vkms:none:
extends: build:x86_64
stage: test
timeout: "1h30m"
variables:
DRIVER_NAME: vkms
GPU_VERSION: none
tags:
- kvm
script:
- mkdir -p /install/xfails
- cp -rfv tools/ci/gitlab-ci/scenarios/drm/xfails /install/
- cp $CI_PROJECT_DIR/artifacts/kernel-install-${KCI_KERNEL_ARCH}/bzImage /install
- tar -xv -C / -f $CI_PROJECT_DIR/artifacts/igt-install-${KCI_KERNEL_ARCH}/igt.tar
- mkdir -p $CI_PROJECT_DIR/results
- ln -sf $CI_PROJECT_DIR/results /results
- ./tools/ci/gitlab-ci/ci-scripts/run-virtme.sh /install/bzImage ./tools/ci/gitlab-ci/scenarios/drm/run-igt.sh "DRIVER_NAME=$DRIVER_NAME GPU_VERSION=$GPU_VERSION"
artifacts:
when: always
paths:
- results/
needs:
- build:x86_64
- igt:x86_64
test-boot:
rules:
- when: never
kms_cursor_crc@cursor-rapid-movement-256x85,Fail
kms_cursor_crc@cursor-rapid-movement-32x10,Fail
kms_cursor_crc@cursor-rapid-movement-64x64,Fail
kms_cursor_legacy@basic-flip-before-cursor-atomic,Fail
kms_cursor_legacy@basic-flip-before-cursor-legacy,Fail
kms_cursor_legacy@cursor-vs-flip-atomic,Fail
kms_cursor_legacy@cursor-vs-flip-legacy,Fail
kms_cursor_legacy@cursor-vs-flip-toggle,Fail
kms_cursor_legacy@cursor-vs-flip-varying-size,Fail
kms_cursor_legacy@flip-vs-cursor-atomic,Fail
kms_cursor_legacy@flip-vs-cursor-crc-atomic,Fail
kms_cursor_legacy@flip-vs-cursor-crc-legacy,Fail
kms_cursor_legacy@flip-vs-cursor-legacy,Fail
kms_flip@flip-vs-modeset-vs-hang,Fail
kms_flip@flip-vs-panning-vs-hang,Fail
kms_writeback@writeback-check-output,Fail
kms_writeback@writeback-check-output-XRGB2101010,Fail
kms_writeback@writeback-fb-id,Fail
kms_writeback@writeback-fb-id-XRGB2101010,Fail
kms_writeback@writeback-invalid-parameters,Fail
kms_writeback@writeback-pixel-formats,Fail
perf@i915-ref-count,Fail
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_cursor_legacy@long-nonblocking-modeset-vs-cursor-atomic
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@basic-flip-vs-wf_vblank
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@flip-vs-expired-vblank-interruptible
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@flip-vs-wf_vblank-interruptible
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@plain-flip-fb-recreate-interruptible
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@plain-flip-ts-check
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@plain-flip-ts-check-interruptible
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@flip-vs-absolute-wf_vblank
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@flip-vs-absolute-wf_vblank-interruptible
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-g0df7b9b97
# Linux Version: 6.9.0-rc7
kms_flip@flip-vs-blocking-wf-vblank
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-gf13702b8e
# Linux Version: 6.10.0-rc5
kms_cursor_legacy@flip-vs-cursor-varying-size
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-gf13702b8e
# Linux Version: 6.10.0-rc5
kms_flip@flip-vs-expired-vblank
# Board Name: vkms
# Bug Report: https://lore.kernel.org/dri-devel/61ed26af-062c-443c-9df2-d1ee319f3fb0@collabora.com/T/#u
# Failure Rate: 50
# IGT Version: 1.28-gf13702b8e
# Linux Version: 6.10.0-rc5
kms_pipe_crc_basic@nonblocking-crc-frame-sequence
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment