xref: /aosp_15_r20/external/igt-gpu-tools/README.md (revision d83cc019efdc2edc6c4b16e9034a3ceb8d35d77c)
1*d83cc019SAndroid Build Coastguard WorkerIGT GPU Tools
2*d83cc019SAndroid Build Coastguard Worker=============
3*d83cc019SAndroid Build Coastguard Worker
4*d83cc019SAndroid Build Coastguard WorkerDescription
5*d83cc019SAndroid Build Coastguard Worker-----------
6*d83cc019SAndroid Build Coastguard Worker
7*d83cc019SAndroid Build Coastguard WorkerIGT GPU Tools is a collection of tools for development and testing of the DRM
8*d83cc019SAndroid Build Coastguard Workerdrivers. There are many macro-level test suites that get used against the
9*d83cc019SAndroid Build Coastguard Workerdrivers, including xtest, rendercheck, piglit, and oglconform, but failures from
10*d83cc019SAndroid Build Coastguard Workerthose can be difficult to track down to kernel changes, and many require
11*d83cc019SAndroid Build Coastguard Workercomplicated build procedures or specific testing environments to get useful
12*d83cc019SAndroid Build Coastguard Workerresults. Therefore, IGT GPU Tools includes low-level tools and tests
13*d83cc019SAndroid Build Coastguard Workerspecifically for development and testing of the DRM Drivers.
14*d83cc019SAndroid Build Coastguard Worker
15*d83cc019SAndroid Build Coastguard WorkerIGT GPU Tools is split into several sections:
16*d83cc019SAndroid Build Coastguard Worker
17*d83cc019SAndroid Build Coastguard Worker**benchmarks/**
18*d83cc019SAndroid Build Coastguard Worker
19*d83cc019SAndroid Build Coastguard WorkerThis is a collection of useful microbenchmarks that can be used to tune
20*d83cc019SAndroid Build Coastguard WorkerDRM code in relevant ways.
21*d83cc019SAndroid Build Coastguard Worker
22*d83cc019SAndroid Build Coastguard WorkerThe benchmarks require KMS to be enabled.  When run with an X Server
23*d83cc019SAndroid Build Coastguard Workerrunning, they must be run as root to avoid the authentication
24*d83cc019SAndroid Build Coastguard Workerrequirement.
25*d83cc019SAndroid Build Coastguard Worker
26*d83cc019SAndroid Build Coastguard WorkerNote that a few other microbenchmarks are in tests (like gem_gtt_speed).
27*d83cc019SAndroid Build Coastguard Worker
28*d83cc019SAndroid Build Coastguard Worker**tests/**
29*d83cc019SAndroid Build Coastguard Worker
30*d83cc019SAndroid Build Coastguard WorkerThis is a set of automated tests to run against the DRM to validate
31*d83cc019SAndroid Build Coastguard Workerchanges. Many of the tests have subtests, which can be listed by using
32*d83cc019SAndroid Build Coastguard Workerthe --list-subtests command line option and then run using the
33*d83cc019SAndroid Build Coastguard Worker--run-subtest option. If --run-subtest is not used, all subtests will
34*d83cc019SAndroid Build Coastguard Workerbe run. Some tests have futher options and these are detailed by using
35*d83cc019SAndroid Build Coastguard Workerthe --help option.
36*d83cc019SAndroid Build Coastguard Worker
37*d83cc019SAndroid Build Coastguard WorkerThe test suite can be run using the run-tests.sh script available in
38*d83cc019SAndroid Build Coastguard Workerthe scripts directory. Piglit is used to run the tests and can either
39*d83cc019SAndroid Build Coastguard Workerbe installed from your distribution (if available), or can be
40*d83cc019SAndroid Build Coastguard Workerdownloaded locally for use with the script by running:
41*d83cc019SAndroid Build Coastguard Worker
42*d83cc019SAndroid Build Coastguard Worker    ./scripts/run-tests.sh -d
43*d83cc019SAndroid Build Coastguard Worker
44*d83cc019SAndroid Build Coastguard Workerrun-tests.sh has options for filtering and excluding tests from test
45*d83cc019SAndroid Build Coastguard Workerruns:
46*d83cc019SAndroid Build Coastguard Worker
47*d83cc019SAndroid Build Coastguard Worker  -t <regex>      only include tests that match the regular expression
48*d83cc019SAndroid Build Coastguard Worker  -x <regex>      exclude tests that match the regular expression
49*d83cc019SAndroid Build Coastguard Worker
50*d83cc019SAndroid Build Coastguard WorkerUseful patterns for test filtering are described in the API
51*d83cc019SAndroid Build Coastguard Workerdocumentation and the full list of tests and subtests can be produced
52*d83cc019SAndroid Build Coastguard Workerby passing -l to the run-tests.sh script.
53*d83cc019SAndroid Build Coastguard Worker
54*d83cc019SAndroid Build Coastguard WorkerResults are written to a JSON file and an HTML summary can also be
55*d83cc019SAndroid Build Coastguard Workercreated by passing -s to the run-tests.sh script. Further options are
56*d83cc019SAndroid Build Coastguard Workerare detailed by using the -h option.
57*d83cc019SAndroid Build Coastguard Worker
58*d83cc019SAndroid Build Coastguard Worker
59*d83cc019SAndroid Build Coastguard WorkerIf not using the script, piglit can be obtained from:
60*d83cc019SAndroid Build Coastguard Worker
61*d83cc019SAndroid Build Coastguard Worker    git://anongit.freedesktop.org/piglit
62*d83cc019SAndroid Build Coastguard Worker
63*d83cc019SAndroid Build Coastguard WorkerThere is no need to build and install piglit if it is only going to be
64*d83cc019SAndroid Build Coastguard Workerused for running i-g-t tests.
65*d83cc019SAndroid Build Coastguard Worker
66*d83cc019SAndroid Build Coastguard WorkerSet the IGT_TEST_ROOT environment variable to point to the tests
67*d83cc019SAndroid Build Coastguard Workerdirectory, or set the path key in the "igt" section of piglit.conf to
68*d83cc019SAndroid Build Coastguard Workerthe igt-gpu-tools root directory.
69*d83cc019SAndroid Build Coastguard Worker
70*d83cc019SAndroid Build Coastguard WorkerThe tests in the i-g-t sources need to have been built already. Then we
71*d83cc019SAndroid Build Coastguard Workercan run the testcases with (as usual as root, no other drm clients
72*d83cc019SAndroid Build Coastguard Workerrunning):
73*d83cc019SAndroid Build Coastguard Worker
74*d83cc019SAndroid Build Coastguard Worker    piglit-sources # ./piglit run igt <results-file>
75*d83cc019SAndroid Build Coastguard Worker
76*d83cc019SAndroid Build Coastguard WorkerThe testlist is built at runtime, so no need to update anything in
77*d83cc019SAndroid Build Coastguard Workerpiglit when adding new tests. See
78*d83cc019SAndroid Build Coastguard Worker
79*d83cc019SAndroid Build Coastguard Worker    piglit-sources $ ./piglit run -h
80*d83cc019SAndroid Build Coastguard Worker
81*d83cc019SAndroid Build Coastguard Workerfor some useful options.
82*d83cc019SAndroid Build Coastguard Worker
83*d83cc019SAndroid Build Coastguard WorkerPiglit only runs a default set of tests and is useful for regression
84*d83cc019SAndroid Build Coastguard Workertesting. Other tests not run are:
85*d83cc019SAndroid Build Coastguard Worker- tests that might hang the gpu, see HANG in Makefile.am
86*d83cc019SAndroid Build Coastguard Worker- gem_stress, a stress test suite. Look at the source for all the
87*d83cc019SAndroid Build Coastguard Worker  various options.
88*d83cc019SAndroid Build Coastguard Worker- testdisplay is only run in the default mode. testdisplay has tons of
89*d83cc019SAndroid Build Coastguard Worker  options to test different kms functionality, again read the source for
90*d83cc019SAndroid Build Coastguard Worker  the details.
91*d83cc019SAndroid Build Coastguard Worker
92*d83cc019SAndroid Build Coastguard Worker**lib/**
93*d83cc019SAndroid Build Coastguard Worker
94*d83cc019SAndroid Build Coastguard WorkerCommon helper functions and headers used by the other tools.
95*d83cc019SAndroid Build Coastguard Worker
96*d83cc019SAndroid Build Coastguard Worker**man/**
97*d83cc019SAndroid Build Coastguard Worker
98*d83cc019SAndroid Build Coastguard WorkerManpages, unfortunately rather incomplete.
99*d83cc019SAndroid Build Coastguard Worker
100*d83cc019SAndroid Build Coastguard Worker**tools/**
101*d83cc019SAndroid Build Coastguard Worker
102*d83cc019SAndroid Build Coastguard WorkerThis is a collection of debugging tools that had previously been
103*d83cc019SAndroid Build Coastguard Workerbuilt with the 2D driver but not shipped.  Some distros were hacking
104*d83cc019SAndroid Build Coastguard Workerup the 2D build to ship them.  Instead, here's a separate package for
105*d83cc019SAndroid Build Coastguard Workerpeople debugging the driver.
106*d83cc019SAndroid Build Coastguard Worker
107*d83cc019SAndroid Build Coastguard WorkerThese tools generally must be run as root, except for the ones that just
108*d83cc019SAndroid Build Coastguard Workerdecode dumps.
109*d83cc019SAndroid Build Coastguard Worker
110*d83cc019SAndroid Build Coastguard Worker**docs/**
111*d83cc019SAndroid Build Coastguard Worker
112*d83cc019SAndroid Build Coastguard WorkerContains the automatically generated igt-gpu-tools libraries
113*d83cc019SAndroid Build Coastguard Workerreference documentation in docs/reference/. You need to have the
114*d83cc019SAndroid Build Coastguard Workergtk-doc tools installed and use the "--enable-gtk-doc" configure flag
115*d83cc019SAndroid Build Coastguard Workerto generate this API documentation.
116*d83cc019SAndroid Build Coastguard Worker
117*d83cc019SAndroid Build Coastguard WorkerTo regenerate the html files when updating documentation, use:
118*d83cc019SAndroid Build Coastguard Worker
119*d83cc019SAndroid Build Coastguard Worker    $ ninja -C build igt-gpu-tools-doc
120*d83cc019SAndroid Build Coastguard Worker
121*d83cc019SAndroid Build Coastguard WorkerIf you've added/changed/removed a symbol or anything else that changes
122*d83cc019SAndroid Build Coastguard Workerthe overall structure or indexes, this needs to be reflected in
123*d83cc019SAndroid Build Coastguard Workerigt-gpu-tools-sections.txt. Entirely new sections will also need to be
124*d83cc019SAndroid Build Coastguard Workeradded to igt-gpu-tools-docs.xml in the appropriate place.
125*d83cc019SAndroid Build Coastguard Worker
126*d83cc019SAndroid Build Coastguard Worker**include/drm-uapi**
127*d83cc019SAndroid Build Coastguard Worker
128*d83cc019SAndroid Build Coastguard WorkerImported DRM uapi headers from airlied's drm-next branch.
129*d83cc019SAndroid Build Coastguard WorkerThese should be updated all together by executing "make
130*d83cc019SAndroid Build Coastguard Workerheaders_install" from that branch of the kernel and then
131*d83cc019SAndroid Build Coastguard Workercopying the resulting ./usr/include/drm/*.h in and committing
132*d83cc019SAndroid Build Coastguard Workerwith a note of which commit on airlied's branch was used to
133*d83cc019SAndroid Build Coastguard Workergenerate them.
134*d83cc019SAndroid Build Coastguard Worker
135*d83cc019SAndroid Build Coastguard Worker
136*d83cc019SAndroid Build Coastguard WorkerRequirements
137*d83cc019SAndroid Build Coastguard Worker------------
138*d83cc019SAndroid Build Coastguard Worker
139*d83cc019SAndroid Build Coastguard WorkerThis is a non-exhaustive list of package dependencies required for building
140*d83cc019SAndroid Build Coastguard Workerthe default configuration (package names may vary):
141*d83cc019SAndroid Build Coastguard Worker
142*d83cc019SAndroid Build Coastguard Worker	bison
143*d83cc019SAndroid Build Coastguard Worker	gtk-doc-tools
144*d83cc019SAndroid Build Coastguard Worker	flex
145*d83cc019SAndroid Build Coastguard Worker	libcairo2-dev
146*d83cc019SAndroid Build Coastguard Worker	libdrm-dev
147*d83cc019SAndroid Build Coastguard Worker	libkmod-dev
148*d83cc019SAndroid Build Coastguard Worker	libpixman-1-dev
149*d83cc019SAndroid Build Coastguard Worker	libpciaccess-dev
150*d83cc019SAndroid Build Coastguard Worker	libprocps-dev
151*d83cc019SAndroid Build Coastguard Worker	libudev-dev
152*d83cc019SAndroid Build Coastguard Worker	libunwind-dev
153*d83cc019SAndroid Build Coastguard Worker	liblzma-dev
154*d83cc019SAndroid Build Coastguard Worker	libdw-dev
155*d83cc019SAndroid Build Coastguard Worker	python-docutils
156*d83cc019SAndroid Build Coastguard Worker	x11proto-dri2-dev
157*d83cc019SAndroid Build Coastguard Worker	xutils-dev
158*d83cc019SAndroid Build Coastguard Worker
159*d83cc019SAndroid Build Coastguard WorkerThe following dependencies are required for building chamelium support
160*d83cc019SAndroid Build Coastguard Worker(package names may vary):
161*d83cc019SAndroid Build Coastguard Worker
162*d83cc019SAndroid Build Coastguard Worker	libxmlrpc-core-c3-dev
163*d83cc019SAndroid Build Coastguard Worker	libudev-dev
164*d83cc019SAndroid Build Coastguard Worker	libglib2.0-dev
165*d83cc019SAndroid Build Coastguard Worker	libgsl-dev
166*d83cc019SAndroid Build Coastguard Worker
167*d83cc019SAndroid Build Coastguard WorkerThe following dependencies are requires for building audio support
168*d83cc019SAndroid Build Coastguard Worker(package names may vary):
169*d83cc019SAndroid Build Coastguard Worker
170*d83cc019SAndroid Build Coastguard Worker	libasound2-dev
171*d83cc019SAndroid Build Coastguard Worker	libgsl-dev
172*d83cc019SAndroid Build Coastguard Worker
173*d83cc019SAndroid Build Coastguard WorkerSee Dockerfiles.* for package names in different distributions.
174*d83cc019SAndroid Build Coastguard Worker
175*d83cc019SAndroid Build Coastguard WorkerMeson build system support
176*d83cc019SAndroid Build Coastguard Worker--------------------------
177*d83cc019SAndroid Build Coastguard Worker
178*d83cc019SAndroid Build Coastguard WorkerCurrently we support both meson and automake as build systems, but meson is the
179*d83cc019SAndroid Build Coastguard Workerrecommended choice. Oneliner to get started:
180*d83cc019SAndroid Build Coastguard Worker
181*d83cc019SAndroid Build Coastguard Worker    $ mkdir build && meson build && cd build && ninja
182*d83cc019SAndroid Build Coastguard Worker
183*d83cc019SAndroid Build Coastguard WorkerNote that meson insist on separate build directories from the source tree.
184*d83cc019SAndroid Build Coastguard Worker
185*d83cc019SAndroid Build Coastguard WorkerRunning selfchecks for lib/tests and tests/ is done with
186*d83cc019SAndroid Build Coastguard Worker
187*d83cc019SAndroid Build Coastguard Worker    $ ninja -C build test
188*d83cc019SAndroid Build Coastguard Worker
189*d83cc019SAndroid Build Coastguard WorkerNote that this doesn't actually run the testcases in tests/: scripts/run-tests.sh
190*d83cc019SAndroid Build Coastguard Workershould continue to be used for that.
191*d83cc019SAndroid Build Coastguard Worker
192*d83cc019SAndroid Build Coastguard WorkerDocumentation is built using
193*d83cc019SAndroid Build Coastguard Worker
194*d83cc019SAndroid Build Coastguard Worker    $ ninja -C build igt-gpu-tools-doc
195*d83cc019SAndroid Build Coastguard Worker
196*d83cc019SAndroid Build Coastguard WorkerNote that this needs meson v0.47 or later, earlier versions of meson do not
197*d83cc019SAndroid Build Coastguard Workertrack depencies correctly for the documentation build and need:
198*d83cc019SAndroid Build Coastguard Worker
199*d83cc019SAndroid Build Coastguard Worker    $ ninja -C build && ninja -C build igt-gpu-tools-doc
200*d83cc019SAndroid Build Coastguard Worker
201*d83cc019SAndroid Build Coastguard WorkerNote that there's a setup script similar to ./autogen.sh which creates a
202*d83cc019SAndroid Build Coastguard Workercompatibility Makefile with a few useful default targets:
203*d83cc019SAndroid Build Coastguard Worker
204*d83cc019SAndroid Build Coastguard Worker    $ ./meson.sh [make-arguments]
205*d83cc019SAndroid Build Coastguard Worker
206*d83cc019SAndroid Build Coastguard WorkerReleases for maintainers
207*d83cc019SAndroid Build Coastguard Worker------------------------
208*d83cc019SAndroid Build Coastguard Worker
209*d83cc019SAndroid Build Coastguard Worker(1.14)
210*d83cc019SAndroid Build Coastguard Worker
211*d83cc019SAndroid Build Coastguard Workerhttp://www.x.org/wiki/Development/Documentation/ReleaseHOWTO/
212