Skip to content

Commit 1548b06

Browse files
committed
Merge tag 'topic/drm-ci-2023-08-31-1' of git://anongit.freedesktop.org/drm/drm
Pull drm ci scripts from Dave Airlie: "This is a bunch of ci integration for the freedesktop gitlab instance where we currently do upstream userspace testing on diverse sets of GPU hardware. From my perspective I think it's an experiment worth going with and seeing how the benefits/noise playout keeping these files useful. Ideally I'd like to get this so we can do pre-merge testing on PRs eventually. Below is some info from danvet on why we've ended up making the decision and how we can roll it back if we decide it was a bad plan. Why in upstream? - like documentation, testcases, tools CI integration is one of these things where you can waste endless amounts of time if you accidentally have a version that doesn't match your source code - but also like the above, there's a balance, this is the initial cut of what we think makes sense to keep in sync vs out-of-tree, probably needs adjustment - gitlab supports out-of-repo gitlab integration and that's what's been used for the kernel in drm, but it results in per-driver fragmentation and lots of duplicated effort. the simple act of smashing an arbitrary winner into a topic branch already started surfacing patches on dri-devel and sparking good cross driver team discussions Why gitlab? - it's not any more shit than any of the other CI - drm userspace uses it extensively for everything in userspace, we have a lot of people and experience with this, including integration of hw testing labs - media userspace like gstreamer is also on gitlab.fd.o, and there's discussion to extend this to the media subsystem in some fashion Can this be shared? - there's definitely a pile of code that could move to scripts/ if other subsystem adopt ci integration in upstream kernel git. other bits are more drm/gpu specific like the igt-gpu-tests/tools integration - docker images can be run locally or in other CI runners Will we regret this? - it's all in one directory, intentionally, for easy deletion - probably 1-2 years in upstream to see whether this is worth it or a Big Mistake. that's roughly what it took to _really_ roll out solid CI in the bigger userspace projects we have on gitlab.fd.o like mesa3d" * tag 'topic/drm-ci-2023-08-31-1' of git://anongit.freedesktop.org/drm/drm: drm: ci: docs: fix build warning - add missing escape drm: Add initial ci/ subdirectory
2 parents e56b2b6 + ad6bfe1 commit 1548b06

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+5508
-0
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
3+
=========================================
4+
Automated testing of the DRM subsystem
5+
=========================================
6+
7+
Introduction
8+
============
9+
10+
Making sure that changes to the core or drivers don't introduce regressions can
11+
be very time-consuming when lots of different hardware configurations need to
12+
be tested. Moreover, it isn't practical for each person interested in this
13+
testing to have to acquire and maintain what can be a considerable amount of
14+
hardware.
15+
16+
Also, it is desirable for developers to check for regressions in their code by
17+
themselves, instead of relying on the maintainers to find them and then
18+
reporting back.
19+
20+
There are facilities in gitlab.freedesktop.org to automatically test Mesa that
21+
can be used as well for testing the DRM subsystem. This document explains how
22+
people interested in testing it can use this shared infrastructure to save
23+
quite some time and effort.
24+
25+
26+
Relevant files
27+
==============
28+
29+
drivers/gpu/drm/ci/gitlab-ci.yml
30+
--------------------------------
31+
32+
This is the root configuration file for GitLab CI. Among other less interesting
33+
bits, it specifies the specific version of the scripts to be used. There are
34+
some variables that can be modified to change the behavior of the pipeline:
35+
36+
DRM_CI_PROJECT_PATH
37+
Repository that contains the Mesa software infrastructure for CI
38+
39+
DRM_CI_COMMIT_SHA
40+
A particular revision to use from that repository
41+
42+
UPSTREAM_REPO
43+
URL to git repository containing the target branch
44+
45+
TARGET_BRANCH
46+
Branch to which this branch is to be merged into
47+
48+
IGT_VERSION
49+
Revision of igt-gpu-tools being used, from
50+
https://gitlab.freedesktop.org/drm/igt-gpu-tools
51+
52+
drivers/gpu/drm/ci/testlist.txt
53+
-------------------------------
54+
55+
IGT tests to be run on all drivers (unless mentioned in a driver's \*-skips.txt
56+
file, see below).
57+
58+
drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-fails.txt
59+
----------------------------------------------------------
60+
61+
Lists the known failures for a given driver on a specific hardware revision.
62+
63+
drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-flakes.txt
64+
-----------------------------------------------------------
65+
66+
Lists the tests that for a given driver on a specific hardware revision are
67+
known to behave unreliably. These tests won't cause a job to fail regardless of
68+
the result. They will still be run.
69+
70+
drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-skips.txt
71+
-----------------------------------------------------------
72+
73+
Lists the tests that won't be run for a given driver on a specific hardware
74+
revision. These are usually tests that interfere with the running of the test
75+
list due to hanging the machine, causing OOM, taking too long, etc.
76+
77+
78+
How to enable automated testing on your tree
79+
============================================
80+
81+
1. Create a Linux tree in https://gitlab.freedesktop.org/ if you don't have one
82+
yet
83+
84+
2. In your kernel repo's configuration (eg.
85+
https://gitlab.freedesktop.org/janedoe/linux/-/settings/ci_cd), change the
86+
CI/CD configuration file from .gitlab-ci.yml to
87+
drivers/gpu/drm/ci/gitlab-ci.yml.
88+
89+
3. Next time you push to this repository, you will see a CI pipeline being
90+
created (eg. https://gitlab.freedesktop.org/janedoe/linux/-/pipelines)
91+
92+
4. The various jobs will be run and when the pipeline is finished, all jobs
93+
should be green unless a regression has been found.
94+
95+
96+
How to update test expectations
97+
===============================
98+
99+
If your changes to the code fix any tests, you will have to remove one or more
100+
lines from one or more of the files in
101+
drivers/gpu/drm/ci/${DRIVER_NAME}_*_fails.txt, for each of the test platforms
102+
affected by the change.
103+
104+
105+
How to expand coverage
106+
======================
107+
108+
If your code changes make it possible to run more tests (by solving reliability
109+
issues, for example), you can remove tests from the flakes and/or skips lists,
110+
and then the expected results if there are any known failures.
111+
112+
If there is a need for updating the version of IGT being used (maybe you have
113+
added more tests to it), update the IGT_VERSION variable at the top of the
114+
gitlab-ci.yml file.
115+
116+
117+
How to test your changes to the scripts
118+
=======================================
119+
120+
For testing changes to the scripts in the drm-ci repo, change the
121+
DRM_CI_PROJECT_PATH and DRM_CI_COMMIT_SHA variables in
122+
drivers/gpu/drm/ci/gitlab-ci.yml to match your fork of the project (eg.
123+
janedoe/drm-ci). This fork needs to be in https://gitlab.freedesktop.org/.
124+
125+
126+
How to incorporate external fixes in your testing
127+
=================================================
128+
129+
Often, regressions in other trees will prevent testing changes local to the
130+
tree under test. These fixes will be automatically merged in during the build
131+
jobs from a branch in the target tree that is named as
132+
${TARGET_BRANCH}-external-fixes.
133+
134+
If the pipeline is not in a merge request and a branch with the same name
135+
exists in the local tree, commits from that branch will be merged in as well.
136+
137+
138+
How to deal with automated testing labs that may be down
139+
========================================================
140+
141+
If a hardware farm is down and thus causing pipelines to fail that would
142+
otherwise pass, one can disable all jobs that would be submitted to that farm
143+
by editing the file at
144+
https://gitlab.freedesktop.org/gfx-ci/lab-status/-/blob/main/lab-status.yml.

Documentation/gpu/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ GPU Driver Developer's Guide
1717
backlight
1818
vga-switcheroo
1919
vgaarbiter
20+
automated_testing
2021
todo
2122
rfc/index
2223

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7165,6 +7165,14 @@ T: git git://anongit.freedesktop.org/drm/drm-misc
71657165
F: drivers/gpu/drm/ttm/
71667166
F: include/drm/ttm/
71677167

7168+
DRM AUTOMATED TESTING
7169+
M: Helen Koike <[email protected]>
7170+
7171+
S: Maintained
7172+
T: git git://anongit.freedesktop.org/drm/drm-misc
7173+
F: Documentation/gpu/automated_testing.rst
7174+
F: drivers/gpu/drm/ci/
7175+
71687176
DSBR100 USB FM RADIO DRIVER
71697177
M: Alexey Klimov <[email protected]>
71707178

drivers/gpu/drm/ci/arm.config

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
CONFIG_LOCALVERSION_AUTO=y
2+
CONFIG_DEBUG_KERNEL=y
3+
4+
CONFIG_CRYPTO_ZSTD=y
5+
CONFIG_ZRAM_MEMORY_TRACKING=y
6+
CONFIG_ZRAM_WRITEBACK=y
7+
CONFIG_ZRAM=y
8+
CONFIG_ZSMALLOC_STAT=y
9+
10+
# abootimg with a 'dummy' rootfs fails with root=/dev/nfs
11+
CONFIG_BLK_DEV_INITRD=n
12+
13+
CONFIG_DEVFREQ_GOV_PERFORMANCE=y
14+
CONFIG_DEVFREQ_GOV_POWERSAVE=y
15+
CONFIG_DEVFREQ_GOV_USERSPACE=y
16+
CONFIG_DEVFREQ_GOV_PASSIVE=y
17+
CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
18+
19+
CONFIG_DRM=y
20+
CONFIG_DRM_ETNAVIV=y
21+
CONFIG_DRM_ROCKCHIP=y
22+
CONFIG_DRM_PANFROST=y
23+
CONFIG_DRM_LIMA=y
24+
CONFIG_DRM_PANEL_SIMPLE=y
25+
CONFIG_PWM_CROS_EC=y
26+
CONFIG_BACKLIGHT_PWM=y
27+
28+
CONFIG_ROCKCHIP_CDN_DP=n
29+
30+
CONFIG_SPI_ROCKCHIP=y
31+
CONFIG_PWM_ROCKCHIP=y
32+
CONFIG_PHY_ROCKCHIP_DP=y
33+
CONFIG_DWMAC_ROCKCHIP=y
34+
35+
CONFIG_MFD_RK808=y
36+
CONFIG_REGULATOR_RK808=y
37+
CONFIG_RTC_DRV_RK808=y
38+
CONFIG_COMMON_CLK_RK808=y
39+
40+
CONFIG_REGULATOR_FAN53555=y
41+
CONFIG_REGULATOR=y
42+
43+
CONFIG_REGULATOR_VCTRL=y
44+
45+
CONFIG_KASAN=n
46+
CONFIG_KASAN_INLINE=n
47+
CONFIG_STACKTRACE=n
48+
49+
CONFIG_TMPFS=y
50+
51+
CONFIG_PROVE_LOCKING=n
52+
CONFIG_DEBUG_LOCKDEP=n
53+
CONFIG_SOFTLOCKUP_DETECTOR=n
54+
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=n
55+
56+
CONFIG_FW_LOADER_COMPRESS=y
57+
58+
CONFIG_USB_USBNET=y
59+
CONFIG_NETDEVICES=y
60+
CONFIG_USB_NET_DRIVERS=y
61+
CONFIG_USB_RTL8152=y
62+
CONFIG_USB_NET_AX8817X=y
63+
CONFIG_USB_NET_SMSC95XX=y
64+
65+
# TK1
66+
CONFIG_ARM_TEGRA_DEVFREQ=y
67+
68+
# 32-bit build failure
69+
CONFIG_DRM_MSM=n

0 commit comments

Comments
 (0)