blob: 92bf67f1018cdeb72a2498d48fcc8eeb49fb6fa1 [file] [log] [blame]
Damien Lespiau0d5de662014-02-06 21:20:35 +00001/*
2 * Copyright © 2014 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 * Damien Lespiau <damien.lespiau@intel.com>
25 */
26
Thomas Wood804e11f2015-08-17 17:57:43 +010027#include "igt.h"
Damien Lespiau0d5de662014-02-06 21:20:35 +000028#include <errno.h>
29#include <stdbool.h>
30#include <stdio.h>
31#include <string.h>
32
Damien Lespiau0d5de662014-02-06 21:20:35 +000033
34typedef struct {
Damien Lespiaude538cf2014-07-07 13:30:41 +010035 float red;
36 float green;
37 float blue;
38} color_t;
39
40typedef struct {
Damien Lespiau0d5de662014-02-06 21:20:35 +000041 int drm_fd;
Damien Lespiau0d5de662014-02-06 21:20:35 +000042 igt_display_t display;
Damien Lespiaude538cf2014-07-07 13:30:41 +010043 igt_pipe_crc_t *pipe_crc;
Damien Lespiau0d5de662014-02-06 21:20:35 +000044} data_t;
45
Yi Sunb5333b42014-05-23 08:28:47 +080046static color_t red = { 1.0f, 0.0f, 0.0f };
Damien Lespiaude538cf2014-07-07 13:30:41 +010047static color_t green = { 0.0f, 1.0f, 0.0f };
Yi Sunb5333b42014-05-23 08:28:47 +080048static color_t blue = { 0.0f, 0.0f, 1.0f };
Damien Lespiaude538cf2014-07-07 13:30:41 +010049
50/*
51 * Common code across all tests, acting on data_t
52 */
53static void test_init(data_t *data, enum pipe pipe)
54{
Chris Wilson83884e92017-03-21 17:16:03 +000055 data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
Damien Lespiaude538cf2014-07-07 13:30:41 +010056}
57
58static void test_fini(data_t *data)
59{
60 igt_pipe_crc_free(data->pipe_crc);
61}
62
63static void
Damien Lespiauc5b96152014-07-09 11:05:06 +010064test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe,
65 color_t *fb_color, igt_crc_t *crc /* out */)
Damien Lespiaude538cf2014-07-07 13:30:41 +010066{
67 struct igt_fb fb;
68 drmModeModeInfo *mode;
69 igt_plane_t *primary;
Damien Lespiau8d60b822014-07-07 14:41:15 +010070 char *crc_str;
Feceoru, Gabriel8adb5a02016-02-26 14:59:03 +020071 int ret;
Damien Lespiaude538cf2014-07-07 13:30:41 +010072
Damien Lespiauc5b96152014-07-09 11:05:06 +010073 igt_output_set_pipe(output, pipe);
74
Damien Lespiaude538cf2014-07-07 13:30:41 +010075 primary = igt_output_get_plane(output, 0);
76
77 mode = igt_output_get_mode(output);
78 igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
79 DRM_FORMAT_XRGB8888,
Tvrtko Ursuline36091d2015-03-03 14:11:01 +000080 LOCAL_DRM_FORMAT_MOD_NONE,
Damien Lespiaude538cf2014-07-07 13:30:41 +010081 fb_color->red, fb_color->green, fb_color->blue,
82 &fb);
83 igt_plane_set_fb(primary, &fb);
84
Feceoru, Gabriel8adb5a02016-02-26 14:59:03 +020085 ret = igt_display_try_commit2(&data->display, COMMIT_LEGACY);
86 igt_skip_on(ret != 0);
Damien Lespiaude538cf2014-07-07 13:30:41 +010087
88 igt_pipe_crc_collect_crc(data->pipe_crc, crc);
89
90 igt_plane_set_fb(primary, NULL);
91 igt_display_commit(&data->display);
92
93 igt_remove_fb(data->drm_fd, &fb);
Damien Lespiau8d60b822014-07-07 14:41:15 +010094
95 crc_str = igt_crc_to_string(crc);
96 igt_debug("CRC for a (%.02f,%.02f,%.02f) fb: %s\n", fb_color->red,
97 fb_color->green, fb_color->blue, crc_str);
98 free(crc_str);
Damien Lespiaude538cf2014-07-07 13:30:41 +010099}
100
Damien Lespiau0d5de662014-02-06 21:20:35 +0000101/*
102 * Plane position test.
103 * - We start by grabbing a reference CRC of a full green fb being scanned
104 * out on the primary plane
105 * - Then we scannout 2 planes:
106 * - the primary plane uses a green fb with a black rectangle
107 * - a plane, on top of the primary plane, with a green fb that is set-up
108 * to cover the black rectangle of the primary plane fb
109 * The resulting CRC should be identical to the reference CRC
110 */
111
112typedef struct {
113 data_t *data;
Damien Lespiau0d5de662014-02-06 21:20:35 +0000114 igt_crc_t reference_crc;
115} test_position_t;
116
117/*
118 * create a green fb with a black rectangle at (rect_x,rect_y) and of size
119 * (rect_w,rect_h)
120 */
121static void
122create_fb_for_mode__position(data_t *data, drmModeModeInfo *mode,
123 double rect_x, double rect_y,
124 double rect_w, double rect_h,
Daniel Vetter9aea7ae2014-03-26 09:18:11 +0100125 struct igt_fb *fb /* out */)
Damien Lespiau0d5de662014-02-06 21:20:35 +0000126{
127 unsigned int fb_id;
128 cairo_t *cr;
129
Daniel Vetter9aea7ae2014-03-26 09:18:11 +0100130 fb_id = igt_create_fb(data->drm_fd,
Damien Lespiau0d5de662014-02-06 21:20:35 +0000131 mode->hdisplay, mode->vdisplay,
Daniel Vetter70182162014-03-23 16:36:40 +0100132 DRM_FORMAT_XRGB8888,
Tvrtko Ursuline36091d2015-03-03 14:11:01 +0000133 LOCAL_DRM_FORMAT_MOD_NONE,
Damien Lespiau0d5de662014-02-06 21:20:35 +0000134 fb);
135 igt_assert(fb_id);
136
Daniel Vetter9aea7ae2014-03-26 09:18:11 +0100137 cr = igt_get_cairo_ctx(data->drm_fd, fb);
138 igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay,
Damien Lespiau0d5de662014-02-06 21:20:35 +0000139 0.0, 1.0, 0.0);
Daniel Vetter9aea7ae2014-03-26 09:18:11 +0100140 igt_paint_color(cr, rect_x, rect_y, rect_w, rect_h, 0.0, 0.0, 0.0);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000141 igt_assert(cairo_status(cr) == 0);
142 cairo_destroy(cr);
143}
144
Damien Lespiau0d5de662014-02-06 21:20:35 +0000145enum {
146 TEST_POSITION_FULLY_COVERED = 1 << 0,
Matt Roper14a3d882015-03-04 10:50:53 -0800147 TEST_DPMS = 1 << 1,
Damien Lespiau0d5de662014-02-06 21:20:35 +0000148};
149
150static void
151test_plane_position_with_output(data_t *data,
152 enum pipe pipe,
Robert Fossee350e72017-01-10 20:06:49 -0500153 int plane,
Damien Lespiau0d5de662014-02-06 21:20:35 +0000154 igt_output_t *output,
Imre Deak006e6ce2017-11-21 21:52:53 +0200155 igt_crc_t *reference_crc,
Damien Lespiau0d5de662014-02-06 21:20:35 +0000156 unsigned int flags)
157{
Damien Lespiau0d5de662014-02-06 21:20:35 +0000158 igt_plane_t *primary, *sprite;
Daniel Vetter9aea7ae2014-03-26 09:18:11 +0100159 struct igt_fb primary_fb, sprite_fb;
Damien Lespiau0d5de662014-02-06 21:20:35 +0000160 drmModeModeInfo *mode;
Matt Roper14a3d882015-03-04 10:50:53 -0800161 igt_crc_t crc, crc2;
Damien Lespiau0d5de662014-02-06 21:20:35 +0000162
Daniel Vetterdd8fba42014-08-12 11:00:37 +0200163 igt_info("Testing connector %s using pipe %s plane %d\n",
164 igt_output_name(output), kmstest_pipe_name(pipe), plane);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000165
Damien Lespiaude538cf2014-07-07 13:30:41 +0100166 igt_output_set_pipe(output, pipe);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000167
168 mode = igt_output_get_mode(output);
Robert Fossee350e72017-01-10 20:06:49 -0500169 primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
Damien Lespiau2043e6b2014-02-11 17:45:48 +0000170 sprite = igt_output_get_plane(output, plane);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000171
172 create_fb_for_mode__position(data, mode, 100, 100, 64, 64,
173 &primary_fb);
174 igt_plane_set_fb(primary, &primary_fb);
175
Daniel Vetter9aea7ae2014-03-26 09:18:11 +0100176 igt_create_color_fb(data->drm_fd,
Damien Lespiau0d5de662014-02-06 21:20:35 +0000177 64, 64, /* width, height */
178 DRM_FORMAT_XRGB8888,
Tvrtko Ursuline36091d2015-03-03 14:11:01 +0000179 LOCAL_DRM_FORMAT_MOD_NONE,
Damien Lespiau0d5de662014-02-06 21:20:35 +0000180 0.0, 1.0, 0.0,
181 &sprite_fb);
182 igt_plane_set_fb(sprite, &sprite_fb);
183
184 if (flags & TEST_POSITION_FULLY_COVERED)
185 igt_plane_set_position(sprite, 100, 100);
186 else
187 igt_plane_set_position(sprite, 132, 132);
188
189 igt_display_commit(&data->display);
190
Damien Lespiaude538cf2014-07-07 13:30:41 +0100191 igt_pipe_crc_collect_crc(data->pipe_crc, &crc);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000192
Matt Roper14a3d882015-03-04 10:50:53 -0800193 if (flags & TEST_DPMS) {
194 kmstest_set_connector_dpms(data->drm_fd,
195 output->config.connector,
196 DRM_MODE_DPMS_OFF);
197 kmstest_set_connector_dpms(data->drm_fd,
198 output->config.connector,
199 DRM_MODE_DPMS_ON);
200 }
201
202 igt_pipe_crc_collect_crc(data->pipe_crc, &crc2);
203
Damien Lespiau0d5de662014-02-06 21:20:35 +0000204 if (flags & TEST_POSITION_FULLY_COVERED)
Imre Deak006e6ce2017-11-21 21:52:53 +0200205 igt_assert_crc_equal(reference_crc, &crc);
Daniel Vetter92709f02017-09-05 14:36:16 +0200206 else {
Daniel Vetter562bbe12015-02-27 22:04:18 +0100207 ;/* FIXME: missing reference CRCs */
Daniel Vetter92709f02017-09-05 14:36:16 +0200208 }
Damien Lespiau0d5de662014-02-06 21:20:35 +0000209
Daniel Vettere588f6d2015-02-27 20:37:29 +0100210 igt_assert_crc_equal(&crc, &crc2);
Matt Roper14a3d882015-03-04 10:50:53 -0800211
Damien Lespiau0d5de662014-02-06 21:20:35 +0000212 igt_plane_set_fb(primary, NULL);
213 igt_plane_set_fb(sprite, NULL);
214
Damien Lespiaude538cf2014-07-07 13:30:41 +0100215 /* reset the constraint on the pipe */
216 igt_output_set_pipe(output, PIPE_ANY);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000217}
218
219static void
Imre Deak006e6ce2017-11-21 21:52:53 +0200220test_plane_position(data_t *data, enum pipe pipe, unsigned int flags)
Damien Lespiau0d5de662014-02-06 21:20:35 +0000221{
222 igt_output_t *output;
Feceoru, Gabriel11a2b0d2016-02-19 14:34:51 +0200223 int connected_outs = 0;
Damien Lespiau0d5de662014-02-06 21:20:35 +0000224
Maarten Lankhorstc79e6d82017-01-16 11:35:43 +0100225 for_each_valid_output_on_pipe(&data->display, pipe, output) {
Imre Deak006e6ce2017-11-21 21:52:53 +0200226 int n_planes = data->display.pipes[pipe].n_planes;
227 igt_crc_t reference_crc;
228
229 test_init(data, pipe);
230
231 test_grab_crc(data, output, pipe, &green, &reference_crc);
232
233 for (int plane = 1; plane < n_planes; plane++)
234 test_plane_position_with_output(data, pipe, plane,
235 output, &reference_crc,
236 flags);
237
238 test_fini(data);
239
Feceoru, Gabriel11a2b0d2016-02-19 14:34:51 +0200240 connected_outs++;
241 }
242
243 igt_skip_on(connected_outs == 0);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000244}
245
Yi Sunb5333b42014-05-23 08:28:47 +0800246/*
247 * Plane panning test.
248 * - We start by grabbing reference CRCs of a full red and a full blue fb
249 * being scanned out on the primary plane
250 * - Then we create a big fb, sized (2 * hdisplay, 2 * vdisplay) and:
251 * - fill the top left quarter with red
252 * - fill the bottom right quarter with blue
253 * - The TEST_PANNING_TOP_LEFT test makes sure that with panning at (0, 0)
254 * we do get the same CRC than the full red fb.
255 * - The TEST_PANNING_BOTTOM_RIGHT test makes sure that with panning at
256 * (vdisplay, hdisplay) we do get the same CRC than the full blue fb.
257 */
Yi Sunb5333b42014-05-23 08:28:47 +0800258static void
259create_fb_for_mode__panning(data_t *data, drmModeModeInfo *mode,
260 struct igt_fb *fb /* out */)
261{
262 unsigned int fb_id;
263 cairo_t *cr;
264
265 fb_id = igt_create_fb(data->drm_fd,
266 mode->hdisplay * 2, mode->vdisplay * 2,
267 DRM_FORMAT_XRGB8888,
Tvrtko Ursuline36091d2015-03-03 14:11:01 +0000268 LOCAL_DRM_FORMAT_MOD_NONE,
Yi Sunb5333b42014-05-23 08:28:47 +0800269 fb);
270 igt_assert(fb_id);
271
272 cr = igt_get_cairo_ctx(data->drm_fd, fb);
273
274 igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay,
275 1.0, 0.0, 0.0);
276
277 igt_paint_color(cr,
278 mode->hdisplay, mode->vdisplay,
279 mode->hdisplay, mode->vdisplay,
280 0.0, 0.0, 1.0);
281
282 igt_assert(cairo_status(cr) == 0);
283 cairo_destroy(cr);
284}
285
286enum {
287 TEST_PANNING_TOP_LEFT = 1 << 0,
288 TEST_PANNING_BOTTOM_RIGHT = 1 << 1,
Ander Conselvan de Oliveiraeeff3902015-01-19 15:43:57 +0200289 TEST_SUSPEND_RESUME = 1 << 2,
Yi Sunb5333b42014-05-23 08:28:47 +0800290};
291
292static void
293test_plane_panning_with_output(data_t *data,
294 enum pipe pipe,
Robert Fossee350e72017-01-10 20:06:49 -0500295 int plane,
Yi Sunb5333b42014-05-23 08:28:47 +0800296 igt_output_t *output,
Imre Deakb5c0ca62017-11-21 21:52:54 +0200297 igt_crc_t *red_crc, igt_crc_t *blue_crc,
Yi Sunb5333b42014-05-23 08:28:47 +0800298 unsigned int flags)
299{
Yi Sunb5333b42014-05-23 08:28:47 +0800300 igt_plane_t *primary;
301 struct igt_fb primary_fb;
302 drmModeModeInfo *mode;
303 igt_crc_t crc;
304
Daniel Vetterdd8fba42014-08-12 11:00:37 +0200305 igt_info("Testing connector %s using pipe %s plane %d\n",
306 igt_output_name(output), kmstest_pipe_name(pipe), plane);
Yi Sunb5333b42014-05-23 08:28:47 +0800307
Yi Sunb5333b42014-05-23 08:28:47 +0800308 igt_output_set_pipe(output, pipe);
309
310 mode = igt_output_get_mode(output);
311 primary = igt_output_get_plane(output, 0);
312
313 create_fb_for_mode__panning(data, mode, &primary_fb);
314 igt_plane_set_fb(primary, &primary_fb);
315
316 if (flags & TEST_PANNING_TOP_LEFT)
Maarten Lankhorst0e29ce32016-06-30 11:32:10 +0200317 igt_fb_set_position(&primary_fb, primary, 0, 0);
Yi Sunb5333b42014-05-23 08:28:47 +0800318 else
Maarten Lankhorst0e29ce32016-06-30 11:32:10 +0200319 igt_fb_set_position(&primary_fb, primary, mode->hdisplay, mode->vdisplay);
Yi Sunb5333b42014-05-23 08:28:47 +0800320
321 igt_display_commit(&data->display);
322
Ander Conselvan de Oliveiraeeff3902015-01-19 15:43:57 +0200323 if (flags & TEST_SUSPEND_RESUME)
Imre Deak022e6f82016-09-30 17:28:53 +0300324 igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
325 SUSPEND_TEST_NONE);
Ander Conselvan de Oliveiraeeff3902015-01-19 15:43:57 +0200326
Yi Sunb5333b42014-05-23 08:28:47 +0800327 igt_pipe_crc_collect_crc(data->pipe_crc, &crc);
328
329 if (flags & TEST_PANNING_TOP_LEFT)
Imre Deakb5c0ca62017-11-21 21:52:54 +0200330 igt_assert_crc_equal(red_crc, &crc);
Yi Sunb5333b42014-05-23 08:28:47 +0800331 else
Imre Deakb5c0ca62017-11-21 21:52:54 +0200332 igt_assert_crc_equal(blue_crc, &crc);
Yi Sunb5333b42014-05-23 08:28:47 +0800333
334 igt_plane_set_fb(primary, NULL);
335
336 /* reset states to neutral values, assumed by other tests */
337 igt_output_set_pipe(output, PIPE_ANY);
Maarten Lankhorst0e29ce32016-06-30 11:32:10 +0200338 igt_fb_set_position(&primary_fb, primary, 0, 0);
Yi Sunb5333b42014-05-23 08:28:47 +0800339}
340
341static void
Imre Deakb5c0ca62017-11-21 21:52:54 +0200342test_plane_panning(data_t *data, enum pipe pipe, unsigned int flags)
Yi Sunb5333b42014-05-23 08:28:47 +0800343{
344 igt_output_t *output;
Feceoru, Gabriel11a2b0d2016-02-19 14:34:51 +0200345 int connected_outs = 0;
Yi Sunb5333b42014-05-23 08:28:47 +0800346
Maarten Lankhorstc79e6d82017-01-16 11:35:43 +0100347 for_each_valid_output_on_pipe(&data->display, pipe, output) {
Imre Deakb5c0ca62017-11-21 21:52:54 +0200348 int n_planes = data->display.pipes[pipe].n_planes;
349 igt_crc_t red_crc;
350 igt_crc_t blue_crc;
351
352 test_init(data, pipe);
353
354 test_grab_crc(data, output, pipe, &red, &red_crc);
355 test_grab_crc(data, output, pipe, &blue, &blue_crc);
356
357 for (int plane = 1; plane < n_planes; plane++)
358 test_plane_panning_with_output(data, pipe, plane,
359 output,
360 &red_crc, &blue_crc,
361 flags);
362
363 test_fini(data);
364
Feceoru, Gabriel11a2b0d2016-02-19 14:34:51 +0200365 connected_outs++;
366 }
367
368 igt_skip_on(connected_outs == 0);
Yi Sunb5333b42014-05-23 08:28:47 +0800369}
370
Damien Lespiau0d5de662014-02-06 21:20:35 +0000371static void
Robert Fossee350e72017-01-10 20:06:49 -0500372run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
Damien Lespiau0d5de662014-02-06 21:20:35 +0000373{
Leo (Sunpeng) Li597cae92017-06-09 17:08:53 -0400374 igt_fixture {
375 igt_skip_on(pipe >= data->display.n_pipes);
376 igt_require(data->display.pipes[pipe].n_planes > 0);
377 }
378
Robert Fossee350e72017-01-10 20:06:49 -0500379 igt_subtest_f("plane-position-covered-pipe-%s-planes",
Imre Deak006e6ce2017-11-21 21:52:53 +0200380 kmstest_pipe_name(pipe))
381 test_plane_position(data, pipe, TEST_POSITION_FULLY_COVERED);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000382
Robert Fossee350e72017-01-10 20:06:49 -0500383 igt_subtest_f("plane-position-hole-pipe-%s-planes",
Imre Deak006e6ce2017-11-21 21:52:53 +0200384 kmstest_pipe_name(pipe))
385 test_plane_position(data, pipe, 0);
Yi Sunb5333b42014-05-23 08:28:47 +0800386
Robert Fossee350e72017-01-10 20:06:49 -0500387 igt_subtest_f("plane-position-hole-dpms-pipe-%s-planes",
Imre Deak006e6ce2017-11-21 21:52:53 +0200388 kmstest_pipe_name(pipe))
389 test_plane_position(data, pipe, TEST_DPMS);
Matt Roper14a3d882015-03-04 10:50:53 -0800390
Robert Fossee350e72017-01-10 20:06:49 -0500391 igt_subtest_f("plane-panning-top-left-pipe-%s-planes",
Imre Deakb5c0ca62017-11-21 21:52:54 +0200392 kmstest_pipe_name(pipe))
393 test_plane_panning(data, pipe, TEST_PANNING_TOP_LEFT);
Yi Sunb5333b42014-05-23 08:28:47 +0800394
Robert Fossee350e72017-01-10 20:06:49 -0500395 igt_subtest_f("plane-panning-bottom-right-pipe-%s-planes",
Imre Deakb5c0ca62017-11-21 21:52:54 +0200396 kmstest_pipe_name(pipe))
397 test_plane_panning(data, pipe, TEST_PANNING_BOTTOM_RIGHT);
Yi Sunb5333b42014-05-23 08:28:47 +0800398
Robert Fossee350e72017-01-10 20:06:49 -0500399 igt_subtest_f("plane-panning-bottom-right-suspend-pipe-%s-planes",
Imre Deakb5c0ca62017-11-21 21:52:54 +0200400 kmstest_pipe_name(pipe))
401 test_plane_panning(data, pipe, TEST_PANNING_BOTTOM_RIGHT |
402 TEST_SUSPEND_RESUME);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000403}
404
Damien Lespiau0d5de662014-02-06 21:20:35 +0000405
406static data_t data;
407
408igt_main
409{
Daniel Vetter229d7d22017-08-14 11:32:05 +0200410 enum pipe pipe;
Damien Lespiau0d5de662014-02-06 21:20:35 +0000411
412 igt_skip_on_simulation();
413
414 igt_fixture {
Micah Fedkec81d2932015-07-22 21:54:02 +0000415 data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000416
Daniel Vetter33f08842014-08-12 11:23:09 +0200417 kmstest_set_vt_graphics_mode();
Damien Lespiau0d5de662014-02-06 21:20:35 +0000418
Chris Wilson83884e92017-03-21 17:16:03 +0000419 igt_require_pipe_crc(data.drm_fd);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000420 igt_display_init(&data.display, data.drm_fd);
421 }
422
Daniel Vetter229d7d22017-08-14 11:32:05 +0200423 for_each_pipe_static(pipe)
Robert Fossee350e72017-01-10 20:06:49 -0500424 run_tests_for_pipe_plane(&data, pipe);
Damien Lespiau0d5de662014-02-06 21:20:35 +0000425
426 igt_fixture {
427 igt_display_fini(&data.display);
428 }
429}