xref: /linux/drivers/gpu/drm/ci/igt_runner.sh (revision 4b132aacb0768ac1e652cf517097ea6f237214b9)
1#!/bin/sh
2# SPDX-License-Identifier: MIT
3
4set -ex
5
6export IGT_FORCE_DRIVER=${DRIVER_NAME}
7export PATH=$PATH:/igt/bin/
8export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/igt/lib/aarch64-linux-gnu/:/igt/lib/x86_64-linux-gnu:/igt/lib:/igt/lib64
9
10# Uncomment the below to debug problems with driver probing
11: '
12ls -l /dev/dri/
13cat /sys/kernel/debug/devices_deferred
14cat /sys/kernel/debug/device_component/*
15'
16
17# Dump drm state to confirm that kernel was able to find a connected display:
18set +e
19cat /sys/kernel/debug/dri/*/state
20set -e
21
22case "$DRIVER_NAME" in
23    rockchip|meson)
24        export IGT_FORCE_DRIVER="panfrost"
25        ;;
26    mediatek)
27        if [ "$GPU_VERSION" = "mt8173" ]; then
28            export IGT_FORCE_DRIVER=${DRIVER_NAME}
29        elif [ "$GPU_VERSION" = "mt8183" ]; then
30            export IGT_FORCE_DRIVER="panfrost"
31        fi
32        ;;
33    amdgpu|vkms)
34        # Cannot use HWCI_KERNEL_MODULES as at that point we don't have the module in /lib
35        mv /install/modules/lib/modules/* /lib/modules/. || true
36        modprobe --first-time $DRIVER_NAME
37        ;;
38esac
39
40if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-skips.txt" ]; then
41    IGT_SKIPS="--skips /install/xfails/$DRIVER_NAME-$GPU_VERSION-skips.txt"
42fi
43
44if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-flakes.txt" ]; then
45    IGT_FLAKES="--flakes /install/xfails/$DRIVER_NAME-$GPU_VERSION-flakes.txt"
46fi
47
48if [ -e "/install/xfails/$DRIVER_NAME-$GPU_VERSION-fails.txt" ]; then
49    IGT_FAILS="--baseline /install/xfails/$DRIVER_NAME-$GPU_VERSION-fails.txt"
50fi
51
52if [ "`uname -m`" = "aarch64" ]; then
53    ARCH="arm64"
54elif [ "`uname -m`" = "armv7l" ]; then
55    ARCH="arm"
56else
57    ARCH="x86_64"
58fi
59
60curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -s ${FDO_HTTP_CACHE_URI:-}$PIPELINE_ARTIFACTS_BASE/$ARCH/igt.tar.gz | tar --zstd -v -x -C /
61
62TESTLIST="/igt/libexec/igt-gpu-tools/ci-testlist.txt"
63
64# If the job is parallel at the gitab job level, take the corresponding fraction
65# of the caselist.
66if [ -n "$CI_NODE_INDEX" ]; then
67    sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" $TESTLIST
68fi
69
70# core_getversion checks if the driver is loaded and probed correctly
71# so run it in all shards
72if ! grep -q "core_getversion" $TESTLIST; then
73    # Add the line to the file
74    echo "core_getversion" >> $TESTLIST
75fi
76
77set +e
78igt-runner \
79    run \
80    --igt-folder /igt/libexec/igt-gpu-tools \
81    --caselist $TESTLIST \
82    --output /results \
83    $IGT_SKIPS \
84    $IGT_FLAKES \
85    $IGT_FAILS \
86    --jobs 1
87ret=$?
88set -e
89
90deqp-runner junit \
91   --testsuite IGT \
92   --results /results/failures.csv \
93   --output /results/junit.xml \
94   --limit 50 \
95   --template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
96
97# Store the results also in the simpler format used by the runner in ChromeOS CI
98#sed -r 's/(dmesg-warn|pass)/success/g' /results/results.txt > /results/results_simple.txt
99
100cd $oldpath
101exit $ret
102