blob: 6495800ed19404e513fe90b5fc09fb4565e07142 [file] [log] [blame]
Eric Anholt8c641832009-03-26 17:15:11 -07001/*
2 * Copyright © 2007 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 * Authors:
24 * Eric Anholt <eric@anholt.net>
25 *
26 */
27
Chris Wilsond0ed9122013-08-29 15:11:47 +010028#ifndef DRMTEST_H
29#define DRMTEST_H
30
Eric Anholt8c641832009-03-26 17:15:11 -070031#include <stdio.h>
32#include <stdlib.h>
33#include <unistd.h>
34#include <assert.h>
35#include <errno.h>
Daniel Vetterafbdc7a2012-03-22 13:47:57 +010036#include <stdbool.h>
Daniel Vetter662d7322012-05-22 14:37:19 +020037#include <cairo.h>
Daniel Vetterba0d2ac2013-08-12 09:31:55 +020038#include <setjmp.h>
Daniel Vetter225a91b2013-09-03 10:38:29 +020039#include <sys/mman.h>
Eric Anholt8c641832009-03-26 17:15:11 -070040
41#include "xf86drm.h"
Daniel Vetter17787f32012-05-22 16:15:15 +020042#include "xf86drmMode.h"
Daniel Vetter8f5387e2013-08-13 13:20:58 +020043#include "i915_drm.h"
Daniel Vetterd75d69d2012-01-15 18:32:11 +010044#include "intel_batchbuffer.h"
Daniel Vetter7847ea22013-08-12 11:03:29 +020045#include "intel_chipset.h"
46#include "intel_gpu_tools.h"
Eric Anholt8c641832009-03-26 17:15:11 -070047
Daniel Vetterdf7edaa2012-10-02 10:32:10 +020048drm_intel_bo * gem_handle_to_libdrm_bo(drm_intel_bufmgr *bufmgr, int fd,
49 const char *name, uint32_t handle);
50
Daniel Vetter5951ffb2013-08-19 10:34:34 +020051int drm_get_card(void);
Eric Anholt8c641832009-03-26 17:15:11 -070052int drm_open_any(void);
Daniel Vetteraa67b222012-01-10 14:59:58 +010053
Daniel Vetter9f876602012-01-11 17:19:53 +010054void gem_quiescent_gpu(int fd);
Daniel Vetteraa67b222012-01-10 14:59:58 +010055
Daniel Vetterd75d69d2012-01-15 18:32:11 +010056/* ioctl wrappers and similar stuff for bare metal testing */
Daniel Vetteraa67b222012-01-10 14:59:58 +010057void gem_set_tiling(int fd, uint32_t handle, int tiling, int stride);
Zhong Li8ddf84d2013-05-03 15:54:48 +080058bool gem_has_enable_ring(int fd,int param);
59bool gem_has_bsd(int fd);
60bool gem_has_blt(int fd);
61bool gem_has_vebox(int fd);
62int gem_get_num_rings(int fd);
Daniel Vetter7847ea22013-08-12 11:03:29 +020063
Daniel Vetter7553ad62013-08-12 10:43:59 +020064void gem_set_caching(int fd, uint32_t handle, int caching);
Daniel Vetter40ea6f42013-08-12 08:41:05 +020065uint32_t gem_get_caching(int fd, uint32_t handle);
Daniel Vetter8e46c382013-07-23 22:43:30 +020066uint32_t gem_flink(int fd, uint32_t handle);
67uint32_t gem_open(int fd, uint32_t name);
Daniel Vetter5dd17d32012-01-10 15:07:19 +010068void gem_close(int fd, uint32_t handle);
Daniel Vetter319638b2012-01-10 15:31:11 +010069void gem_write(int fd, uint32_t handle, uint32_t offset, const void *buf, uint32_t size);
Daniel Vetterbd5cf9a2012-01-10 15:37:53 +010070void gem_read(int fd, uint32_t handle, uint32_t offset, void *buf, uint32_t size);
Daniel Vetter673e6b22012-01-10 16:05:34 +010071void gem_set_domain(int fd, uint32_t handle,
72 uint32_t read_domains, uint32_t write_domain);
73void gem_sync(int fd, uint32_t handle);
Daniel Vetter7a6042e2012-01-10 18:29:30 +010074uint32_t gem_create(int fd, int size);
Daniel Vetter9cc16e82013-09-03 10:37:14 +020075void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf);
Chris Wilson77586dc2012-06-04 17:29:20 +010076
77void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot);
78void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot);
79#define gem_mmap gem_mmap__gtt
80
Daniel Vetter7f944342012-01-15 17:14:56 +010081uint64_t gem_aperture_size(int fd);
Daniel Vetter7b14b092012-01-15 17:40:41 +010082uint64_t gem_mappable_aperture_size(void);
Daniel Vetter16c4f522012-03-20 14:24:14 +010083int gem_madvise(int fd, uint32_t handle, int state);
Daniel Vettercbaa8a32012-01-11 15:33:00 +010084
Daniel Vetter9ad062d2013-08-19 10:55:28 +020085uint32_t gem_context_create(int fd);
86
Daniel Vetterafbdc7a2012-03-22 13:47:57 +010087/* feature test helpers */
88bool gem_uses_aliasing_ppgtt(int fd);
Daniel Vettercf72da52012-04-22 12:35:23 +020089int gem_available_fences(int fd);
Daniel Vetterafbdc7a2012-03-22 13:47:57 +010090
Daniel Vetter6bc22e32012-07-23 09:49:06 +020091/* prime */
92int prime_handle_to_fd(int fd, uint32_t handle);
93uint32_t prime_fd_to_handle(int fd, int dma_buf_fd);
Daniel Vettere58891d2013-08-15 14:00:23 +020094off_t prime_get_size(int dma_buf_fd);
Daniel Vetter6bc22e32012-07-23 09:49:06 +020095
Daniel Vetterd75d69d2012-01-15 18:32:11 +010096/* generally useful helpers */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +020097void igt_fork_signal_helper(void);
98void igt_stop_signal_helper(void);
99void igt_exchange_int(void *array, unsigned i, unsigned j);
100void igt_permute_array(void *array, unsigned size,
Daniel Vetterfbfe3742012-01-22 20:09:54 +0100101 void (*exchange_func)(void *array,
102 unsigned i,
103 unsigned j));
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200104void igt_progress(const char *header, uint64_t i, uint64_t total);
Daniel Vetter5bc03242013-07-19 19:08:43 +0200105
106/* subtest infrastructure */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200107jmp_buf igt_subtest_jmpbuf;
108void igt_subtest_init(int argc, char **argv);
Imre Deak5cabaae2013-08-03 02:10:11 +0300109typedef int (*igt_opt_handler_t)(int opt, int opt_index);
110struct option;
111int igt_subtest_init_parse_opts(int argc, char **argv,
112 const char *extra_short_opts,
113 struct option *extra_long_opts,
114 const char *help_str,
115 igt_opt_handler_t opt_handler);
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200116bool __igt_run_subtest(const char *subtest_name);
Daniel Vetterf8c0dfe2013-08-14 16:51:26 +0200117/**
118 * igt_subtest/_f - Denote a subtest code block
119 *
120 * Magic control flow which denotes a subtest code block. Within that codeblock
121 * igt_skip|success will only bail out of the subtest. The _f variant accepts a
122 * printf format string, which is useful for constructing combinatorial tests.
123 */
Daniel Vetter62346582013-08-14 13:47:47 +0200124#define igt_tokencat2(x, y) x ## y
125#define igt_tokencat(x, y) igt_tokencat2(x, y)
Daniel Vettere5cdd622013-09-19 16:37:07 +0200126#define __igt_subtest_f(tmp, format...) \
Daniel Vetter62346582013-08-14 13:47:47 +0200127 for (char tmp [256]; \
128 snprintf( tmp , sizeof( tmp ), \
Daniel Vettere5cdd622013-09-19 16:37:07 +0200129 format), \
Daniel Vetter62346582013-08-14 13:47:47 +0200130 __igt_run_subtest( tmp ) && \
131 (setjmp(igt_subtest_jmpbuf) == 0); \
132 igt_success())
Daniel Vettere5cdd622013-09-19 16:37:07 +0200133#define igt_subtest_f(f...) \
134 __igt_subtest_f(igt_tokencat(__tmpchar, __LINE__), f)
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200135#define igt_subtest(name) for (; __igt_run_subtest((name)) && \
136 (setjmp(igt_subtest_jmpbuf) == 0); \
137 igt_success())
Daniel Vetter15c19222013-08-14 18:03:09 +0200138const char *igt_subtest_name(void);
Daniel Vetterf8c0dfe2013-08-14 16:51:26 +0200139/**
140 * igt_skip - subtest aware test skipping
141 *
142 * For tests with subtests this will either bail out of the current subtest or
143 * mark all subsequent subtests as SKIP (in case some global setup code failed).
144 *
145 * For normal tests without subtest it will directly exit.
146 */
Daniel Vetter8dbd1fb2013-08-19 11:09:25 +0200147__attribute__((format(printf, 1, 2))) void igt_skip(const char *f, ...);
Daniel Vettere5cdd622013-09-19 16:37:07 +0200148__attribute__((format(printf, 5, 6)))
Daniel Vetter8f5387e2013-08-13 13:20:58 +0200149void __igt_skip_check(const char *file, const int line,
Daniel Vettere5cdd622013-09-19 16:37:07 +0200150 const char *func, const char *check,
151 const char *format, ...);
Daniel Vetterf8c0dfe2013-08-14 16:51:26 +0200152/**
153 * igt_success - complete a (subtest) as successfull
154 *
155 * This bails out of a subtests and marks it as successful. For global tests it
156 * it won't bail out of anything.
157 */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200158void igt_success(void);
Daniel Vetterf8c0dfe2013-08-14 16:51:26 +0200159/**
160 * igt_fail - fail a testcase
161 *
162 * For subtest it just bails out of the subtest, when run in global context it
163 * will exit. Note that it won't attempt to keep on running further tests,
164 * presuming that some mandatory setup failed.
165 */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200166void igt_fail(int exitcode) __attribute__((noreturn));
Daniel Vettere5cdd622013-09-19 16:37:07 +0200167__attribute__((format(printf, 6, 7)))
Daniel Vetter646a6fe2013-08-13 11:52:01 +0200168void __igt_fail_assert(int exitcode, const char *file,
Daniel Vettere5cdd622013-09-19 16:37:07 +0200169 const int line, const char *func, const char *assertion,
170 const char *format, ...)
Daniel Vetter646a6fe2013-08-13 11:52:01 +0200171 __attribute__((noreturn));
Daniel Vetterf8c0dfe2013-08-14 16:51:26 +0200172/**
173 * igt_exit - exit() for igts
174 *
175 * This will exit the test with the right exit code when subtests have been
176 * skipped. For normal tests it exits with a successful exit code, presuming
177 * everything has worked out. For subtests it also checks that at least one
178 * subtest has been run (save when only listing subtests.
179 */
180void igt_exit(void) __attribute__((noreturn));
Daniel Vetter8f5387e2013-08-13 13:20:58 +0200181/**
182 * igt_assert - fails (sub-)test if a condition is not met
183 *
184 * Should be used everywhere where a test checks results.
185 */
Daniel Vettere5cdd622013-09-19 16:37:07 +0200186#define igt_assert(expr) \
187 do { if (!(expr)) \
188 __igt_fail_assert(99, __FILE__, __LINE__, __func__, #expr , NULL); \
189 } while (0)
190#define igt_assert_f(expr, f...) \
191 do { if (!(expr)) \
192 __igt_fail_assert(99, __FILE__, __LINE__, __func__, #expr , f); \
193 } while (0)
Daniel Vetter8f5387e2013-08-13 13:20:58 +0200194/**
195 * igt_require - skip a (sub-)test if a condition is not met
196 *
197 * This is useful to streamline the skip logic since it allows for a more flat
198 * code control flow.
199 */
Daniel Vetter5113df72013-09-04 13:19:42 +0200200#define igt_require(expr) igt_skip_on(!(expr))
Daniel Vettere5cdd622013-09-19 16:37:07 +0200201#define igt_skip_on(expr) \
202 do { if ((expr)) \
203 __igt_skip_check(__FILE__, __LINE__, __func__, #expr , NULL); \
204 } while (0)
205#define igt_require_f(expr, f...) igt_skip_on_f(!(expr), f)
206#define igt_skip_on_f(expr, f...) \
207 do { if ((expr)) \
208 __igt_skip_check(__FILE__, __LINE__, __func__, #expr , f); \
209 } while (0)
Daniel Vetterd75d69d2012-01-15 18:32:11 +0100210
Daniel Vetter78865842013-08-19 07:23:49 +0200211bool __igt_fixture(void);
Daniel Vetter8869e1e2013-08-26 20:52:14 +0200212void __igt_fixture_complete(void);
Daniel Vetter78865842013-08-19 07:23:49 +0200213void __igt_fixture_end(void) __attribute__((noreturn));
Daniel Vetter696c8f62013-08-14 18:30:03 +0200214/**
215 * igt_fixture - annote global test fixture code
216 *
217 * Testcase with subtests often need to set up a bunch of global state as the
218 * common test fixture. To avoid such code interferring with the subtest
219 * enumeration (e.g. when enumerating on systemes without an intel gpu) such
220 * blocks should be annotated with igt_fixture.
221 */
Daniel Vetter8869e1e2013-08-26 20:52:14 +0200222#define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \
223 igt_tokencat(__tmpint,__LINE__) < 1 && \
224 __igt_fixture() && \
Daniel Vetter78865842013-08-19 07:23:49 +0200225 (setjmp(igt_subtest_jmpbuf) == 0); \
Daniel Vetter8869e1e2013-08-26 20:52:14 +0200226 igt_tokencat(__tmpint,__LINE__) ++, \
227 __igt_fixture_complete())
Daniel Vetter2dbd9982013-08-14 15:48:54 +0200228
Daniel Vettercd1f2202013-08-29 10:06:51 +0200229bool __igt_fork(void);
230/**
231 * igt_fork - fork parallel test threads with fork()
232 * @child: name of the int variable with the child number
233 * @num_children: number of children to fork
234 *
235 * Joining all test threads should be done with igt_waitchildren to ensure that
236 * the exit codes of all children are properly reflected in the test status.
237 */
238#define igt_fork(child, num_children) \
239 for (int child = 0; child < (num_children); child++) \
240 for (; __igt_fork(); exit(0))
241void igt_waitchildren(void);
242
Daniel Vetteredd72342013-09-10 15:46:08 +0200243struct igt_helper_process {
244 bool running;
245 pid_t pid;
Daniel Vettere73c1a02013-09-10 15:44:37 +0200246 int id;
Daniel Vetteredd72342013-09-10 15:46:08 +0200247};
248bool __igt_fork_helper(struct igt_helper_process *proc);
249void igt_stop_helper(struct igt_helper_process *proc);
250#define igt_fork_helper(proc) \
251 for (; __igt_fork_helper(proc); exit(0))
252
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200253/* check functions which auto-skip tests by calling igt_skip() */
Daniel Vetter8f5387e2013-08-13 13:20:58 +0200254void gem_require_caching(int fd);
255static inline void gem_require_ring(int fd, int ring_id)
Daniel Vetter7847ea22013-08-12 11:03:29 +0200256{
Daniel Vetter8f5387e2013-08-13 13:20:58 +0200257 switch (ring_id) {
258 case I915_EXEC_RENDER:
259 return;
260 case I915_EXEC_BLT:
261 igt_require(HAS_BLT_RING(intel_get_drm_devid(fd)));
262 return;
263 case I915_EXEC_BSD:
264 igt_require(HAS_BSD_RING(intel_get_drm_devid(fd)));
265 return;
Chris Wilson55b8c332013-08-19 18:15:04 +0100266#ifdef I915_EXEC_VEBOX
Daniel Vetter8f5387e2013-08-13 13:20:58 +0200267 case I915_EXEC_VEBOX:
268 igt_require(gem_has_vebox(fd));
269 return;
Chris Wilson55b8c332013-08-19 18:15:04 +0100270#endif
Daniel Vetter8f5387e2013-08-13 13:20:58 +0200271 default:
272 assert(0);
273 return;
274 }
Daniel Vetter7847ea22013-08-12 11:03:29 +0200275}
276
Daniel Vetter5bc03242013-07-19 19:08:43 +0200277/* helpers to automatically reduce test runtime in simulation */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200278bool igt_run_in_simulation(void);
279#define SLOW_QUICK(slow,quick) (igt_run_in_simulation() ? (quick) : (slow))
Daniel Vetterf8c0dfe2013-08-14 16:51:26 +0200280/**
281 * igt_skip_on_simulation - skip tests when INTEL_SIMULATION env war is set
282 *
283 * Skip the test when running on simulation (and that's relevant only when
284 * we're not in the mode where we list the subtests).
285 *
286 * This function is subtest aware (since it uses igt_skip) and so can be used to
287 * skip specific subtests or all subsequent subtests.
288 */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200289void igt_skip_on_simulation(void);
Damien Lespiaubb33d082013-02-13 16:29:01 +0000290
Daniel Vetterd75d69d2012-01-15 18:32:11 +0100291/* helpers based upon the libdrm buffer manager */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200292void igt_init_aperture_trashers(drm_intel_bufmgr *bufmgr);
293void igt_trash_aperture(void);
294void igt_cleanup_aperture_trashers(void);
Chris Wilsonb7bd1832012-03-29 12:45:59 +0100295
Imre Deakbfb0cdd2013-05-31 00:21:43 +0300296struct kmstest_connector_config {
297 drmModeCrtc *crtc;
298 drmModeConnector *connector;
299 drmModeEncoder *encoder;
300 drmModeModeInfo default_mode;
301 int crtc_idx;
302 int pipe;
303};
304
Imre Deak9a9f1312013-08-01 15:08:19 +0300305int kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector,
306 drmModeModeInfo *mode);
Imre Deakbfb0cdd2013-05-31 00:21:43 +0300307int kmstest_get_connector_config(int drm_fd, uint32_t connector_id,
308 unsigned long crtc_idx_mask,
309 struct kmstest_connector_config *config);
310void kmstest_free_connector_config(struct kmstest_connector_config *config);
311
Daniel Vetter662d7322012-05-22 14:37:19 +0200312/* helpers to create nice-looking framebuffers */
313struct kmstest_fb {
314 uint32_t fb_id;
315 uint32_t gem_handle;
Imre Deakf68d9642013-05-24 17:26:54 +0300316 uint32_t drm_format;
317 int width;
318 int height;
319 int depth;
Daniel Vetter662d7322012-05-22 14:37:19 +0200320 unsigned stride;
Chris Wilsond0ed9122013-08-29 15:11:47 +0100321 unsigned tiling;
Daniel Vetter662d7322012-05-22 14:37:19 +0200322 unsigned size;
Imre Deakf68d9642013-05-24 17:26:54 +0300323 cairo_t *cairo_ctx;
Daniel Vetter662d7322012-05-22 14:37:19 +0200324};
325
Imre Deak542a40c2013-05-30 15:03:48 +0300326enum kmstest_text_align {
327 align_left,
328 align_bottom = align_left,
329 align_right = 0x01,
330 align_top = 0x02,
331 align_vcenter = 0x04,
332 align_hcenter = 0x08,
333};
334
335int kmstest_cairo_printf_line(cairo_t *cr, enum kmstest_text_align align,
336 double yspacing, const char *fmt, ...)
337 __attribute__((format (printf, 4, 5)));
338
Daniel Vetter662d7322012-05-22 14:37:19 +0200339unsigned int kmstest_create_fb(int fd, int width, int height, int bpp,
340 int depth, bool tiled,
Imre Deakf68d9642013-05-24 17:26:54 +0300341 struct kmstest_fb *fb_info);
Imre Deak528b1f32013-05-30 22:59:59 +0300342unsigned int kmstest_create_fb2(int fd, int width, int height, uint32_t format,
343 bool tiled, struct kmstest_fb *fb);
Imre Deakf68d9642013-05-24 17:26:54 +0300344void kmstest_remove_fb(int fd, struct kmstest_fb *fb_info);
345cairo_t *kmstest_get_cairo_ctx(int fd, struct kmstest_fb *fb);
Imre Deak528b1f32013-05-30 22:59:59 +0300346void kmstest_paint_color_gradient(cairo_t *cr, int x, int y, int w, int h,
347 int r, int g, int b);
Imre Deakf68d9642013-05-24 17:26:54 +0300348void kmstest_paint_test_pattern(cairo_t *cr, int width, int height);
Damien Lespiaubde70602013-08-23 16:46:45 +0100349void kmstest_paint_image(cairo_t *cr, const char *filename,
350 int dst_x, int dst_y, int dst_width, int dst_height);
Damien Lespiau79f4cfe2013-09-06 18:22:53 +0100351void kmstest_write_fb(int fd, struct kmstest_fb *fb, const char *filename);
Daniel Vetter17787f32012-05-22 16:15:15 +0200352void kmstest_dump_mode(drmModeModeInfo *mode);
Daniel Vetter0af2b182012-12-15 01:06:11 +0100353int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id);
Imre Deak528b1f32013-05-30 22:59:59 +0300354const char *kmstest_format_str(uint32_t drm_format);
355const char *kmstest_pipe_str(int pipe);
356void kmstest_get_all_formats(const uint32_t **formats, int *format_count);
Imre Deak3a2aed12013-05-30 22:53:53 +0300357const char *kmstest_encoder_type_str(int type);
358const char *kmstest_connector_status_str(int type);
359const char *kmstest_connector_type_str(int type);
Daniel Vetter662d7322012-05-22 14:37:19 +0200360
Imre Deak24de8ba2013-07-29 17:19:58 +0300361uint32_t drm_format_to_bpp(uint32_t drm_format);
362
Daniel Vetter79abed32013-08-15 11:55:32 +0200363#define do_or_die(x) igt_assert((x) == 0)
364#define do_ioctl(fd, ptr, sz) igt_assert(drmIoctl((fd), (ptr), (sz)) == 0)
Imre Deakcf264352013-05-08 19:06:42 +0300365
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200366typedef void (*igt_exit_handler_t)(int sig);
Imre Deakbce7d8a2013-05-22 17:40:46 +0300367
Daniel Vetter5bc03242013-07-19 19:08:43 +0200368/* reliable atexit helpers, also work when killed by a signal (if possible) */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200369int igt_install_exit_handler(igt_exit_handler_t fn);
370void igt_enable_exit_handler(void);
371void igt_disable_exit_handler(void);
Imre Deakbce7d8a2013-05-22 17:40:46 +0300372
Daniel Vetter5bc03242013-07-19 19:08:43 +0200373/* set vt into graphics mode, required to prevent fbcon from interfering */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200374int igt_set_vt_graphics_mode(void);
Xiong Zhang7ea29832013-07-19 18:42:51 +0800375
Daniel Vetter5bc03242013-07-19 19:08:43 +0200376/* prefault disabling, needs the corresponding debugfs interface */
Daniel Vetterf4b93782013-09-03 12:22:09 +0200377void igt_disable_prefault(void);
378void igt_enable_prefault(void);
Daniel Vetter10834f82013-07-22 09:24:43 +0200379
380/* suspend and auto-resume system */
Daniel Vetter1caaf0a2013-08-12 12:17:35 +0200381void igt_system_suspend_autoresume(void);
Chris Wilsond0ed9122013-08-29 15:11:47 +0100382
383#endif /* DRMTEST_H */