Skip to contentSkip to conversation

kms_panel_fitting and kms_frontbuffer_tracking cleanups.

PATCH Superseded Maarten Lankhorst 2 participants 10 messages Feb 26, 2018 – Feb 27, 2018 Library code

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover kms_panel_fitting and kms_frontbuffer_tracking cleanups.

kms_frontbuffer_tracking is the slowest test on GLK, make it a lot faster by converting it to use igt_display, and not doing too many modesets when collecting CRC's.

Maarten Lankhorst (4):
tests/kms_panel_fitting: Test cleanups.
lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too tests/kms_frontbuffer_tracking: Convert test to use igt_display. tests/kms_frontbuffer_tracking: Remove redundant modesets during
subtest start.

 lib/igt_kms.c                    |   1 +
 tests/kms_frontbuffer_tracking.c | 800 ++++++++++++++-------------------------
 tests/kms_panel_fitting.c        |  74 +---
 3 files changed, 312 insertions(+), 563 deletions(-)
Signature · 6 lines
2.16.2

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH 1/4 tests/kms_panel_fitting: Test cleanups.

Use igt_display_reset() to reset the state, instead of doing it at the end of each subtest. Also remove the usage of a file, and instead allocate a test pattern like the other tests do.
We now also have a way to find out if panel fitting property is supported without performing a kmstest call.

---
 tests/kms_panel_fitting.c | 74 ++++++++++++-----------------------------------
 1 file changed, 19 insertions(+), 55 deletions(-)
tests/kms_panel_fitting.c +19 -55
index b3cee223a8e7..1f087ecc82a0 100644
@@ -37,17 +37,21 @@ typedef struct {
 
 	igt_plane_t *plane1;
 	igt_plane_t *plane2;
-	igt_plane_t *plane3;
-	igt_plane_t *plane4;
 } data_t;
 
-#define FILE_NAME   "1080p-left.png"
+static void cleanup_crtc(data_t *data)
+{
+	igt_display_reset(&data->display);
+	igt_remove_fb(data->drm_fd, &data->fb1);
+	igt_remove_fb(data->drm_fd, &data->fb2);
+}
 
 static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 			igt_plane_t *plane, drmModeModeInfo *mode, enum igt_commit_style s)
 {
 	igt_display_t *display = &data->display;
 
+	igt_output_override_mode(output, mode);
 	igt_output_set_pipe(output, pipe);
 
 	/* before allocating, free if any older fb */
@@ -76,26 +80,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 	igt_display_commit2(display, s);
 }
 
-static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
-{
-	igt_display_t *display = &data->display;
-
-	igt_remove_fb(data->drm_fd, &data->fb1);
-	igt_remove_fb(data->drm_fd, &data->fb2);
-
-	if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
-		igt_plane_t *primary;
-
-		primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
-		igt_plane_set_fb(primary, NULL);
-	}
-
-	igt_plane_set_fb(plane, NULL);
-	igt_output_set_pipe(output, PIPE_ANY);
-
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
-}
-
 static void test_panel_fitting(data_t *d)
 {
 	igt_display_t *display = &d->display;
@@ -105,30 +89,21 @@ static void test_panel_fitting(data_t *d)
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
 		drmModeModeInfo *mode, native_mode;
-		bool scaling_mode_set;
-
-		scaling_mode_set = kmstest_get_property(d->drm_fd,
-			output->config.connector->connector_id,
-			DRM_MODE_OBJECT_CONNECTOR,
-			"scaling mode",
-			NULL,
-			NULL,
-			NULL);
 
 		/* Check that the "scaling mode" property has been set. */
-		if (!scaling_mode_set)
+		if (!igt_output_has_prop(output, IGT_CONNECTOR_SCALING_MODE))
 			continue;
 
+		cleanup_crtc(d);
 		igt_output_set_pipe(output, pipe);
 
 		mode = igt_output_get_mode(output);
 		native_mode = *mode;
 
 		/* allocate fb2 with image */
-		igt_create_image_fb(d->drm_fd, 0, 0,
-				    DRM_FORMAT_XRGB8888,
-				    LOCAL_DRM_FORMAT_MOD_NONE,
-				    FILE_NAME, &d->fb2);
+		igt_create_pattern_fb(d->drm_fd, mode->hdisplay / 2, mode->vdisplay / 2,
+				      DRM_FORMAT_XRGB8888,
+				      LOCAL_DRM_FORMAT_MOD_NONE, &d->fb2);
 
 		/* Set up display to enable panel fitting */
 		mode->hdisplay = 640;
@@ -163,12 +138,7 @@ static void test_panel_fitting(data_t *d)
 		mode->vdisplay = 768;
 		prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_LEGACY);
 
-		/* back to single plane mode */
-		igt_plane_set_fb(d->plane2, NULL);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
-
 		valid_tests++;
-		cleanup_crtc(d, output, d->plane1);
 	}
 	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
 }
@@ -180,9 +150,8 @@ test_panel_fitting_fastset(igt_display_t *display, const enum pipe pipe, igt_out
 	drmModeModeInfo mode;
 	struct igt_fb red, green, blue;
 
-	igt_assert(kmstest_get_connector_default_mode(display->drm_fd, output->config.connector, &mode));
+	mode = *igt_output_get_mode(output);
 
-	igt_output_override_mode(output, &mode);
 	igt_output_set_pipe(output, pipe);
 
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
@@ -221,18 +190,11 @@ test_panel_fitting_fastset(igt_display_t *display, const enum pipe pipe, igt_out
 	igt_output_override_mode(output, &mode);
 	igt_plane_set_fb(primary, &green);
 	igt_display_commit_atomic(display, 0, NULL);
-
-	/* Restore normal mode */
-	igt_plane_set_fb(primary, &blue);
-	igt_output_override_mode(output, NULL);
-	igt_display_commit_atomic(display, 0, NULL);
-
-	igt_plane_set_fb(primary, NULL);
-	igt_output_set_pipe(output, PIPE_NONE);
 }
 
-static void test_atomic_fastset(igt_display_t *display)
+static void test_atomic_fastset(data_t *data)
 {
+	igt_display_t *display = &data->display;
 	igt_output_t *output;
 	enum pipe pipe;
 	int valid_tests = 0;
@@ -246,9 +208,10 @@ static void test_atomic_fastset(igt_display_t *display)
 	igt_require(intel_gen(intel_get_drm_devid(display->drm_fd)) >= 5);
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
-		if (!output->props[IGT_CONNECTOR_SCALING_MODE])
+		if (!igt_output_has_prop(output, IGT_CONNECTOR_SCALING_MODE))
 			continue;
 
+		cleanup_crtc(data);
 		test_panel_fitting_fastset(display, pipe, output);
 		valid_tests++;
 	}
@@ -264,13 +227,14 @@ igt_main
 
 		data.drm_fd = drm_open_driver(DRIVER_ANY);
 		igt_display_init(&data.display, data.drm_fd);
+		igt_display_require_output(&data.display);
 	}
 
 	igt_subtest("legacy")
 		test_panel_fitting(&data);
 
 	igt_subtest("atomic-fastset")
-		test_atomic_fastset(&data.display);
+		test_atomic_fastset(&data);
 
 	igt_fixture
 		igt_display_fini(&data.display);
Signature · 6 lines
2.16.2

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

PATCH 2/4 lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too

In reply to Maarten Lankhorst
---
 lib/igt_kms.c | 1 +
 1 file changed, 1 insertion(+)
lib/igt_kms.c +1 -0
index d8c8e7a3cdfb..5900c46296a0 100644
@@ -1724,6 +1724,7 @@ static void igt_plane_reset(igt_plane_t *plane)
 
 	igt_plane_clear_prop_changed(plane, IGT_PLANE_IN_FENCE_FD);
 	plane->values[IGT_PLANE_IN_FENCE_FD] = ~0ULL;
+	plane->gem_handle = 0;
 }
 
 static void igt_pipe_reset(igt_pipe_t *pipe)
Signature · 6 lines
2.16.2

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

PATCH 3/4 tests/kms_frontbuffer_tracking: Convert test to use igt_display.

In reply to Maarten Lankhorst

Straight conversion, no behavioral changes yet.

---
 tests/kms_frontbuffer_tracking.c | 780 ++++++++++++++-------------------------
 1 file changed, 269 insertions(+), 511 deletions(-)
tests/kms_frontbuffer_tracking.c +269 -511
index 1483c228044e..6672154e67b9 100644
@@ -151,18 +151,11 @@ struct rect {
 	uint32_t color;
 };
 
-#define MAX_CONNECTORS 32
-#define MAX_PLANES 32
-#define MAX_ENCODERS 32
 struct {
 	int fd;
 	int debugfs;
-	drmModeResPtr res;
-	drmModeConnectorPtr connectors[MAX_CONNECTORS];
-	drmModeEncoderPtr encoders[MAX_ENCODERS];
-	drmModePlaneResPtr plane_res;
-	drmModePlanePtr planes[MAX_PLANES];
-	uint64_t plane_types[MAX_PLANES];
+	igt_display_t display;
+
 	drm_intel_bufmgr *bufmgr;
 } drm;
 
@@ -222,6 +215,7 @@ struct {
  * have a big framebuffer and the CRTC is just displaying a subregion of this
  * big FB. */
 struct fb_region {
+	igt_plane_t *plane;
 	struct igt_fb *fb;
 	int x;
 	int y;
@@ -277,17 +271,18 @@ struct {
 };
 
 struct modeset_params {
-	uint32_t crtc_id;
-	uint32_t connector_id;
-	uint32_t sprite_id;
-	drmModeModeInfoPtr mode;
-	struct fb_region fb;
+	enum pipe pipe;
+	igt_output_t *output;
+	drmModeModeInfo mode_copy, *mode;
+
+	struct fb_region primary;
 	struct fb_region cursor;
 	struct fb_region sprite;
 };
 
 struct modeset_params prim_mode_params;
 struct modeset_params scnd_mode_params;
+
 struct fb_region offscreen_fb;
 struct screen_fbs {
 	bool initialized;
@@ -337,13 +332,14 @@ drmModeModeInfo std_1024_mode = {
 	.name = "Custom 1024x768",
 };
 
-static drmModeModeInfoPtr get_connector_smallest_mode(drmModeConnectorPtr c)
+static drmModeModeInfo *get_connector_smallest_mode(igt_output_t *output)
 {
+	drmModeConnector *c = output->config.connector;
+	drmModeModeInfo *smallest = NULL;
 	int i;
-	drmModeModeInfoPtr smallest = NULL;
 
 	for (i = 0; i < c->count_modes; i++) {
-		drmModeModeInfoPtr mode = &c->modes[i];
+		drmModeModeInfo *mode = &c->modes[i];
 
 		if (!smallest)
 			smallest = mode;
@@ -359,71 +355,53 @@ static drmModeModeInfoPtr get_connector_smallest_mode(drmModeConnectorPtr c)
 	return smallest;
 }
 
-static drmModeConnectorPtr get_connector(uint32_t id)
-{
-	int i;
-
-	for (i = 0; i < drm.res->count_connectors; i++)
-		if (drm.res->connectors[i] == id)
-			return drm.connectors[i];
-
-	igt_assert(false);
-}
-
-static drmModeEncoderPtr get_encoder(uint32_t id)
+static drmModeModeInfo *connector_get_mode(igt_output_t *output)
 {
-	int i;
+	drmModeModeInfo *mode = NULL;
 
-	for (i = 0; i < drm.res->count_encoders; i++)
-		if (drm.res->encoders[i] == id)
-			return drm.encoders[i];
-
-	igt_assert(false);
-}
+	if (opt.small_modes)
+		mode = get_connector_smallest_mode(output);
+	else
+		mode = &output->config.default_mode;
 
-static void print_mode_info(const char *screen, struct modeset_params *params)
-{
-	drmModeConnectorPtr c = get_connector(params->connector_id);
+	 /* On HSW the CRC WA is so awful that it makes you think everything is
+	  * bugged. */
+	if (IS_HASWELL(intel_get_drm_devid(drm.fd)) &&
+	    output->config.connector->connector_type == DRM_MODE_CONNECTOR_eDP)
+		mode = &std_1024_mode;
 
-	igt_info("%s screen: %s %s, crtc %d\n",
-		 screen,
-		 kmstest_connector_type_str(c->connector_type),
-		 params->mode->name,
-		 kmstest_get_crtc_idx(drm.res, params->crtc_id));
+	return mode;
 }
 
-static void init_mode_params(struct modeset_params *params, uint32_t crtc_id,
-			     drmModeConnectorPtr connector,
-			     drmModeModeInfoPtr mode)
+static void init_mode_params(struct modeset_params *params,
+			     igt_output_t *output, enum pipe pipe)
 {
-	uint32_t overlay_plane_id = 0;
-	int crtc_idx = kmstest_get_crtc_idx(drm.res, crtc_id);
-	int i;
-
-	for (i = 0; i < drm.plane_res->count_planes; i++)
-		if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) &&
-		    drm.plane_types[i] == DRM_PLANE_TYPE_OVERLAY) {
-			overlay_plane_id = drm.planes[i]->plane_id;
-			break;
-		}
+	drmModeModeInfo *mode;
 
-	igt_require(overlay_plane_id);
+	igt_output_override_mode(output, NULL);
+	mode = connector_get_mode(output);
 
-	params->crtc_id = crtc_id;
-	params->connector_id = connector->connector_id;
-	params->mode = mode;
-	params->sprite_id = overlay_plane_id;
+	params->pipe = pipe;
+	params->output = output;
+	params->mode_copy = *mode;
+	params->mode = &params->mode_copy;
 
-	params->fb.fb = NULL;
-	params->fb.w = mode->hdisplay;
-	params->fb.h = mode->vdisplay;
+	params->primary.plane = igt_pipe_get_plane_type(&drm.display.pipes[pipe], DRM_PLANE_TYPE_PRIMARY);
+	params->primary.fb = NULL;
+	params->primary.x = 0;
+	params->primary.y = 0;
+	params->primary.w = mode->hdisplay;
+	params->primary.h = mode->vdisplay;
 
+	params->cursor.plane = igt_pipe_get_plane_type(&drm.display.pipes[pipe], DRM_PLANE_TYPE_CURSOR);
 	params->cursor.fb = NULL;
 	params->cursor.x = 0;
 	params->cursor.y = 0;
 	params->cursor.w = 64;
 	params->cursor.h = 64;
 
+	params->sprite.plane = igt_pipe_get_plane_type(&drm.display.pipes[pipe], DRM_PLANE_TYPE_OVERLAY);
+	igt_require(params->sprite.plane);
 	params->sprite.fb = NULL;
 	params->sprite.x = 0;
 	params->sprite.y = 0;
@@ -431,63 +409,32 @@ static void init_mode_params(struct modeset_params *params, uint32_t crtc_id,
 	params->sprite.h = 64;
 }
 
-static bool connector_get_mode(drmModeConnectorPtr c, drmModeModeInfoPtr *mode)
-{
-	*mode = NULL;
-
-	if (c->connection != DRM_MODE_CONNECTED || !c->count_modes)
-		return false;
-
-	if (c->connector_type == DRM_MODE_CONNECTOR_eDP && opt.no_edp)
-		return false;
-
-	if (opt.small_modes)
-		*mode = get_connector_smallest_mode(c);
-	else
-		*mode = &c->modes[0];
-
-	 /* On HSW the CRC WA is so awful that it makes you think everything is
-	  * bugged. */
-	if (IS_HASWELL(intel_get_drm_devid(drm.fd)) &&
-	    c->connector_type == DRM_MODE_CONNECTOR_eDP)
-		*mode = &std_1024_mode;
-
-	return true;
-}
-
-static bool connector_supports_pipe_a(drmModeConnectorPtr connector)
-{
-	int i;
-
-	for (i = 0; i < connector->count_encoders; i++)
-		if (get_encoder(connector->encoders[i])->possible_crtcs & 1)
-			return true;
-
-	return false;
-}
-
-static bool find_connector(bool edp_only, bool pipe_a, uint32_t forbidden_id,
-			   drmModeConnectorPtr *ret_connector,
-			   drmModeModeInfoPtr *ret_mode)
+static bool find_connector(bool edp_only, bool pipe_a,
+			   igt_output_t *forbidden_output,
+			   enum pipe forbidden_pipe,
+			   igt_output_t **ret_output,
+			   enum pipe *ret_pipe)
 {
-	drmModeConnectorPtr c = NULL;
-	drmModeModeInfoPtr mode = NULL;
-	int i;
+	igt_output_t *output;
+	enum pipe pipe;
 
-	for (i = 0; i < drm.res->count_connectors; i++) {
-		c = drm.connectors[i];
+	for_each_pipe_with_valid_output(&drm.display, pipe, output) {
+		drmModeConnectorPtr c = output->config.connector;
 
 		if (edp_only && c->connector_type != DRM_MODE_CONNECTOR_eDP)
 			continue;
-		if (pipe_a && !connector_supports_pipe_a(c))
+
+		if (pipe_a && pipe != PIPE_A)
 			continue;
-		if (c->connector_id == forbidden_id)
+
+		if (output == forbidden_output || pipe == forbidden_pipe)
 			continue;
-		if (!connector_get_mode(c, &mode))
+
+		if (c->connector_type == DRM_MODE_CONNECTOR_eDP && opt.no_edp)
 			continue;
 
-		*ret_connector = c;
-		*ret_mode = mode;
+		*ret_output = output;
+		*ret_pipe = pipe;
 		return true;
 	}
 
@@ -496,9 +443,8 @@ static bool find_connector(bool edp_only, bool pipe_a, uint32_t forbidden_id,
 
 static bool init_modeset_cached_params(void)
 {
-	drmModeConnectorPtr prim_connector = NULL, scnd_connector = NULL;
-	drmModeModeInfoPtr prim_mode = NULL, scnd_mode = NULL;
-	uint32_t prim_crtc_id, scnd_crtc_id;
+	igt_output_t *prim_output = NULL, *scnd_output = NULL;
+	enum pipe prim_pipe, scnd_pipe;
 
 	/*
 	 * We have this problem where PSR is only present on eDP monitors and
@@ -508,39 +454,29 @@ static bool init_modeset_cached_params(void)
 	 * TODO: refactor the code in a way that allows us to have different
 	 * sets of prim/scnd structs for different features.
 	 */
-	find_connector(true, true, 0, &prim_connector, &prim_mode);
-	if (!prim_connector)
-		find_connector(true, false, 0, &prim_connector, &prim_mode);
-	if (!prim_connector)
-		find_connector(false, true, 0, &prim_connector, &prim_mode);
-	if (!prim_connector)
-		find_connector(false, false, 0, &prim_connector, &prim_mode);
-
-	if (!prim_connector)
+	find_connector(true, true, NULL, PIPE_NONE, &prim_output, &prim_pipe);
+	if (!prim_output)
+		find_connector(true, false, NULL, PIPE_NONE, &prim_output, &prim_pipe);
+	if (!prim_output)
+		find_connector(false, true, NULL, PIPE_NONE, &prim_output, &prim_pipe);
+	if (!prim_output)
+		find_connector(false, false, NULL, PIPE_NONE, &prim_output, &prim_pipe);
+
+	if (!prim_output)
 		return false;
 
-	find_connector(false, false, prim_connector->connector_id,
-		       &scnd_connector, &scnd_mode);
+	find_connector(false, false, prim_output, prim_pipe,
+		       &scnd_output, &scnd_pipe);
 
-	prim_crtc_id = kmstest_find_crtc_for_connector(drm.fd, drm.res,
-						       prim_connector, 0);
-	init_mode_params(&prim_mode_params, prim_crtc_id,
-			 prim_connector, prim_mode);
-	print_mode_info("Primary", &prim_mode_params);
+	init_mode_params(&prim_mode_params, prim_output, prim_pipe);
 
-	if (!scnd_connector) {
-		scnd_mode_params.connector_id = 0;
+	if (!scnd_output) {
+		scnd_mode_params.pipe = PIPE_NONE;
+		scnd_mode_params.output = NULL;
 		return true;
 	}
 
-	igt_require(drm.res->count_crtcs >= 2);
-	scnd_crtc_id = kmstest_find_crtc_for_connector(drm.fd, drm.res,
-						      scnd_connector,
-			1 << kmstest_get_crtc_idx(drm.res, prim_crtc_id));
-	init_mode_params(&scnd_mode_params, scnd_crtc_id,
-			 scnd_connector, scnd_mode);
-	print_mode_info("Secondary", &scnd_mode_params);
-
+	init_mode_params(&scnd_mode_params, prim_output, prim_pipe);
 	return true;
 }
 
@@ -699,7 +635,7 @@ static void create_shared_fb(enum pixel_format format)
 	prim_w = prim_mode_params.mode->hdisplay;
 	prim_h = prim_mode_params.mode->vdisplay;
 
-	if (scnd_mode_params.connector_id) {
+	if (scnd_mode_params.output) {
 		scnd_w = scnd_mode_params.mode->hdisplay;
 		scnd_h = scnd_mode_params.mode->vdisplay;
 	} else {
@@ -728,7 +664,7 @@ static void destroy_fbs(enum pixel_format format)
 	if (!s->initialized)
 		return;
 
-	if (scnd_mode_params.connector_id) {
+	if (scnd_mode_params.output) {
 		igt_remove_fb(drm.fd, &s->scnd_pri);
 		igt_remove_fb(drm.fd, &s->scnd_cur);
 		igt_remove_fb(drm.fd, &s->scnd_spr);
@@ -764,7 +700,7 @@ static void create_fbs(enum pixel_format format)
 
 	create_shared_fb(format);
 
-	if (!scnd_mode_params.connector_id)
+	if (!scnd_mode_params.output)
 		return;
 
 	create_fb(format, scnd_mode_params.mode->hdisplay,
@@ -776,14 +712,16 @@ static void create_fbs(enum pixel_format format)
 		  opt.tiling, PLANE_SPR, &s->scnd_spr);
 }
 
-static bool set_mode_for_params(struct modeset_params *params)
+static void set_mode_for_params(struct modeset_params *params)
 {
-	int rc;
+	igt_output_override_mode(params->output, params->mode);
+	igt_output_set_pipe(params->output, params->pipe);
 
-	rc = drmModeSetCrtc(drm.fd, params->crtc_id, params->fb.fb->fb_id,
-			    params->fb.x, params->fb.y,
-			    &params->connector_id, 1, params->mode);
-	return (rc == 0);
+	igt_plane_set_fb(params->primary.plane, params->primary.fb);
+	igt_plane_set_position(params->primary.plane, 0, 0);
+	igt_fb_set_position(params->primary.fb, params->primary.plane, params->primary.x, params->primary.y);
+	igt_fb_set_size(params->primary.fb, params->primary.plane, params->primary.w, params->primary.h);
+	igt_display_commit(&drm.display);
 }
 
 static void __debugfs_read(const char *param, char *buf, int len)
@@ -1238,22 +1176,8 @@ static void fill_fb_region(struct fb_region *region, enum color ecolor)
 
 static void unset_all_crtcs(void)
 {
-	int i, rc;
-
-	for (i = 0; i < drm.res->count_crtcs; i++) {
-		rc = drmModeSetCrtc(drm.fd, drm.res->crtcs[i], -1, 0, 0, NULL,
-				    0, NULL);
-		igt_assert_eq(rc, 0);
-
-		rc = drmModeSetCursor(drm.fd, drm.res->crtcs[i], 0, 0, 0);
-		igt_assert_eq(rc, 0);
-	}
-
-	for (i = 0; i < drm.plane_res->count_planes; i++) {
-		rc = drmModeSetPlane(drm.fd, drm.plane_res->planes[i], 0, 0, 0,
-				     0, 0, 0, 0, 0, 0, 0, 0);
-		igt_assert_eq(rc, 0);
-	}
+	igt_display_reset(&drm.display);
+	igt_display_commit(&drm.display);
 }
 
 static void disable_features(const struct test_mode *t)
@@ -1325,10 +1249,11 @@ static void collect_crcs(struct both_crcs *crcs, bool mandatory_sink_crc)
 	get_sink_crc(&crcs->sink, mandatory_sink_crc);
 }
 
+static void setup_sink_crc(void);
+
 static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc)
 {
 	struct igt_fb blue;
-	int rc;
 
 	if (blue_crcs[format].initialized)
 		return;
@@ -1339,10 +1264,18 @@ static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc)
 
 	fill_fb(&blue, COLOR_PRIM_BG);
 
-	rc = drmModeSetCrtc(drm.fd, prim_mode_params.crtc_id,
-			    blue.fb_id, 0, 0, &prim_mode_params.connector_id, 1,
-			    prim_mode_params.mode);
-	igt_assert_eq(rc, 0);
+	igt_output_set_pipe(prim_mode_params.output, prim_mode_params.pipe);
+	igt_output_override_mode(prim_mode_params.output, prim_mode_params.mode);
+	igt_plane_set_fb(prim_mode_params.primary.plane, &blue);
+	igt_display_commit(&drm.display);
+
+	if (!pipe_crc) {
+		pipe_crc = igt_pipe_crc_new(drm.fd, prim_mode_params.pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+		igt_assert(pipe_crc);
+
+		setup_sink_crc();
+	}
+
 	collect_crcs(&blue_crcs[format].crc, mandatory_sink_crc);
 
 	print_crc("Blue CRC:  ", &blue_crcs[format].crc);
@@ -1358,7 +1291,7 @@ static void init_crcs(enum pixel_format format,
 		      struct draw_pattern_info *pattern,
 		      bool mandatory_sink_crc)
 {
-	int r, r_, rc;
+	int r, r_;
 	struct igt_fb tmp_fbs[pattern->n_rects];
 
 	if (pattern->initialized[format])
@@ -1386,12 +1319,11 @@ static void init_crcs(enum pixel_format format,
 					 r);
 	}
 
+	igt_output_set_pipe(prim_mode_params.output, prim_mode_params.pipe);
 	for (r = 0; r < pattern->n_rects; r++) {
-		rc = drmModeSetCrtc(drm.fd, prim_mode_params.crtc_id,
-				   tmp_fbs[r].fb_id, 0, 0,
-				   &prim_mode_params.connector_id, 1,
-				   prim_mode_params.mode);
-		igt_assert_eq(rc, 0);
+		igt_plane_set_fb(prim_mode_params.primary.plane, &tmp_fbs[r]);
+		igt_display_commit(&drm.display);
+
 		collect_crcs(&pattern->crcs[format][r], mandatory_sink_crc);
 	}
 
@@ -1408,50 +1340,13 @@ static void init_crcs(enum pixel_format format,
 	pattern->initialized[format] = true;
 }
 
-static uint64_t get_plane_type(uint32_t plane_id)
-{
-	bool found;
-	uint64_t prop_value;
-	drmModePropertyPtr prop;
-
-	found = kmstest_get_property(drm.fd, plane_id, DRM_MODE_OBJECT_PLANE,
-				     "type", NULL, &prop_value, &prop);
-	igt_assert(found);
-	igt_assert(prop->flags & DRM_MODE_PROP_ENUM);
-	igt_assert(prop_value < prop->count_enums);
-
-	drmModeFreeProperty(prop);
-	return prop_value;
-}
-
 static void setup_drm(void)
 {
-	int i, rc;
-
 	drm.fd = drm_open_driver_master(DRIVER_INTEL);
 	drm.debugfs = igt_debugfs_dir(drm.fd);
 
-	drm.res = drmModeGetResources(drm.fd);
-	igt_assert(drm.res->count_connectors <= MAX_CONNECTORS);
-	igt_assert(drm.res->count_encoders <= MAX_ENCODERS);
-
-	for (i = 0; i < drm.res->count_connectors; i++)
-		drm.connectors[i] = drmModeGetConnectorCurrent(drm.fd,
-						drm.res->connectors[i]);
-	for (i = 0; i < drm.res->count_encoders; i++)
-		drm.encoders[i] = drmModeGetEncoder(drm.fd,
-						    drm.res->encoders[i]);
-
-	rc = drmSetClientCap(drm.fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
-	igt_require(rc == 0);
-
-	drm.plane_res = drmModeGetPlaneResources(drm.fd);
-	igt_assert(drm.plane_res->count_planes <= MAX_PLANES);
-
-	for (i = 0; i < drm.plane_res->count_planes; i++) {
-		drm.planes[i] = drmModeGetPlane(drm.fd, drm.plane_res->planes[i]);
-		drm.plane_types[i] = get_plane_type(drm.plane_res->planes[i]);
-	}
+	kmstest_set_vt_graphics_mode();
+	igt_display_init(&drm.display, drm.fd);
 
 	drm.bufmgr = drm_intel_bufmgr_gem_init(drm.fd, 4096);
 	igt_assert(drm.bufmgr);
@@ -1460,20 +1355,8 @@ static void setup_drm(void)
 
 static void teardown_drm(void)
 {
-	int i;
-
 	drm_intel_bufmgr_destroy(drm.bufmgr);
-
-	for (i = 0; i < drm.plane_res->count_planes; i++)
-		drmModeFreePlane(drm.planes[i]);
-	drmModeFreePlaneResources(drm.plane_res);
-
-	for (i = 0; i < drm.res->count_encoders; i++)
-		drmModeFreeEncoder(drm.encoders[i]);
-	for (i = 0; i < drm.res->count_connectors; i++)
-		drmModeFreeConnector(drm.connectors[i]);
-
-	drmModeFreeResources(drm.res);
+	igt_display_fini(&drm.display);
 	close(drm.fd);
 }
 
@@ -1484,7 +1367,6 @@ static void setup_modeset(void)
 	offscreen_fb.w = 1024;
 	offscreen_fb.h = 1024;
 	create_fbs(FORMAT_DEFAULT);
-	kmstest_set_vt_graphics_mode();
 }
 
 static void teardown_modeset(void)
@@ -1500,7 +1382,7 @@ static void setup_sink_crc(void)
 	sink_crc_t crc;
 	drmModeConnectorPtr c;
 
-	c = get_connector(prim_mode_params.connector_id);
+	c = prim_mode_params.output->config.connector;
 	if (c->connector_type != DRM_MODE_CONNECTOR_eDP) {
 		igt_info("Sink CRC not supported: primary screen is not eDP\n");
 		sink_crc.supported = false;
@@ -1510,9 +1392,9 @@ static void setup_sink_crc(void)
 	/* We need to make sure there's a mode set on the eDP screen and it's
 	 * not on DPMS state, otherwise we fall into the "Unexpected sink CRC
 	 * error" case. */
-	prim_mode_params.fb.fb = &fbs[FORMAT_DEFAULT].prim_pri;
-	prim_mode_params.fb.x = prim_mode_params.fb.y = 0;
-	fill_fb_region(&prim_mode_params.fb, COLOR_PRIM_BG);
+	prim_mode_params.primary.fb = &fbs[FORMAT_DEFAULT].prim_pri;
+	prim_mode_params.primary.x = prim_mode_params.primary.y = 0;
+	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
 	set_mode_for_params(&prim_mode_params);
 
 	sink_crc.fd = openat(drm.debugfs, "i915_sink_crc_eDP1", O_RDONLY);
@@ -1525,11 +1407,6 @@ static void setup_sink_crc(void)
 static void setup_crcs(void)
 {
 	enum pixel_format f;
-	int crtc_idx = kmstest_get_crtc_idx(drm.res, prim_mode_params.crtc_id);
-
-	pipe_crc = igt_pipe_crc_new(drm.fd, crtc_idx, INTEL_PIPE_CRC_SOURCE_AUTO);
-
-	setup_sink_crc();
 
 	for (f = 0; f < FORMAT_COUNT; f++)
 		blue_crcs[f].initialized = false;
@@ -1601,7 +1478,6 @@ static bool fbc_supported_on_chipset(void)
 
 static void setup_fbc(void)
 {
-	drmModeConnectorPtr c = get_connector(prim_mode_params.connector_id);
 	int devid = intel_get_drm_devid(drm.fd);
 
 	if (!fbc_supported_on_chipset()) {
@@ -1614,7 +1490,7 @@ static void setup_fbc(void)
 	 * is not prepared for that yet.
 	 * TODO: solve this.
 	 */
-	if (!connector_supports_pipe_a(c)) {
+	if (prim_mode_params.pipe != PIPE_A) {
 		igt_info("Can't test FBC: primary connector doesn't support "
 			 "pipe A\n");
 		return;
@@ -1646,7 +1522,7 @@ static bool psr_sink_has_support(void)
 
 static void setup_psr(void)
 {
-	if (get_connector(prim_mode_params.connector_id)->connector_type !=
+	if (prim_mode_params.output->config.connector->connector_type !=
 	    DRM_MODE_CONNECTOR_eDP) {
 		igt_info("Can't test PSR: no usable eDP screen.\n");
 		return;
@@ -1665,7 +1541,7 @@ static void teardown_psr(void)
 
 static void setup_drrs(void)
 {
-	if (get_connector(prim_mode_params.connector_id)->connector_type !=
+	if (prim_mode_params.output->config.connector->connector_type !=
 	    DRM_MODE_CONNECTOR_eDP) {
 		igt_info("Can't test DRRS: no usable eDP screen.\n");
 		return;
@@ -1734,7 +1610,7 @@ static struct fb_region *pick_target(const struct test_mode *t,
 
 	switch (t->plane) {
 	case PLANE_PRI:
-		return &params->fb;
+		return &params->primary;
 	case PLANE_CUR:
 		return &params->cursor;
 	case PLANE_SPR:
@@ -1904,7 +1780,7 @@ static void __do_assertions(const struct test_mode *t, int flags,
 
 static void enable_prim_screen_and_wait(const struct test_mode *t)
 {
-	fill_fb_region(&prim_mode_params.fb, COLOR_PRIM_BG);
+	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
 	set_mode_for_params(&prim_mode_params);
 
 	wanted_crc = &blue_crcs[t->format].crc;
@@ -1915,45 +1791,23 @@ static void enable_prim_screen_and_wait(const struct test_mode *t)
 
 static void enable_scnd_screen_and_wait(const struct test_mode *t)
 {
-	fill_fb_region(&scnd_mode_params.fb, COLOR_SCND_BG);
+	fill_fb_region(&scnd_mode_params.primary, COLOR_SCND_BG);
 	set_mode_for_params(&scnd_mode_params);
 
 	do_assertions(ASSERT_NO_ACTION_CHANGE);
 }
 
-static void set_cursor_for_test(const struct test_mode *t,
-				struct modeset_params *params)
-{
-	int rc;
-
-	fill_fb_region(&params->cursor, COLOR_PRIM_BG);
-
-	rc = drmModeMoveCursor(drm.fd, params->crtc_id, 0, 0);
-	igt_assert_eq(rc, 0);
-
-	rc = drmModeSetCursor(drm.fd, params->crtc_id,
-			      params->cursor.fb->gem_handle,
-			      params->cursor.w,
-			      params->cursor.h);
-	igt_assert_eq(rc, 0);
-
-	do_assertions(ASSERT_NO_ACTION_CHANGE);
-}
-
-static void set_sprite_for_test(const struct test_mode *t,
-				struct modeset_params *params)
+static void set_region_for_test(const struct test_mode *t,
+				struct fb_region *reg)
 {
-	int rc;
-
-	fill_fb_region(&params->sprite, COLOR_PRIM_BG);
+	fill_fb_region(reg, COLOR_PRIM_BG);
 
-	rc = drmModeSetPlane(drm.fd, params->sprite_id, params->crtc_id,
-			     params->sprite.fb->fb_id, 0, 0, 0,
-			     params->sprite.w, params->sprite.h,
-			     0, 0, params->sprite.w << 16,
-			     params->sprite.h << 16);
-	igt_assert_eq(rc, 0);
+	igt_plane_set_fb(reg->plane, reg->fb);
+	igt_plane_set_position(reg->plane, 0, 0);
+	igt_plane_set_size(reg->plane, reg->w, reg->h);
+	igt_fb_set_size(reg->fb, reg->plane, reg->w, reg->h);
 
+	igt_display_commit(&drm.display);
 	do_assertions(ASSERT_NO_ACTION_CHANGE);
 }
 
@@ -1973,7 +1827,7 @@ static void enable_features_for_test(const struct test_mode *t)
 static void check_test_requirements(const struct test_mode *t)
 {
 	if (t->pipes == PIPE_DUAL)
-		igt_require_f(scnd_mode_params.connector_id,
+		igt_require_f(!scnd_mode_params.output,
 			    "Can't test dual pipes with the current outputs\n");
 
 	if (t->feature & FEATURE_FBC)
@@ -2011,32 +1865,32 @@ static void set_crtc_fbs(const struct test_mode *t)
 
 	switch (t->fbs) {
 	case FBS_INDIVIDUAL:
-		prim_mode_params.fb.fb = &s->prim_pri;
-		scnd_mode_params.fb.fb = &s->scnd_pri;
+		prim_mode_params.primary.fb = &s->prim_pri;
+		scnd_mode_params.primary.fb = &s->scnd_pri;
 		offscreen_fb.fb = &s->offscreen;
 
-		prim_mode_params.fb.x = 0;
-		scnd_mode_params.fb.x = 0;
+		prim_mode_params.primary.x = 0;
+		scnd_mode_params.primary.x = 0;
 		offscreen_fb.x = 0;
 
-		prim_mode_params.fb.y = 0;
-		scnd_mode_params.fb.y = 0;
+		prim_mode_params.primary.y = 0;
+		scnd_mode_params.primary.y = 0;
 		offscreen_fb.y = 0;
 		break;
 	case FBS_SHARED:
 		/* Please see the comment at the top of create_shared_fb(). */
-		prim_mode_params.fb.fb = &s->big;
-		scnd_mode_params.fb.fb = &s->big;
+		prim_mode_params.primary.fb = &s->big;
+		scnd_mode_params.primary.fb = &s->big;
 		offscreen_fb.fb = &s->big;
 
-		prim_mode_params.fb.x = opt.shared_fb_x_offset;
-		scnd_mode_params.fb.x = opt.shared_fb_x_offset;
+		prim_mode_params.primary.x = opt.shared_fb_x_offset;
+		scnd_mode_params.primary.x = opt.shared_fb_x_offset;
 		offscreen_fb.x = opt.shared_fb_x_offset;
 
-		prim_mode_params.fb.y = opt.shared_fb_y_offset;
-		scnd_mode_params.fb.y = prim_mode_params.fb.y +
-					prim_mode_params.fb.h;
-		offscreen_fb.y = scnd_mode_params.fb.y + scnd_mode_params.fb.h;
+		prim_mode_params.primary.y = opt.shared_fb_y_offset;
+		scnd_mode_params.primary.y = prim_mode_params.primary.y +
+					prim_mode_params.primary.h;
+		offscreen_fb.y = scnd_mode_params.primary.y + scnd_mode_params.primary.h;
 		break;
 	default:
 		igt_assert(false);
@@ -2075,9 +1929,9 @@ static void prepare_subtest_screens(const struct test_mode *t)
 	enable_prim_screen_and_wait(t);
 	if (t->screen == SCREEN_PRIM) {
 		if (t->plane == PLANE_CUR)
-			set_cursor_for_test(t, &prim_mode_params);
+			set_region_for_test(t, &prim_mode_params.cursor);
 		if (t->plane == PLANE_SPR)
-			set_sprite_for_test(t, &prim_mode_params);
+			set_region_for_test(t, &prim_mode_params.sprite);
 	}
 
 	if (t->pipes == PIPE_SINGLE)
@@ -2086,9 +1940,9 @@ static void prepare_subtest_screens(const struct test_mode *t)
 	enable_scnd_screen_and_wait(t);
 	if (t->screen == SCREEN_SCND) {
 		if (t->plane == PLANE_CUR)
-			set_cursor_for_test(t, &scnd_mode_params);
+			set_region_for_test(t, &scnd_mode_params.cursor);
 		if (t->plane == PLANE_SPR)
-			set_sprite_for_test(t, &scnd_mode_params);
+			set_region_for_test(t, &scnd_mode_params.sprite);
 	}
 }
 
@@ -2123,15 +1977,15 @@ static void rte_subtest(const struct test_mode *t)
 		      DONT_ASSERT_CRC | ASSERT_DRRS_INACTIVE);
 
 	enable_prim_screen_and_wait(t);
-	set_cursor_for_test(t, &prim_mode_params);
-	set_sprite_for_test(t, &prim_mode_params);
+	set_region_for_test(t, &prim_mode_params.cursor);
+	set_region_for_test(t, &prim_mode_params.sprite);
 
 	if (t->pipes == PIPE_SINGLE)
 		return;
 
 	enable_scnd_screen_and_wait(t);
-	set_cursor_for_test(t, &scnd_mode_params);
-	set_sprite_for_test(t, &scnd_mode_params);
+	set_region_for_test(t, &scnd_mode_params.cursor);
+	set_region_for_test(t, &scnd_mode_params.sprite);
 }
 
 static void update_wanted_crc(const struct test_mode *t, struct both_crcs *crc)
@@ -2360,7 +2214,7 @@ static void badformat_subtest(const struct test_mode *t)
 
 	prepare_subtest_data(t, NULL);
 
-	fill_fb_region(&prim_mode_params.fb, COLOR_PRIM_BG);
+	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
 	set_mode_for_params(&prim_mode_params);
 
 	wanted_crc = &blue_crcs[t->format].crc;
@@ -2472,23 +2326,14 @@ static void wait_flip_event(void)
 
 static void set_prim_plane_for_params(struct modeset_params *params)
 {
-	int rc, i;
-	int crtc_idx = kmstest_get_crtc_idx(drm.res, params->crtc_id);
-	uint32_t plane_id = 0;
-
-	for (i = 0; i < drm.plane_res->count_planes; i++)
-		if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) &&
-		    drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY)
-			plane_id = drm.planes[i]->plane_id;
-	igt_assert(plane_id);
-
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     params->fb.fb->fb_id, 0, 0, 0,
-			     params->mode->hdisplay,
-			     params->mode->vdisplay,
-			     params->fb.x << 16, params->fb.y << 16,
-			     params->fb.w << 16, params->fb.h << 16);
-	igt_assert(rc == 0);
+	igt_plane_set_fb(params->primary.plane, params->primary.fb);
+	igt_plane_set_position(params->primary.plane, 0, 0);
+	igt_plane_set_size(params->primary.plane, params->mode->hdisplay, params->mode->vdisplay);
+	igt_fb_set_position(params->primary.fb, params->primary.plane,
+			    params->primary.x, params->primary.y);
+	igt_fb_set_size(params->primary.fb, params->primary.plane,
+			params->primary.w, params->primary.h);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 }
 
 static void page_flip_for_params(struct modeset_params *params,
@@ -2498,8 +2343,8 @@ static void page_flip_for_params(struct modeset_params *params,
 
 	switch (type) {
 	case FLIP_PAGEFLIP:
-		rc = drmModePageFlip(drm.fd, params->crtc_id,
-				     params->fb.fb->fb_id,
+		rc = drmModePageFlip(drm.fd, drm.display.pipes[params->pipe].crtc_id,
+				     params->primary.fb->fb_id,
 				     DRM_MODE_PAGE_FLIP_EVENT, NULL);
 		igt_assert_eq(rc, 0);
 		wait_flip_event();
@@ -2554,17 +2399,17 @@ static void flip_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, pattern);
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  opt.tiling, t->plane, &fb2);
 	fill_fb(&fb2, bg_color);
-	orig_fb = params->fb.fb;
+	orig_fb = params->primary.fb;
 
 	for (r = 0; r < pattern->n_rects; r++) {
-		params->fb.fb = (r % 2 == 0) ? &fb2 : orig_fb;
+		params->primary.fb = (r % 2 == 0) ? &fb2 : orig_fb;
 
 		if (r != 0)
-			draw_rect(pattern, &params->fb, t->method, r - 1);
-		draw_rect(pattern, &params->fb, t->method, r);
+			draw_rect(pattern, &params->primary, t->method, r - 1);
+		draw_rect(pattern, &params->primary, t->method, r);
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
 
 		page_flip_for_params(params, t->flip);
@@ -2600,21 +2445,21 @@ static void fliptrack_subtest(const struct test_mode *t, enum flip_type type)
 
 	prepare_subtest(t, pattern);
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  opt.tiling, t->plane, &fb2);
 	fill_fb(&fb2, COLOR_PRIM_BG);
-	orig_fb = params->fb.fb;
+	orig_fb = params->primary.fb;
 
 	for (r = 0; r < pattern->n_rects; r++) {
-		params->fb.fb = (r % 2 == 0) ? &fb2 : orig_fb;
+		params->primary.fb = (r % 2 == 0) ? &fb2 : orig_fb;
 
 		if (r != 0)
-			draw_rect(pattern, &params->fb, t->method, r - 1);
+			draw_rect(pattern, &params->primary, t->method, r - 1);
 
 		page_flip_for_params(params, type);
 		do_assertions(0);
 
-		draw_rect(pattern, &params->fb, t->method, r);
+		draw_rect(pattern, &params->primary, t->method, r);
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
 
 		do_assertions(ASSERT_PSR_DISABLED);
@@ -2639,41 +2484,30 @@ static void fliptrack_subtest(const struct test_mode *t, enum flip_type type)
  */
 static void move_subtest(const struct test_mode *t)
 {
-	int r, rc;
+	int r;
 	int assertions = ASSERT_NO_ACTION_CHANGE;
 	struct modeset_params *params = pick_params(t);
 	struct draw_pattern_info *pattern = &pattern3;
+	struct fb_region *reg = pick_target(t, params);
 	bool repeat = false;
 
 	prepare_subtest(t, pattern);
 
 	/* Just paint the right color since we start at 0x0. */
-	draw_rect(pattern, pick_target(t, params), t->method, 0);
+	draw_rect(pattern, reg, t->method, 0);
 	update_wanted_crc(t, &pattern->crcs[t->format][0]);
 
 	do_assertions(assertions);
 
 	for (r = 1; r < pattern->n_rects; r++) {
-		struct rect rect = pattern->get_rect(&params->fb, r);
-
-		switch (t->plane) {
-		case PLANE_CUR:
-			rc = drmModeMoveCursor(drm.fd, params->crtc_id, rect.x,
-					       rect.y);
-			igt_assert_eq(rc, 0);
-			break;
-		case PLANE_SPR:
-			rc = drmModeSetPlane(drm.fd, params->sprite_id,
-					     params->crtc_id,
-					     params->sprite.fb->fb_id, 0,
-					     rect.x, rect.y, rect.w,
-					     rect.h, 0, 0, rect.w << 16,
-					     rect.h << 16);
-			igt_assert_eq(rc, 0);
-			break;
-		default:
-			igt_assert(false);
-		}
+		struct rect rect = pattern->get_rect(&params->primary, r);
+
+		igt_plane_set_fb(reg->plane, reg->fb);
+		igt_plane_set_position(reg->plane, rect.x, rect.y);
+		igt_plane_set_size(reg->plane, rect.w, rect.h);
+		igt_fb_set_size(reg->fb, reg->plane, rect.w, rect.h);
+		igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
+
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
 
 		do_assertions(assertions);
@@ -2703,7 +2537,7 @@ static void move_subtest(const struct test_mode *t)
  */
 static void onoff_subtest(const struct test_mode *t)
 {
-	int r, rc;
+	int r;
 	int assertions = ASSERT_NO_ACTION_CHANGE;
 	struct modeset_params *params = pick_params(t);
 	struct draw_pattern_info *pattern = &pattern3;
@@ -2716,49 +2550,21 @@ static void onoff_subtest(const struct test_mode *t)
 	do_assertions(assertions);
 
 	for (r = 0; r < 4; r++) {
+		struct fb_region *reg = pick_target(t, params);
+
 		if (r % 2 == 0) {
-			switch (t->plane) {
-			case PLANE_CUR:
-				rc = drmModeSetCursor(drm.fd, params->crtc_id,
-						      0, 0, 0);
-				igt_assert_eq(rc, 0);
-				break;
-			case PLANE_SPR:
-				rc = drmModeSetPlane(drm.fd, params->sprite_id,
-						     0, 0, 0, 0, 0, 0, 0, 0, 0,
-						     0, 0);
-				igt_assert_eq(rc, 0);
-				break;
-			default:
-				igt_assert(false);
-			}
+			igt_plane_set_fb(reg->plane, NULL);
+			igt_display_commit(&drm.display);
+
 			update_wanted_crc(t, &blue_crcs[t->format].crc);
 
 		} else {
-			switch (t->plane) {
-			case PLANE_CUR:
-				rc = drmModeSetCursor(drm.fd, params->crtc_id,
-						  params->cursor.fb->gem_handle,
-						  params->cursor.w,
-						  params->cursor.h);
-				igt_assert_eq(rc, 0);
-				break;
-			case PLANE_SPR:
-				rc = drmModeSetPlane(drm.fd, params->sprite_id,
-						     params->crtc_id,
-						     params->sprite.fb->fb_id,
-						     0, 0, 0, params->sprite.w,
-						     params->sprite.h, 0,
-						     0,
-						     params->sprite.w << 16,
-						     params->sprite.h << 16);
-				igt_assert_eq(rc, 0);
-				break;
-			default:
-				igt_assert(false);
-			}
-			update_wanted_crc(t, &pattern->crcs[t->format][0]);
+			igt_plane_set_fb(reg->plane, reg->fb);
+			igt_plane_set_size(reg->plane, reg->w, reg->h);
+			igt_fb_set_size(reg->fb, reg->plane, reg->w, reg->h);
+			igt_display_commit(&drm.display);
 
+			update_wanted_crc(t, &pattern->crcs[t->format][0]);
 		}
 
 		do_assertions(assertions);
@@ -2767,24 +2573,11 @@ static void onoff_subtest(const struct test_mode *t)
 
 static bool prim_plane_disabled(void)
 {
-	int i, rc;
-	bool disabled, found = false;
-	int crtc_idx = kmstest_get_crtc_idx(drm.res, prim_mode_params.crtc_id);
-
-	for (i = 0; i < drm.plane_res->count_planes; i++) {
-		if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) &&
-		    drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY) {
-			found = true;
-			disabled = (drm.planes[i]->crtc_id == 0);
-		}
-	}
-
-	igt_assert(found);
-
-	rc = drmSetClientCap(drm.fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 0);
-	igt_assert_eq(rc, 0);
-
-	return disabled;
+	/*
+	 * Cannot use igt_plane_get_prop here to retrieve fb_id,
+	 * the testsuite doesn't require ATOMIC.
+	 */
+	return !prim_mode_params.primary.plane->values[IGT_PLANE_FB_ID];
 }
 
 /*
@@ -2807,11 +2600,10 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
 	struct rect rect;
 	struct modeset_params *params = pick_params(t);
 	int assertions;
-	int rc;
 
 	prepare_subtest(t, pattern);
 
-	rect = pattern->get_rect(&params->fb, 0);
+	rect = pattern->get_rect(&params->primary, 0);
 	create_fb(t->format, rect.w, rect.h, opt.tiling, t->plane,
 		  &fullscreen_fb);
 	/* Call pick_color() again since PRI and SPR may not support the same
@@ -2819,12 +2611,8 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
 	rect.color = pick_color(&fullscreen_fb, COLOR_GREEN);
 	igt_draw_fill_fb(drm.fd, &fullscreen_fb, rect.color);
 
-	rc = drmModeSetPlane(drm.fd, params->sprite_id, params->crtc_id,
-			     fullscreen_fb.fb_id, 0, 0, 0, fullscreen_fb.width,
-			     fullscreen_fb.height, 0, 0,
-			     fullscreen_fb.width << 16,
-			     fullscreen_fb.height << 16);
-	igt_assert_eq(rc, 0);
+	igt_plane_set_fb(params->sprite.plane, &fullscreen_fb);
+	igt_display_commit(&drm.display);
 	update_wanted_crc(t, &pattern->crcs[t->format][0]);
 
 	switch (t->screen) {
@@ -2842,9 +2630,8 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
 	}
 	do_assertions(assertions);
 
-	rc = drmModeSetPlane(drm.fd, params->sprite_id, 0, 0, 0, 0, 0, 0, 0, 0,
-			     0, 0, 0);
-	igt_assert_eq(rc, 0);
+	igt_plane_set_fb(params->sprite.plane, NULL);
+	igt_display_commit(&drm.display);
 
 	if (t->screen == SCREEN_PRIM)
 		assertions = ASSERT_LAST_ACTION_CHANGED;
@@ -2878,98 +2665,69 @@ static void scaledprimary_subtest(const struct test_mode *t)
 {
 	struct igt_fb new_fb, *old_fb;
 	struct modeset_params *params = pick_params(t);
-	int i, rc;
-	uint32_t plane_id;
-	int prim_crtc_idx = kmstest_get_crtc_idx(drm.res,
-						 prim_mode_params.crtc_id);
+	struct fb_region *reg = &params->primary;
 
 	igt_require_f(intel_gen(intel_get_drm_devid(drm.fd)) >= 9,
 		      "Can't test primary plane scaling before gen 9\n");
 
 	prepare_subtest(t, NULL);
 
-	old_fb = params->fb.fb;
+	old_fb = reg->fb;
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, reg->fb->width, reg->fb->height,
 		  opt.tiling, t->plane, &new_fb);
 	fill_fb(&new_fb, COLOR_BLUE);
 
 	igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, &new_fb, t->method,
-			 params->fb.x, params->fb.y,
-			 params->fb.w / 2, params->fb.h / 2,
+			 reg->x, reg->y, reg->w / 2, reg->h / 2,
 			 pick_color(&new_fb, COLOR_GREEN));
 	igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, &new_fb, t->method,
-			 params->fb.x + params->fb.w / 2,
-			 params->fb.y + params->fb.h / 2,
-			 params->fb.w / 2, params->fb.h / 2,
+			 reg->x + reg->w / 2, reg->y + reg->h / 2,
+			 reg->w / 2, reg->h / 2,
 			 pick_color(&new_fb, COLOR_RED));
 	igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, &new_fb, t->method,
-			 params->fb.x + params->fb.w / 2,
-			 params->fb.y + params->fb.h / 2,
-			 params->fb.w / 4, params->fb.h / 4,
+			 reg->x + reg->w / 2, reg->y + reg->h / 2,
+			 reg->w / 4, reg->h / 4,
 			 pick_color(&new_fb, COLOR_MAGENTA));
 
-	for (i = 0; i < drm.plane_res->count_planes; i++)
-		if ((drm.planes[i]->possible_crtcs & (1 << prim_crtc_idx)) &&
-		    drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY)
-			plane_id = drm.planes[i]->plane_id;
-
 	/* No scaling. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     new_fb.fb_id, 0,
-			     0, 0,
-			     params->mode->hdisplay, params->mode->vdisplay,
-			     params->fb.x << 16, params->fb.y << 16,
-			     params->fb.w << 16, params->fb.h << 16);
-	igt_assert(rc == 0);
+	igt_plane_set_fb(reg->plane, &new_fb);
+	igt_fb_set_position(&new_fb, reg->plane, reg->x, reg->y);
+	igt_fb_set_size(&new_fb, reg->plane, reg->w, reg->h);
+	igt_plane_set_size(reg->plane, params->mode->hdisplay, params->mode->vdisplay);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(DONT_ASSERT_CRC);
 
 	/* Source upscaling. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     new_fb.fb_id, 0,
-			     0, 0,
-			     params->mode->hdisplay, params->mode->vdisplay,
-			     params->fb.x << 16, params->fb.y << 16,
-			     (params->fb.w / 2) << 16,
-			     (params->fb.h / 2) << 16);
-	igt_assert(rc == 0);
+	igt_fb_set_size(&new_fb, reg->plane, reg->w / 2, reg->h / 2);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(DONT_ASSERT_CRC);
 
 	/* Destination doesn't fill the entire CRTC, no scaling. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     new_fb.fb_id, 0,
-			     params->mode->hdisplay / 4,
-			     params->mode->vdisplay / 4,
-			     params->mode->hdisplay / 2,
-			     params->mode->vdisplay / 2,
-			     params->fb.x << 16, params->fb.y << 16,
-			     (params->fb.w / 2) << 16,
-			     (params->fb.h / 2) << 16);
-	igt_assert(rc == 0);
+	igt_fb_set_size(&new_fb, reg->plane, reg->w / 2, reg->h / 2);
+	igt_plane_set_position(reg->plane,
+			       params->mode->hdisplay / 4,
+			       params->mode->vdisplay / 4);
+	igt_plane_set_size(reg->plane,
+			   params->mode->hdisplay / 2,
+			   params->mode->vdisplay / 2);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(DONT_ASSERT_CRC);
 
 	/* Destination doesn't fill the entire CRTC, upscaling. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     new_fb.fb_id, 0,
-			     params->mode->hdisplay / 4,
-			     params->mode->vdisplay / 4,
-			     params->mode->hdisplay / 2,
-			     params->mode->vdisplay / 2,
-			     (params->fb.x + params->fb.w / 2) << 16,
-			     (params->fb.y + params->fb.h / 2) << 16,
-			     (params->fb.w / 4) << 16,
-			     (params->fb.h / 4) << 16);
-	igt_assert(rc == 0);
+	igt_fb_set_position(&new_fb, reg->plane,
+			    reg->x + reg->w / 4, reg->y + reg->h / 4);
+	igt_fb_set_size(&new_fb, reg->plane, reg->w / 2, reg->h / 2);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(DONT_ASSERT_CRC);
 
 	/* Back to the good and old blue fb. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     old_fb->fb_id, 0,
-			     0, 0,
-			     params->mode->hdisplay, params->mode->vdisplay,
-			     params->fb.x << 16, params->fb.y << 16,
-			     params->fb.w << 16, params->fb.h << 16);
-	igt_assert(rc == 0);
+	igt_plane_set_fb(reg->plane, old_fb);
+	igt_plane_set_position(params->primary.plane, 0, 0);
+	igt_plane_set_size(reg->plane, params->mode->hdisplay, params->mode->vdisplay);
+	igt_fb_set_position(reg->fb, reg->plane, reg->x, reg->y);
+	igt_fb_set_size(reg->fb, reg->plane, reg->w, reg->h);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(0);
 
 	igt_remove_fb(drm.fd, &new_fb);
@@ -2999,15 +2757,15 @@ static void modesetfrombusy_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, NULL);
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  opt.tiling, t->plane, &fb2);
 	fill_fb(&fb2, COLOR_PRIM_BG);
 
-	start_busy_thread(params->fb.fb);
+	start_busy_thread(params->primary.fb);
 	usleep(10000);
 
 	unset_all_crtcs();
-	params->fb.fb = &fb2;
+	params->primary.fb = &fb2;
 	set_mode_for_params(params);
 
 	do_assertions(0);
@@ -3109,9 +2867,9 @@ static void farfromfence_subtest(const struct test_mode *t)
 
 	fill_fb(&tall_fb, COLOR_PRIM_BG);
 
-	params->fb.fb = &tall_fb;
-	params->fb.x = 0;
-	params->fb.y = max_height - params->mode->vdisplay;
+	params->primary.fb = &tall_fb;
+	params->primary.x = 0;
+	params->primary.y = max_height - params->mode->vdisplay;
 	set_mode_for_params(params);
 	do_assertions(assertions);
 
@@ -3177,30 +2935,30 @@ static void badstride_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, NULL);
 
-	old_fb = params->fb.fb;
+	old_fb = params->primary.fb;
 
-	create_fb(t->format, params->fb.fb->width + 4096, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width + 4096, params->primary.fb->height,
 		  opt.tiling, t->plane, &wide_fb);
 	igt_assert(wide_fb.stride > 16384);
 
 	fill_fb(&wide_fb, COLOR_PRIM_BG);
 
 	/* Try a simple modeset with the new fb. */
-	params->fb.fb = &wide_fb;
+	params->primary.fb = &wide_fb;
 	set_mode_for_params(params);
 	do_assertions(ASSERT_FBC_DISABLED);
 
 	/* Go back to the old fb so FBC works again. */
-	params->fb.fb = old_fb;
+	params->primary.fb = old_fb;
 	set_mode_for_params(params);
 	do_assertions(0);
 
 	/* We're doing the equivalent of a modeset, but with the planes API. */
-	params->fb.fb = &wide_fb;
+	params->primary.fb = &wide_fb;
 	set_prim_plane_for_params(params);
 	do_assertions(ASSERT_FBC_DISABLED);
 
-	params->fb.fb = old_fb;
+	params->primary.fb = old_fb;
 	set_mode_for_params(params);
 	do_assertions(0);
 
@@ -3209,7 +2967,7 @@ static void badstride_subtest(const struct test_mode *t)
 	 * with a different stride. With the atomic page flip helper we can,
 	 * so allow page flip to fail and succeed.
 	 */
-	rc = drmModePageFlip(drm.fd, params->crtc_id, wide_fb.fb_id, 0, NULL);
+	rc = drmModePageFlip(drm.fd, drm.display.pipes[params->pipe].crtc_id, wide_fb.fb_id, 0, NULL);
 	igt_assert(rc == -EINVAL || rc == 0);
 	do_assertions(rc == 0 ? ASSERT_FBC_DISABLED : 0);
 
@@ -3244,9 +3002,9 @@ static void stridechange_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, NULL);
 
-	old_fb = params->fb.fb;
+	old_fb = params->primary.fb;
 
-	create_fb(t->format, params->fb.fb->width + 512, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width + 512, params->primary.fb->height,
 		  opt.tiling, t->plane, &new_fb);
 	fill_fb(&new_fb, COLOR_PRIM_BG);
 
@@ -3254,21 +3012,21 @@ static void stridechange_subtest(const struct test_mode *t)
 
 	/* We can't assert that FBC will be enabled since there may not be
 	 * enough space for the CFB, but we can check the CRC. */
-	params->fb.fb = &new_fb;
+	params->primary.fb = &new_fb;
 	set_mode_for_params(params);
 	do_assertions(DONT_ASSERT_FEATURE_STATUS);
 
 	/* Go back to the fb that can have FBC. */
-	params->fb.fb = old_fb;
+	params->primary.fb = old_fb;
 	set_mode_for_params(params);
 	do_assertions(0);
 
 	/* This operation is the same as above, but with the planes API. */
-	params->fb.fb = &new_fb;
+	params->primary.fb = &new_fb;
 	set_prim_plane_for_params(params);
 	do_assertions(DONT_ASSERT_FEATURE_STATUS);
 
-	params->fb.fb = old_fb;
+	params->primary.fb = old_fb;
 	set_prim_plane_for_params(params);
 	do_assertions(0);
 
@@ -3276,7 +3034,7 @@ static void stridechange_subtest(const struct test_mode *t)
 	 * Try to set a new stride. with the page flip api. This is allowed
 	 * with the atomic page flip helper, but not with the legacy page flip.
 	 */
-	rc = drmModePageFlip(drm.fd, params->crtc_id, new_fb.fb_id, 0, NULL);
+	rc = drmModePageFlip(drm.fd, drm.display.pipes[params->pipe].crtc_id, new_fb.fb_id, 0, NULL);
 	igt_assert(rc == -EINVAL || rc == 0);
 	do_assertions(0);
 
@@ -3307,9 +3065,9 @@ static void tilingchange_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, NULL);
 
-	old_fb = params->fb.fb;
+	old_fb = params->primary.fb;
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  LOCAL_DRM_FORMAT_MOD_NONE, t->plane, &new_fb);
 	fill_fb(&new_fb, COLOR_PRIM_BG);
 
@@ -3317,12 +3075,12 @@ static void tilingchange_subtest(const struct test_mode *t)
 		igt_debug("Flip type: %d\n", flip_type);
 
 		/* Set a buffer with no tiling. */
-		params->fb.fb = &new_fb;
+		params->primary.fb = &new_fb;
 		page_flip_for_params(params, flip_type);
 		do_assertions(ASSERT_FBC_DISABLED);
 
 		/* Put FBC back in a working state. */
-		params->fb.fb = old_fb;
+		params->primary.fb = old_fb;
 		page_flip_for_params(params, flip_type);
 		do_assertions(0);
 	}
@@ -3365,15 +3123,15 @@ static void basic_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, pattern);
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  opt.tiling, t->plane, &fb2);
-	fb1 = params->fb.fb;
+	fb1 = params->primary.fb;
 
 	for (r = 0, method = 0; method < IGT_DRAW_METHOD_COUNT; method++, r++) {
 		if (r == pattern->n_rects) {
-			params->fb.fb = (params->fb.fb == fb1) ? &fb2 : fb1;
+			params->primary.fb = (params->primary.fb == fb1) ? &fb2 : fb1;
 
-			fill_fb_region(&params->fb, COLOR_PRIM_BG);
+			fill_fb_region(&params->primary, COLOR_PRIM_BG);
 			update_wanted_crc(t, &blue_crcs[t->format].crc);
 
 			page_flip_for_params(params, t->flip);
@@ -3382,7 +3140,7 @@ static void basic_subtest(const struct test_mode *t)
 			r = 0;
 		}
 
-		draw_rect(pattern, &params->fb, method, r);
+		draw_rect(pattern, &params->primary, method, r);
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
 		do_assertions(assertions);
 	}
Signature · 6 lines
2.16.2

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#4 lore raw

PATCH 1/1 tests/kms_frontbuffer_tracking: Convert test to use igt_display, v2.

Straight conversion, no behavioral changes yet.

Changes since v1:
- Handle 2x outputs correctly.

---
 tests/kms_frontbuffer_tracking.c | 780 ++++++++++++++-------------------------
 1 file changed, 269 insertions(+), 511 deletions(-)
tests/kms_frontbuffer_tracking.c +269 -511
index 1483c228044e..17ed6a2af7ad 100644
@@ -151,18 +151,11 @@ struct rect {
 	uint32_t color;
 };
 
-#define MAX_CONNECTORS 32
-#define MAX_PLANES 32
-#define MAX_ENCODERS 32
 struct {
 	int fd;
 	int debugfs;
-	drmModeResPtr res;
-	drmModeConnectorPtr connectors[MAX_CONNECTORS];
-	drmModeEncoderPtr encoders[MAX_ENCODERS];
-	drmModePlaneResPtr plane_res;
-	drmModePlanePtr planes[MAX_PLANES];
-	uint64_t plane_types[MAX_PLANES];
+	igt_display_t display;
+
 	drm_intel_bufmgr *bufmgr;
 } drm;
 
@@ -222,6 +215,7 @@ struct {
  * have a big framebuffer and the CRTC is just displaying a subregion of this
  * big FB. */
 struct fb_region {
+	igt_plane_t *plane;
 	struct igt_fb *fb;
 	int x;
 	int y;
@@ -277,17 +271,18 @@ struct {
 };
 
 struct modeset_params {
-	uint32_t crtc_id;
-	uint32_t connector_id;
-	uint32_t sprite_id;
-	drmModeModeInfoPtr mode;
-	struct fb_region fb;
+	enum pipe pipe;
+	igt_output_t *output;
+	drmModeModeInfo mode_copy, *mode;
+
+	struct fb_region primary;
 	struct fb_region cursor;
 	struct fb_region sprite;
 };
 
 struct modeset_params prim_mode_params;
 struct modeset_params scnd_mode_params;
+
 struct fb_region offscreen_fb;
 struct screen_fbs {
 	bool initialized;
@@ -337,13 +332,14 @@ drmModeModeInfo std_1024_mode = {
 	.name = "Custom 1024x768",
 };
 
-static drmModeModeInfoPtr get_connector_smallest_mode(drmModeConnectorPtr c)
+static drmModeModeInfo *get_connector_smallest_mode(igt_output_t *output)
 {
+	drmModeConnector *c = output->config.connector;
+	drmModeModeInfo *smallest = NULL;
 	int i;
-	drmModeModeInfoPtr smallest = NULL;
 
 	for (i = 0; i < c->count_modes; i++) {
-		drmModeModeInfoPtr mode = &c->modes[i];
+		drmModeModeInfo *mode = &c->modes[i];
 
 		if (!smallest)
 			smallest = mode;
@@ -359,71 +355,53 @@ static drmModeModeInfoPtr get_connector_smallest_mode(drmModeConnectorPtr c)
 	return smallest;
 }
 
-static drmModeConnectorPtr get_connector(uint32_t id)
-{
-	int i;
-
-	for (i = 0; i < drm.res->count_connectors; i++)
-		if (drm.res->connectors[i] == id)
-			return drm.connectors[i];
-
-	igt_assert(false);
-}
-
-static drmModeEncoderPtr get_encoder(uint32_t id)
+static drmModeModeInfo *connector_get_mode(igt_output_t *output)
 {
-	int i;
+	drmModeModeInfo *mode = NULL;
 
-	for (i = 0; i < drm.res->count_encoders; i++)
-		if (drm.res->encoders[i] == id)
-			return drm.encoders[i];
-
-	igt_assert(false);
-}
+	if (opt.small_modes)
+		mode = get_connector_smallest_mode(output);
+	else
+		mode = &output->config.default_mode;
 
-static void print_mode_info(const char *screen, struct modeset_params *params)
-{
-	drmModeConnectorPtr c = get_connector(params->connector_id);
+	 /* On HSW the CRC WA is so awful that it makes you think everything is
+	  * bugged. */
+	if (IS_HASWELL(intel_get_drm_devid(drm.fd)) &&
+	    output->config.connector->connector_type == DRM_MODE_CONNECTOR_eDP)
+		mode = &std_1024_mode;
 
-	igt_info("%s screen: %s %s, crtc %d\n",
-		 screen,
-		 kmstest_connector_type_str(c->connector_type),
-		 params->mode->name,
-		 kmstest_get_crtc_idx(drm.res, params->crtc_id));
+	return mode;
 }
 
-static void init_mode_params(struct modeset_params *params, uint32_t crtc_id,
-			     drmModeConnectorPtr connector,
-			     drmModeModeInfoPtr mode)
+static void init_mode_params(struct modeset_params *params,
+			     igt_output_t *output, enum pipe pipe)
 {
-	uint32_t overlay_plane_id = 0;
-	int crtc_idx = kmstest_get_crtc_idx(drm.res, crtc_id);
-	int i;
-
-	for (i = 0; i < drm.plane_res->count_planes; i++)
-		if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) &&
-		    drm.plane_types[i] == DRM_PLANE_TYPE_OVERLAY) {
-			overlay_plane_id = drm.planes[i]->plane_id;
-			break;
-		}
+	drmModeModeInfo *mode;
 
-	igt_require(overlay_plane_id);
+	igt_output_override_mode(output, NULL);
+	mode = connector_get_mode(output);
 
-	params->crtc_id = crtc_id;
-	params->connector_id = connector->connector_id;
-	params->mode = mode;
-	params->sprite_id = overlay_plane_id;
+	params->pipe = pipe;
+	params->output = output;
+	params->mode_copy = *mode;
+	params->mode = &params->mode_copy;
 
-	params->fb.fb = NULL;
-	params->fb.w = mode->hdisplay;
-	params->fb.h = mode->vdisplay;
+	params->primary.plane = igt_pipe_get_plane_type(&drm.display.pipes[pipe], DRM_PLANE_TYPE_PRIMARY);
+	params->primary.fb = NULL;
+	params->primary.x = 0;
+	params->primary.y = 0;
+	params->primary.w = mode->hdisplay;
+	params->primary.h = mode->vdisplay;
 
+	params->cursor.plane = igt_pipe_get_plane_type(&drm.display.pipes[pipe], DRM_PLANE_TYPE_CURSOR);
 	params->cursor.fb = NULL;
 	params->cursor.x = 0;
 	params->cursor.y = 0;
 	params->cursor.w = 64;
 	params->cursor.h = 64;
 
+	params->sprite.plane = igt_pipe_get_plane_type(&drm.display.pipes[pipe], DRM_PLANE_TYPE_OVERLAY);
+	igt_require(params->sprite.plane);
 	params->sprite.fb = NULL;
 	params->sprite.x = 0;
 	params->sprite.y = 0;
@@ -431,63 +409,32 @@ static void init_mode_params(struct modeset_params *params, uint32_t crtc_id,
 	params->sprite.h = 64;
 }
 
-static bool connector_get_mode(drmModeConnectorPtr c, drmModeModeInfoPtr *mode)
-{
-	*mode = NULL;
-
-	if (c->connection != DRM_MODE_CONNECTED || !c->count_modes)
-		return false;
-
-	if (c->connector_type == DRM_MODE_CONNECTOR_eDP && opt.no_edp)
-		return false;
-
-	if (opt.small_modes)
-		*mode = get_connector_smallest_mode(c);
-	else
-		*mode = &c->modes[0];
-
-	 /* On HSW the CRC WA is so awful that it makes you think everything is
-	  * bugged. */
-	if (IS_HASWELL(intel_get_drm_devid(drm.fd)) &&
-	    c->connector_type == DRM_MODE_CONNECTOR_eDP)
-		*mode = &std_1024_mode;
-
-	return true;
-}
-
-static bool connector_supports_pipe_a(drmModeConnectorPtr connector)
-{
-	int i;
-
-	for (i = 0; i < connector->count_encoders; i++)
-		if (get_encoder(connector->encoders[i])->possible_crtcs & 1)
-			return true;
-
-	return false;
-}
-
-static bool find_connector(bool edp_only, bool pipe_a, uint32_t forbidden_id,
-			   drmModeConnectorPtr *ret_connector,
-			   drmModeModeInfoPtr *ret_mode)
+static bool find_connector(bool edp_only, bool pipe_a,
+			   igt_output_t *forbidden_output,
+			   enum pipe forbidden_pipe,
+			   igt_output_t **ret_output,
+			   enum pipe *ret_pipe)
 {
-	drmModeConnectorPtr c = NULL;
-	drmModeModeInfoPtr mode = NULL;
-	int i;
+	igt_output_t *output;
+	enum pipe pipe;
 
-	for (i = 0; i < drm.res->count_connectors; i++) {
-		c = drm.connectors[i];
+	for_each_pipe_with_valid_output(&drm.display, pipe, output) {
+		drmModeConnectorPtr c = output->config.connector;
 
 		if (edp_only && c->connector_type != DRM_MODE_CONNECTOR_eDP)
 			continue;
-		if (pipe_a && !connector_supports_pipe_a(c))
+
+		if (pipe_a && pipe != PIPE_A)
 			continue;
-		if (c->connector_id == forbidden_id)
+
+		if (output == forbidden_output || pipe == forbidden_pipe)
 			continue;
-		if (!connector_get_mode(c, &mode))
+
+		if (c->connector_type == DRM_MODE_CONNECTOR_eDP && opt.no_edp)
 			continue;
 
-		*ret_connector = c;
-		*ret_mode = mode;
+		*ret_output = output;
+		*ret_pipe = pipe;
 		return true;
 	}
 
@@ -496,9 +443,8 @@ static bool find_connector(bool edp_only, bool pipe_a, uint32_t forbidden_id,
 
 static bool init_modeset_cached_params(void)
 {
-	drmModeConnectorPtr prim_connector = NULL, scnd_connector = NULL;
-	drmModeModeInfoPtr prim_mode = NULL, scnd_mode = NULL;
-	uint32_t prim_crtc_id, scnd_crtc_id;
+	igt_output_t *prim_output = NULL, *scnd_output = NULL;
+	enum pipe prim_pipe, scnd_pipe;
 
 	/*
 	 * We have this problem where PSR is only present on eDP monitors and
@@ -508,39 +454,29 @@ static bool init_modeset_cached_params(void)
 	 * TODO: refactor the code in a way that allows us to have different
 	 * sets of prim/scnd structs for different features.
 	 */
-	find_connector(true, true, 0, &prim_connector, &prim_mode);
-	if (!prim_connector)
-		find_connector(true, false, 0, &prim_connector, &prim_mode);
-	if (!prim_connector)
-		find_connector(false, true, 0, &prim_connector, &prim_mode);
-	if (!prim_connector)
-		find_connector(false, false, 0, &prim_connector, &prim_mode);
-
-	if (!prim_connector)
+	find_connector(true, true, NULL, PIPE_NONE, &prim_output, &prim_pipe);
+	if (!prim_output)
+		find_connector(true, false, NULL, PIPE_NONE, &prim_output, &prim_pipe);
+	if (!prim_output)
+		find_connector(false, true, NULL, PIPE_NONE, &prim_output, &prim_pipe);
+	if (!prim_output)
+		find_connector(false, false, NULL, PIPE_NONE, &prim_output, &prim_pipe);
+
+	if (!prim_output)
 		return false;
 
-	find_connector(false, false, prim_connector->connector_id,
-		       &scnd_connector, &scnd_mode);
+	find_connector(false, false, prim_output, prim_pipe,
+		       &scnd_output, &scnd_pipe);
 
-	prim_crtc_id = kmstest_find_crtc_for_connector(drm.fd, drm.res,
-						       prim_connector, 0);
-	init_mode_params(&prim_mode_params, prim_crtc_id,
-			 prim_connector, prim_mode);
-	print_mode_info("Primary", &prim_mode_params);
+	init_mode_params(&prim_mode_params, prim_output, prim_pipe);
 
-	if (!scnd_connector) {
-		scnd_mode_params.connector_id = 0;
+	if (!scnd_output) {
+		scnd_mode_params.pipe = PIPE_NONE;
+		scnd_mode_params.output = NULL;
 		return true;
 	}
 
-	igt_require(drm.res->count_crtcs >= 2);
-	scnd_crtc_id = kmstest_find_crtc_for_connector(drm.fd, drm.res,
-						      scnd_connector,
-			1 << kmstest_get_crtc_idx(drm.res, prim_crtc_id));
-	init_mode_params(&scnd_mode_params, scnd_crtc_id,
-			 scnd_connector, scnd_mode);
-	print_mode_info("Secondary", &scnd_mode_params);
-
+	init_mode_params(&scnd_mode_params, scnd_output, scnd_pipe);
 	return true;
 }
 
@@ -699,7 +635,7 @@ static void create_shared_fb(enum pixel_format format)
 	prim_w = prim_mode_params.mode->hdisplay;
 	prim_h = prim_mode_params.mode->vdisplay;
 
-	if (scnd_mode_params.connector_id) {
+	if (scnd_mode_params.output) {
 		scnd_w = scnd_mode_params.mode->hdisplay;
 		scnd_h = scnd_mode_params.mode->vdisplay;
 	} else {
@@ -728,7 +664,7 @@ static void destroy_fbs(enum pixel_format format)
 	if (!s->initialized)
 		return;
 
-	if (scnd_mode_params.connector_id) {
+	if (scnd_mode_params.output) {
 		igt_remove_fb(drm.fd, &s->scnd_pri);
 		igt_remove_fb(drm.fd, &s->scnd_cur);
 		igt_remove_fb(drm.fd, &s->scnd_spr);
@@ -764,7 +700,7 @@ static void create_fbs(enum pixel_format format)
 
 	create_shared_fb(format);
 
-	if (!scnd_mode_params.connector_id)
+	if (!scnd_mode_params.output)
 		return;
 
 	create_fb(format, scnd_mode_params.mode->hdisplay,
@@ -776,14 +712,16 @@ static void create_fbs(enum pixel_format format)
 		  opt.tiling, PLANE_SPR, &s->scnd_spr);
 }
 
-static bool set_mode_for_params(struct modeset_params *params)
+static void set_mode_for_params(struct modeset_params *params)
 {
-	int rc;
+	igt_output_override_mode(params->output, params->mode);
+	igt_output_set_pipe(params->output, params->pipe);
 
-	rc = drmModeSetCrtc(drm.fd, params->crtc_id, params->fb.fb->fb_id,
-			    params->fb.x, params->fb.y,
-			    &params->connector_id, 1, params->mode);
-	return (rc == 0);
+	igt_plane_set_fb(params->primary.plane, params->primary.fb);
+	igt_plane_set_position(params->primary.plane, 0, 0);
+	igt_fb_set_position(params->primary.fb, params->primary.plane, params->primary.x, params->primary.y);
+	igt_fb_set_size(params->primary.fb, params->primary.plane, params->primary.w, params->primary.h);
+	igt_display_commit(&drm.display);
 }
 
 static void __debugfs_read(const char *param, char *buf, int len)
@@ -1238,22 +1176,8 @@ static void fill_fb_region(struct fb_region *region, enum color ecolor)
 
 static void unset_all_crtcs(void)
 {
-	int i, rc;
-
-	for (i = 0; i < drm.res->count_crtcs; i++) {
-		rc = drmModeSetCrtc(drm.fd, drm.res->crtcs[i], -1, 0, 0, NULL,
-				    0, NULL);
-		igt_assert_eq(rc, 0);
-
-		rc = drmModeSetCursor(drm.fd, drm.res->crtcs[i], 0, 0, 0);
-		igt_assert_eq(rc, 0);
-	}
-
-	for (i = 0; i < drm.plane_res->count_planes; i++) {
-		rc = drmModeSetPlane(drm.fd, drm.plane_res->planes[i], 0, 0, 0,
-				     0, 0, 0, 0, 0, 0, 0, 0);
-		igt_assert_eq(rc, 0);
-	}
+	igt_display_reset(&drm.display);
+	igt_display_commit(&drm.display);
 }
 
 static void disable_features(const struct test_mode *t)
@@ -1325,10 +1249,11 @@ static void collect_crcs(struct both_crcs *crcs, bool mandatory_sink_crc)
 	get_sink_crc(&crcs->sink, mandatory_sink_crc);
 }
 
+static void setup_sink_crc(void);
+
 static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc)
 {
 	struct igt_fb blue;
-	int rc;
 
 	if (blue_crcs[format].initialized)
 		return;
@@ -1339,10 +1264,18 @@ static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc)
 
 	fill_fb(&blue, COLOR_PRIM_BG);
 
-	rc = drmModeSetCrtc(drm.fd, prim_mode_params.crtc_id,
-			    blue.fb_id, 0, 0, &prim_mode_params.connector_id, 1,
-			    prim_mode_params.mode);
-	igt_assert_eq(rc, 0);
+	igt_output_set_pipe(prim_mode_params.output, prim_mode_params.pipe);
+	igt_output_override_mode(prim_mode_params.output, prim_mode_params.mode);
+	igt_plane_set_fb(prim_mode_params.primary.plane, &blue);
+	igt_display_commit(&drm.display);
+
+	if (!pipe_crc) {
+		pipe_crc = igt_pipe_crc_new(drm.fd, prim_mode_params.pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+		igt_assert(pipe_crc);
+
+		setup_sink_crc();
+	}
+
 	collect_crcs(&blue_crcs[format].crc, mandatory_sink_crc);
 
 	print_crc("Blue CRC:  ", &blue_crcs[format].crc);
@@ -1358,7 +1291,7 @@ static void init_crcs(enum pixel_format format,
 		      struct draw_pattern_info *pattern,
 		      bool mandatory_sink_crc)
 {
-	int r, r_, rc;
+	int r, r_;
 	struct igt_fb tmp_fbs[pattern->n_rects];
 
 	if (pattern->initialized[format])
@@ -1386,12 +1319,11 @@ static void init_crcs(enum pixel_format format,
 					 r);
 	}
 
+	igt_output_set_pipe(prim_mode_params.output, prim_mode_params.pipe);
 	for (r = 0; r < pattern->n_rects; r++) {
-		rc = drmModeSetCrtc(drm.fd, prim_mode_params.crtc_id,
-				   tmp_fbs[r].fb_id, 0, 0,
-				   &prim_mode_params.connector_id, 1,
-				   prim_mode_params.mode);
-		igt_assert_eq(rc, 0);
+		igt_plane_set_fb(prim_mode_params.primary.plane, &tmp_fbs[r]);
+		igt_display_commit(&drm.display);
+
 		collect_crcs(&pattern->crcs[format][r], mandatory_sink_crc);
 	}
 
@@ -1408,50 +1340,13 @@ static void init_crcs(enum pixel_format format,
 	pattern->initialized[format] = true;
 }
 
-static uint64_t get_plane_type(uint32_t plane_id)
-{
-	bool found;
-	uint64_t prop_value;
-	drmModePropertyPtr prop;
-
-	found = kmstest_get_property(drm.fd, plane_id, DRM_MODE_OBJECT_PLANE,
-				     "type", NULL, &prop_value, &prop);
-	igt_assert(found);
-	igt_assert(prop->flags & DRM_MODE_PROP_ENUM);
-	igt_assert(prop_value < prop->count_enums);
-
-	drmModeFreeProperty(prop);
-	return prop_value;
-}
-
 static void setup_drm(void)
 {
-	int i, rc;
-
 	drm.fd = drm_open_driver_master(DRIVER_INTEL);
 	drm.debugfs = igt_debugfs_dir(drm.fd);
 
-	drm.res = drmModeGetResources(drm.fd);
-	igt_assert(drm.res->count_connectors <= MAX_CONNECTORS);
-	igt_assert(drm.res->count_encoders <= MAX_ENCODERS);
-
-	for (i = 0; i < drm.res->count_connectors; i++)
-		drm.connectors[i] = drmModeGetConnectorCurrent(drm.fd,
-						drm.res->connectors[i]);
-	for (i = 0; i < drm.res->count_encoders; i++)
-		drm.encoders[i] = drmModeGetEncoder(drm.fd,
-						    drm.res->encoders[i]);
-
-	rc = drmSetClientCap(drm.fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
-	igt_require(rc == 0);
-
-	drm.plane_res = drmModeGetPlaneResources(drm.fd);
-	igt_assert(drm.plane_res->count_planes <= MAX_PLANES);
-
-	for (i = 0; i < drm.plane_res->count_planes; i++) {
-		drm.planes[i] = drmModeGetPlane(drm.fd, drm.plane_res->planes[i]);
-		drm.plane_types[i] = get_plane_type(drm.plane_res->planes[i]);
-	}
+	kmstest_set_vt_graphics_mode();
+	igt_display_init(&drm.display, drm.fd);
 
 	drm.bufmgr = drm_intel_bufmgr_gem_init(drm.fd, 4096);
 	igt_assert(drm.bufmgr);
@@ -1460,20 +1355,8 @@ static void setup_drm(void)
 
 static void teardown_drm(void)
 {
-	int i;
-
 	drm_intel_bufmgr_destroy(drm.bufmgr);
-
-	for (i = 0; i < drm.plane_res->count_planes; i++)
-		drmModeFreePlane(drm.planes[i]);
-	drmModeFreePlaneResources(drm.plane_res);
-
-	for (i = 0; i < drm.res->count_encoders; i++)
-		drmModeFreeEncoder(drm.encoders[i]);
-	for (i = 0; i < drm.res->count_connectors; i++)
-		drmModeFreeConnector(drm.connectors[i]);
-
-	drmModeFreeResources(drm.res);
+	igt_display_fini(&drm.display);
 	close(drm.fd);
 }
 
@@ -1484,7 +1367,6 @@ static void setup_modeset(void)
 	offscreen_fb.w = 1024;
 	offscreen_fb.h = 1024;
 	create_fbs(FORMAT_DEFAULT);
-	kmstest_set_vt_graphics_mode();
 }
 
 static void teardown_modeset(void)
@@ -1500,7 +1382,7 @@ static void setup_sink_crc(void)
 	sink_crc_t crc;
 	drmModeConnectorPtr c;
 
-	c = get_connector(prim_mode_params.connector_id);
+	c = prim_mode_params.output->config.connector;
 	if (c->connector_type != DRM_MODE_CONNECTOR_eDP) {
 		igt_info("Sink CRC not supported: primary screen is not eDP\n");
 		sink_crc.supported = false;
@@ -1510,9 +1392,9 @@ static void setup_sink_crc(void)
 	/* We need to make sure there's a mode set on the eDP screen and it's
 	 * not on DPMS state, otherwise we fall into the "Unexpected sink CRC
 	 * error" case. */
-	prim_mode_params.fb.fb = &fbs[FORMAT_DEFAULT].prim_pri;
-	prim_mode_params.fb.x = prim_mode_params.fb.y = 0;
-	fill_fb_region(&prim_mode_params.fb, COLOR_PRIM_BG);
+	prim_mode_params.primary.fb = &fbs[FORMAT_DEFAULT].prim_pri;
+	prim_mode_params.primary.x = prim_mode_params.primary.y = 0;
+	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
 	set_mode_for_params(&prim_mode_params);
 
 	sink_crc.fd = openat(drm.debugfs, "i915_sink_crc_eDP1", O_RDONLY);
@@ -1525,11 +1407,6 @@ static void setup_sink_crc(void)
 static void setup_crcs(void)
 {
 	enum pixel_format f;
-	int crtc_idx = kmstest_get_crtc_idx(drm.res, prim_mode_params.crtc_id);
-
-	pipe_crc = igt_pipe_crc_new(drm.fd, crtc_idx, INTEL_PIPE_CRC_SOURCE_AUTO);
-
-	setup_sink_crc();
 
 	for (f = 0; f < FORMAT_COUNT; f++)
 		blue_crcs[f].initialized = false;
@@ -1601,7 +1478,6 @@ static bool fbc_supported_on_chipset(void)
 
 static void setup_fbc(void)
 {
-	drmModeConnectorPtr c = get_connector(prim_mode_params.connector_id);
 	int devid = intel_get_drm_devid(drm.fd);
 
 	if (!fbc_supported_on_chipset()) {
@@ -1614,7 +1490,7 @@ static void setup_fbc(void)
 	 * is not prepared for that yet.
 	 * TODO: solve this.
 	 */
-	if (!connector_supports_pipe_a(c)) {
+	if (prim_mode_params.pipe != PIPE_A) {
 		igt_info("Can't test FBC: primary connector doesn't support "
 			 "pipe A\n");
 		return;
@@ -1646,7 +1522,7 @@ static bool psr_sink_has_support(void)
 
 static void setup_psr(void)
 {
-	if (get_connector(prim_mode_params.connector_id)->connector_type !=
+	if (prim_mode_params.output->config.connector->connector_type !=
 	    DRM_MODE_CONNECTOR_eDP) {
 		igt_info("Can't test PSR: no usable eDP screen.\n");
 		return;
@@ -1665,7 +1541,7 @@ static void teardown_psr(void)
 
 static void setup_drrs(void)
 {
-	if (get_connector(prim_mode_params.connector_id)->connector_type !=
+	if (prim_mode_params.output->config.connector->connector_type !=
 	    DRM_MODE_CONNECTOR_eDP) {
 		igt_info("Can't test DRRS: no usable eDP screen.\n");
 		return;
@@ -1734,7 +1610,7 @@ static struct fb_region *pick_target(const struct test_mode *t,
 
 	switch (t->plane) {
 	case PLANE_PRI:
-		return &params->fb;
+		return &params->primary;
 	case PLANE_CUR:
 		return &params->cursor;
 	case PLANE_SPR:
@@ -1904,7 +1780,7 @@ static void __do_assertions(const struct test_mode *t, int flags,
 
 static void enable_prim_screen_and_wait(const struct test_mode *t)
 {
-	fill_fb_region(&prim_mode_params.fb, COLOR_PRIM_BG);
+	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
 	set_mode_for_params(&prim_mode_params);
 
 	wanted_crc = &blue_crcs[t->format].crc;
@@ -1915,45 +1791,23 @@ static void enable_prim_screen_and_wait(const struct test_mode *t)
 
 static void enable_scnd_screen_and_wait(const struct test_mode *t)
 {
-	fill_fb_region(&scnd_mode_params.fb, COLOR_SCND_BG);
+	fill_fb_region(&scnd_mode_params.primary, COLOR_SCND_BG);
 	set_mode_for_params(&scnd_mode_params);
 
 	do_assertions(ASSERT_NO_ACTION_CHANGE);
 }
 
-static void set_cursor_for_test(const struct test_mode *t,
-				struct modeset_params *params)
-{
-	int rc;
-
-	fill_fb_region(&params->cursor, COLOR_PRIM_BG);
-
-	rc = drmModeMoveCursor(drm.fd, params->crtc_id, 0, 0);
-	igt_assert_eq(rc, 0);
-
-	rc = drmModeSetCursor(drm.fd, params->crtc_id,
-			      params->cursor.fb->gem_handle,
-			      params->cursor.w,
-			      params->cursor.h);
-	igt_assert_eq(rc, 0);
-
-	do_assertions(ASSERT_NO_ACTION_CHANGE);
-}
-
-static void set_sprite_for_test(const struct test_mode *t,
-				struct modeset_params *params)
+static void set_region_for_test(const struct test_mode *t,
+				struct fb_region *reg)
 {
-	int rc;
-
-	fill_fb_region(&params->sprite, COLOR_PRIM_BG);
+	fill_fb_region(reg, COLOR_PRIM_BG);
 
-	rc = drmModeSetPlane(drm.fd, params->sprite_id, params->crtc_id,
-			     params->sprite.fb->fb_id, 0, 0, 0,
-			     params->sprite.w, params->sprite.h,
-			     0, 0, params->sprite.w << 16,
-			     params->sprite.h << 16);
-	igt_assert_eq(rc, 0);
+	igt_plane_set_fb(reg->plane, reg->fb);
+	igt_plane_set_position(reg->plane, 0, 0);
+	igt_plane_set_size(reg->plane, reg->w, reg->h);
+	igt_fb_set_size(reg->fb, reg->plane, reg->w, reg->h);
 
+	igt_display_commit(&drm.display);
 	do_assertions(ASSERT_NO_ACTION_CHANGE);
 }
 
@@ -1973,7 +1827,7 @@ static void enable_features_for_test(const struct test_mode *t)
 static void check_test_requirements(const struct test_mode *t)
 {
 	if (t->pipes == PIPE_DUAL)
-		igt_require_f(scnd_mode_params.connector_id,
+		igt_require_f(scnd_mode_params.output,
 			    "Can't test dual pipes with the current outputs\n");
 
 	if (t->feature & FEATURE_FBC)
@@ -2011,32 +1865,32 @@ static void set_crtc_fbs(const struct test_mode *t)
 
 	switch (t->fbs) {
 	case FBS_INDIVIDUAL:
-		prim_mode_params.fb.fb = &s->prim_pri;
-		scnd_mode_params.fb.fb = &s->scnd_pri;
+		prim_mode_params.primary.fb = &s->prim_pri;
+		scnd_mode_params.primary.fb = &s->scnd_pri;
 		offscreen_fb.fb = &s->offscreen;
 
-		prim_mode_params.fb.x = 0;
-		scnd_mode_params.fb.x = 0;
+		prim_mode_params.primary.x = 0;
+		scnd_mode_params.primary.x = 0;
 		offscreen_fb.x = 0;
 
-		prim_mode_params.fb.y = 0;
-		scnd_mode_params.fb.y = 0;
+		prim_mode_params.primary.y = 0;
+		scnd_mode_params.primary.y = 0;
 		offscreen_fb.y = 0;
 		break;
 	case FBS_SHARED:
 		/* Please see the comment at the top of create_shared_fb(). */
-		prim_mode_params.fb.fb = &s->big;
-		scnd_mode_params.fb.fb = &s->big;
+		prim_mode_params.primary.fb = &s->big;
+		scnd_mode_params.primary.fb = &s->big;
 		offscreen_fb.fb = &s->big;
 
-		prim_mode_params.fb.x = opt.shared_fb_x_offset;
-		scnd_mode_params.fb.x = opt.shared_fb_x_offset;
+		prim_mode_params.primary.x = opt.shared_fb_x_offset;
+		scnd_mode_params.primary.x = opt.shared_fb_x_offset;
 		offscreen_fb.x = opt.shared_fb_x_offset;
 
-		prim_mode_params.fb.y = opt.shared_fb_y_offset;
-		scnd_mode_params.fb.y = prim_mode_params.fb.y +
-					prim_mode_params.fb.h;
-		offscreen_fb.y = scnd_mode_params.fb.y + scnd_mode_params.fb.h;
+		prim_mode_params.primary.y = opt.shared_fb_y_offset;
+		scnd_mode_params.primary.y = prim_mode_params.primary.y +
+					prim_mode_params.primary.h;
+		offscreen_fb.y = scnd_mode_params.primary.y + scnd_mode_params.primary.h;
 		break;
 	default:
 		igt_assert(false);
@@ -2075,9 +1929,9 @@ static void prepare_subtest_screens(const struct test_mode *t)
 	enable_prim_screen_and_wait(t);
 	if (t->screen == SCREEN_PRIM) {
 		if (t->plane == PLANE_CUR)
-			set_cursor_for_test(t, &prim_mode_params);
+			set_region_for_test(t, &prim_mode_params.cursor);
 		if (t->plane == PLANE_SPR)
-			set_sprite_for_test(t, &prim_mode_params);
+			set_region_for_test(t, &prim_mode_params.sprite);
 	}
 
 	if (t->pipes == PIPE_SINGLE)
@@ -2086,9 +1940,9 @@ static void prepare_subtest_screens(const struct test_mode *t)
 	enable_scnd_screen_and_wait(t);
 	if (t->screen == SCREEN_SCND) {
 		if (t->plane == PLANE_CUR)
-			set_cursor_for_test(t, &scnd_mode_params);
+			set_region_for_test(t, &scnd_mode_params.cursor);
 		if (t->plane == PLANE_SPR)
-			set_sprite_for_test(t, &scnd_mode_params);
+			set_region_for_test(t, &scnd_mode_params.sprite);
 	}
 }
 
@@ -2123,15 +1977,15 @@ static void rte_subtest(const struct test_mode *t)
 		      DONT_ASSERT_CRC | ASSERT_DRRS_INACTIVE);
 
 	enable_prim_screen_and_wait(t);
-	set_cursor_for_test(t, &prim_mode_params);
-	set_sprite_for_test(t, &prim_mode_params);
+	set_region_for_test(t, &prim_mode_params.cursor);
+	set_region_for_test(t, &prim_mode_params.sprite);
 
 	if (t->pipes == PIPE_SINGLE)
 		return;
 
 	enable_scnd_screen_and_wait(t);
-	set_cursor_for_test(t, &scnd_mode_params);
-	set_sprite_for_test(t, &scnd_mode_params);
+	set_region_for_test(t, &scnd_mode_params.cursor);
+	set_region_for_test(t, &scnd_mode_params.sprite);
 }
 
 static void update_wanted_crc(const struct test_mode *t, struct both_crcs *crc)
@@ -2360,7 +2214,7 @@ static void badformat_subtest(const struct test_mode *t)
 
 	prepare_subtest_data(t, NULL);
 
-	fill_fb_region(&prim_mode_params.fb, COLOR_PRIM_BG);
+	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
 	set_mode_for_params(&prim_mode_params);
 
 	wanted_crc = &blue_crcs[t->format].crc;
@@ -2472,23 +2326,14 @@ static void wait_flip_event(void)
 
 static void set_prim_plane_for_params(struct modeset_params *params)
 {
-	int rc, i;
-	int crtc_idx = kmstest_get_crtc_idx(drm.res, params->crtc_id);
-	uint32_t plane_id = 0;
-
-	for (i = 0; i < drm.plane_res->count_planes; i++)
-		if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) &&
-		    drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY)
-			plane_id = drm.planes[i]->plane_id;
-	igt_assert(plane_id);
-
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     params->fb.fb->fb_id, 0, 0, 0,
-			     params->mode->hdisplay,
-			     params->mode->vdisplay,
-			     params->fb.x << 16, params->fb.y << 16,
-			     params->fb.w << 16, params->fb.h << 16);
-	igt_assert(rc == 0);
+	igt_plane_set_fb(params->primary.plane, params->primary.fb);
+	igt_plane_set_position(params->primary.plane, 0, 0);
+	igt_plane_set_size(params->primary.plane, params->mode->hdisplay, params->mode->vdisplay);
+	igt_fb_set_position(params->primary.fb, params->primary.plane,
+			    params->primary.x, params->primary.y);
+	igt_fb_set_size(params->primary.fb, params->primary.plane,
+			params->primary.w, params->primary.h);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 }
 
 static void page_flip_for_params(struct modeset_params *params,
@@ -2498,8 +2343,8 @@ static void page_flip_for_params(struct modeset_params *params,
 
 	switch (type) {
 	case FLIP_PAGEFLIP:
-		rc = drmModePageFlip(drm.fd, params->crtc_id,
-				     params->fb.fb->fb_id,
+		rc = drmModePageFlip(drm.fd, drm.display.pipes[params->pipe].crtc_id,
+				     params->primary.fb->fb_id,
 				     DRM_MODE_PAGE_FLIP_EVENT, NULL);
 		igt_assert_eq(rc, 0);
 		wait_flip_event();
@@ -2554,17 +2399,17 @@ static void flip_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, pattern);
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  opt.tiling, t->plane, &fb2);
 	fill_fb(&fb2, bg_color);
-	orig_fb = params->fb.fb;
+	orig_fb = params->primary.fb;
 
 	for (r = 0; r < pattern->n_rects; r++) {
-		params->fb.fb = (r % 2 == 0) ? &fb2 : orig_fb;
+		params->primary.fb = (r % 2 == 0) ? &fb2 : orig_fb;
 
 		if (r != 0)
-			draw_rect(pattern, &params->fb, t->method, r - 1);
-		draw_rect(pattern, &params->fb, t->method, r);
+			draw_rect(pattern, &params->primary, t->method, r - 1);
+		draw_rect(pattern, &params->primary, t->method, r);
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
 
 		page_flip_for_params(params, t->flip);
@@ -2600,21 +2445,21 @@ static void fliptrack_subtest(const struct test_mode *t, enum flip_type type)
 
 	prepare_subtest(t, pattern);
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  opt.tiling, t->plane, &fb2);
 	fill_fb(&fb2, COLOR_PRIM_BG);
-	orig_fb = params->fb.fb;
+	orig_fb = params->primary.fb;
 
 	for (r = 0; r < pattern->n_rects; r++) {
-		params->fb.fb = (r % 2 == 0) ? &fb2 : orig_fb;
+		params->primary.fb = (r % 2 == 0) ? &fb2 : orig_fb;
 
 		if (r != 0)
-			draw_rect(pattern, &params->fb, t->method, r - 1);
+			draw_rect(pattern, &params->primary, t->method, r - 1);
 
 		page_flip_for_params(params, type);
 		do_assertions(0);
 
-		draw_rect(pattern, &params->fb, t->method, r);
+		draw_rect(pattern, &params->primary, t->method, r);
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
 
 		do_assertions(ASSERT_PSR_DISABLED);
@@ -2639,41 +2484,30 @@ static void fliptrack_subtest(const struct test_mode *t, enum flip_type type)
  */
 static void move_subtest(const struct test_mode *t)
 {
-	int r, rc;
+	int r;
 	int assertions = ASSERT_NO_ACTION_CHANGE;
 	struct modeset_params *params = pick_params(t);
 	struct draw_pattern_info *pattern = &pattern3;
+	struct fb_region *reg = pick_target(t, params);
 	bool repeat = false;
 
 	prepare_subtest(t, pattern);
 
 	/* Just paint the right color since we start at 0x0. */
-	draw_rect(pattern, pick_target(t, params), t->method, 0);
+	draw_rect(pattern, reg, t->method, 0);
 	update_wanted_crc(t, &pattern->crcs[t->format][0]);
 
 	do_assertions(assertions);
 
 	for (r = 1; r < pattern->n_rects; r++) {
-		struct rect rect = pattern->get_rect(&params->fb, r);
-
-		switch (t->plane) {
-		case PLANE_CUR:
-			rc = drmModeMoveCursor(drm.fd, params->crtc_id, rect.x,
-					       rect.y);
-			igt_assert_eq(rc, 0);
-			break;
-		case PLANE_SPR:
-			rc = drmModeSetPlane(drm.fd, params->sprite_id,
-					     params->crtc_id,
-					     params->sprite.fb->fb_id, 0,
-					     rect.x, rect.y, rect.w,
-					     rect.h, 0, 0, rect.w << 16,
-					     rect.h << 16);
-			igt_assert_eq(rc, 0);
-			break;
-		default:
-			igt_assert(false);
-		}
+		struct rect rect = pattern->get_rect(&params->primary, r);
+
+		igt_plane_set_fb(reg->plane, reg->fb);
+		igt_plane_set_position(reg->plane, rect.x, rect.y);
+		igt_plane_set_size(reg->plane, rect.w, rect.h);
+		igt_fb_set_size(reg->fb, reg->plane, rect.w, rect.h);
+		igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
+
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
 
 		do_assertions(assertions);
@@ -2703,7 +2537,7 @@ static void move_subtest(const struct test_mode *t)
  */
 static void onoff_subtest(const struct test_mode *t)
 {
-	int r, rc;
+	int r;
 	int assertions = ASSERT_NO_ACTION_CHANGE;
 	struct modeset_params *params = pick_params(t);
 	struct draw_pattern_info *pattern = &pattern3;
@@ -2716,49 +2550,21 @@ static void onoff_subtest(const struct test_mode *t)
 	do_assertions(assertions);
 
 	for (r = 0; r < 4; r++) {
+		struct fb_region *reg = pick_target(t, params);
+
 		if (r % 2 == 0) {
-			switch (t->plane) {
-			case PLANE_CUR:
-				rc = drmModeSetCursor(drm.fd, params->crtc_id,
-						      0, 0, 0);
-				igt_assert_eq(rc, 0);
-				break;
-			case PLANE_SPR:
-				rc = drmModeSetPlane(drm.fd, params->sprite_id,
-						     0, 0, 0, 0, 0, 0, 0, 0, 0,
-						     0, 0);
-				igt_assert_eq(rc, 0);
-				break;
-			default:
-				igt_assert(false);
-			}
+			igt_plane_set_fb(reg->plane, NULL);
+			igt_display_commit(&drm.display);
+
 			update_wanted_crc(t, &blue_crcs[t->format].crc);
 
 		} else {
-			switch (t->plane) {
-			case PLANE_CUR:
-				rc = drmModeSetCursor(drm.fd, params->crtc_id,
-						  params->cursor.fb->gem_handle,
-						  params->cursor.w,
-						  params->cursor.h);
-				igt_assert_eq(rc, 0);
-				break;
-			case PLANE_SPR:
-				rc = drmModeSetPlane(drm.fd, params->sprite_id,
-						     params->crtc_id,
-						     params->sprite.fb->fb_id,
-						     0, 0, 0, params->sprite.w,
-						     params->sprite.h, 0,
-						     0,
-						     params->sprite.w << 16,
-						     params->sprite.h << 16);
-				igt_assert_eq(rc, 0);
-				break;
-			default:
-				igt_assert(false);
-			}
-			update_wanted_crc(t, &pattern->crcs[t->format][0]);
+			igt_plane_set_fb(reg->plane, reg->fb);
+			igt_plane_set_size(reg->plane, reg->w, reg->h);
+			igt_fb_set_size(reg->fb, reg->plane, reg->w, reg->h);
+			igt_display_commit(&drm.display);
 
+			update_wanted_crc(t, &pattern->crcs[t->format][0]);
 		}
 
 		do_assertions(assertions);
@@ -2767,24 +2573,11 @@ static void onoff_subtest(const struct test_mode *t)
 
 static bool prim_plane_disabled(void)
 {
-	int i, rc;
-	bool disabled, found = false;
-	int crtc_idx = kmstest_get_crtc_idx(drm.res, prim_mode_params.crtc_id);
-
-	for (i = 0; i < drm.plane_res->count_planes; i++) {
-		if ((drm.planes[i]->possible_crtcs & (1 << crtc_idx)) &&
-		    drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY) {
-			found = true;
-			disabled = (drm.planes[i]->crtc_id == 0);
-		}
-	}
-
-	igt_assert(found);
-
-	rc = drmSetClientCap(drm.fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 0);
-	igt_assert_eq(rc, 0);
-
-	return disabled;
+	/*
+	 * Cannot use igt_plane_get_prop here to retrieve fb_id,
+	 * the testsuite doesn't require ATOMIC.
+	 */
+	return !prim_mode_params.primary.plane->values[IGT_PLANE_FB_ID];
 }
 
 /*
@@ -2807,11 +2600,10 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
 	struct rect rect;
 	struct modeset_params *params = pick_params(t);
 	int assertions;
-	int rc;
 
 	prepare_subtest(t, pattern);
 
-	rect = pattern->get_rect(&params->fb, 0);
+	rect = pattern->get_rect(&params->primary, 0);
 	create_fb(t->format, rect.w, rect.h, opt.tiling, t->plane,
 		  &fullscreen_fb);
 	/* Call pick_color() again since PRI and SPR may not support the same
@@ -2819,12 +2611,8 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
 	rect.color = pick_color(&fullscreen_fb, COLOR_GREEN);
 	igt_draw_fill_fb(drm.fd, &fullscreen_fb, rect.color);
 
-	rc = drmModeSetPlane(drm.fd, params->sprite_id, params->crtc_id,
-			     fullscreen_fb.fb_id, 0, 0, 0, fullscreen_fb.width,
-			     fullscreen_fb.height, 0, 0,
-			     fullscreen_fb.width << 16,
-			     fullscreen_fb.height << 16);
-	igt_assert_eq(rc, 0);
+	igt_plane_set_fb(params->sprite.plane, &fullscreen_fb);
+	igt_display_commit(&drm.display);
 	update_wanted_crc(t, &pattern->crcs[t->format][0]);
 
 	switch (t->screen) {
@@ -2842,9 +2630,8 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
 	}
 	do_assertions(assertions);
 
-	rc = drmModeSetPlane(drm.fd, params->sprite_id, 0, 0, 0, 0, 0, 0, 0, 0,
-			     0, 0, 0);
-	igt_assert_eq(rc, 0);
+	igt_plane_set_fb(params->sprite.plane, NULL);
+	igt_display_commit(&drm.display);
 
 	if (t->screen == SCREEN_PRIM)
 		assertions = ASSERT_LAST_ACTION_CHANGED;
@@ -2878,98 +2665,69 @@ static void scaledprimary_subtest(const struct test_mode *t)
 {
 	struct igt_fb new_fb, *old_fb;
 	struct modeset_params *params = pick_params(t);
-	int i, rc;
-	uint32_t plane_id;
-	int prim_crtc_idx = kmstest_get_crtc_idx(drm.res,
-						 prim_mode_params.crtc_id);
+	struct fb_region *reg = &params->primary;
 
 	igt_require_f(intel_gen(intel_get_drm_devid(drm.fd)) >= 9,
 		      "Can't test primary plane scaling before gen 9\n");
 
 	prepare_subtest(t, NULL);
 
-	old_fb = params->fb.fb;
+	old_fb = reg->fb;
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, reg->fb->width, reg->fb->height,
 		  opt.tiling, t->plane, &new_fb);
 	fill_fb(&new_fb, COLOR_BLUE);
 
 	igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, &new_fb, t->method,
-			 params->fb.x, params->fb.y,
-			 params->fb.w / 2, params->fb.h / 2,
+			 reg->x, reg->y, reg->w / 2, reg->h / 2,
 			 pick_color(&new_fb, COLOR_GREEN));
 	igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, &new_fb, t->method,
-			 params->fb.x + params->fb.w / 2,
-			 params->fb.y + params->fb.h / 2,
-			 params->fb.w / 2, params->fb.h / 2,
+			 reg->x + reg->w / 2, reg->y + reg->h / 2,
+			 reg->w / 2, reg->h / 2,
 			 pick_color(&new_fb, COLOR_RED));
 	igt_draw_rect_fb(drm.fd, drm.bufmgr, NULL, &new_fb, t->method,
-			 params->fb.x + params->fb.w / 2,
-			 params->fb.y + params->fb.h / 2,
-			 params->fb.w / 4, params->fb.h / 4,
+			 reg->x + reg->w / 2, reg->y + reg->h / 2,
+			 reg->w / 4, reg->h / 4,
 			 pick_color(&new_fb, COLOR_MAGENTA));
 
-	for (i = 0; i < drm.plane_res->count_planes; i++)
-		if ((drm.planes[i]->possible_crtcs & (1 << prim_crtc_idx)) &&
-		    drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY)
-			plane_id = drm.planes[i]->plane_id;
-
 	/* No scaling. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     new_fb.fb_id, 0,
-			     0, 0,
-			     params->mode->hdisplay, params->mode->vdisplay,
-			     params->fb.x << 16, params->fb.y << 16,
-			     params->fb.w << 16, params->fb.h << 16);
-	igt_assert(rc == 0);
+	igt_plane_set_fb(reg->plane, &new_fb);
+	igt_fb_set_position(&new_fb, reg->plane, reg->x, reg->y);
+	igt_fb_set_size(&new_fb, reg->plane, reg->w, reg->h);
+	igt_plane_set_size(reg->plane, params->mode->hdisplay, params->mode->vdisplay);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(DONT_ASSERT_CRC);
 
 	/* Source upscaling. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     new_fb.fb_id, 0,
-			     0, 0,
-			     params->mode->hdisplay, params->mode->vdisplay,
-			     params->fb.x << 16, params->fb.y << 16,
-			     (params->fb.w / 2) << 16,
-			     (params->fb.h / 2) << 16);
-	igt_assert(rc == 0);
+	igt_fb_set_size(&new_fb, reg->plane, reg->w / 2, reg->h / 2);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(DONT_ASSERT_CRC);
 
 	/* Destination doesn't fill the entire CRTC, no scaling. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     new_fb.fb_id, 0,
-			     params->mode->hdisplay / 4,
-			     params->mode->vdisplay / 4,
-			     params->mode->hdisplay / 2,
-			     params->mode->vdisplay / 2,
-			     params->fb.x << 16, params->fb.y << 16,
-			     (params->fb.w / 2) << 16,
-			     (params->fb.h / 2) << 16);
-	igt_assert(rc == 0);
+	igt_fb_set_size(&new_fb, reg->plane, reg->w / 2, reg->h / 2);
+	igt_plane_set_position(reg->plane,
+			       params->mode->hdisplay / 4,
+			       params->mode->vdisplay / 4);
+	igt_plane_set_size(reg->plane,
+			   params->mode->hdisplay / 2,
+			   params->mode->vdisplay / 2);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(DONT_ASSERT_CRC);
 
 	/* Destination doesn't fill the entire CRTC, upscaling. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     new_fb.fb_id, 0,
-			     params->mode->hdisplay / 4,
-			     params->mode->vdisplay / 4,
-			     params->mode->hdisplay / 2,
-			     params->mode->vdisplay / 2,
-			     (params->fb.x + params->fb.w / 2) << 16,
-			     (params->fb.y + params->fb.h / 2) << 16,
-			     (params->fb.w / 4) << 16,
-			     (params->fb.h / 4) << 16);
-	igt_assert(rc == 0);
+	igt_fb_set_position(&new_fb, reg->plane,
+			    reg->x + reg->w / 4, reg->y + reg->h / 4);
+	igt_fb_set_size(&new_fb, reg->plane, reg->w / 2, reg->h / 2);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(DONT_ASSERT_CRC);
 
 	/* Back to the good and old blue fb. */
-	rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id,
-			     old_fb->fb_id, 0,
-			     0, 0,
-			     params->mode->hdisplay, params->mode->vdisplay,
-			     params->fb.x << 16, params->fb.y << 16,
-			     params->fb.w << 16, params->fb.h << 16);
-	igt_assert(rc == 0);
+	igt_plane_set_fb(reg->plane, old_fb);
+	igt_plane_set_position(params->primary.plane, 0, 0);
+	igt_plane_set_size(reg->plane, params->mode->hdisplay, params->mode->vdisplay);
+	igt_fb_set_position(reg->fb, reg->plane, reg->x, reg->y);
+	igt_fb_set_size(reg->fb, reg->plane, reg->w, reg->h);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 	do_assertions(0);
 
 	igt_remove_fb(drm.fd, &new_fb);
@@ -2999,15 +2757,15 @@ static void modesetfrombusy_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, NULL);
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  opt.tiling, t->plane, &fb2);
 	fill_fb(&fb2, COLOR_PRIM_BG);
 
-	start_busy_thread(params->fb.fb);
+	start_busy_thread(params->primary.fb);
 	usleep(10000);
 
 	unset_all_crtcs();
-	params->fb.fb = &fb2;
+	params->primary.fb = &fb2;
 	set_mode_for_params(params);
 
 	do_assertions(0);
@@ -3109,9 +2867,9 @@ static void farfromfence_subtest(const struct test_mode *t)
 
 	fill_fb(&tall_fb, COLOR_PRIM_BG);
 
-	params->fb.fb = &tall_fb;
-	params->fb.x = 0;
-	params->fb.y = max_height - params->mode->vdisplay;
+	params->primary.fb = &tall_fb;
+	params->primary.x = 0;
+	params->primary.y = max_height - params->mode->vdisplay;
 	set_mode_for_params(params);
 	do_assertions(assertions);
 
@@ -3177,30 +2935,30 @@ static void badstride_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, NULL);
 
-	old_fb = params->fb.fb;
+	old_fb = params->primary.fb;
 
-	create_fb(t->format, params->fb.fb->width + 4096, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width + 4096, params->primary.fb->height,
 		  opt.tiling, t->plane, &wide_fb);
 	igt_assert(wide_fb.stride > 16384);
 
 	fill_fb(&wide_fb, COLOR_PRIM_BG);
 
 	/* Try a simple modeset with the new fb. */
-	params->fb.fb = &wide_fb;
+	params->primary.fb = &wide_fb;
 	set_mode_for_params(params);
 	do_assertions(ASSERT_FBC_DISABLED);
 
 	/* Go back to the old fb so FBC works again. */
-	params->fb.fb = old_fb;
+	params->primary.fb = old_fb;
 	set_mode_for_params(params);
 	do_assertions(0);
 
 	/* We're doing the equivalent of a modeset, but with the planes API. */
-	params->fb.fb = &wide_fb;
+	params->primary.fb = &wide_fb;
 	set_prim_plane_for_params(params);
 	do_assertions(ASSERT_FBC_DISABLED);
 
-	params->fb.fb = old_fb;
+	params->primary.fb = old_fb;
 	set_mode_for_params(params);
 	do_assertions(0);
 
@@ -3209,7 +2967,7 @@ static void badstride_subtest(const struct test_mode *t)
 	 * with a different stride. With the atomic page flip helper we can,
 	 * so allow page flip to fail and succeed.
 	 */
-	rc = drmModePageFlip(drm.fd, params->crtc_id, wide_fb.fb_id, 0, NULL);
+	rc = drmModePageFlip(drm.fd, drm.display.pipes[params->pipe].crtc_id, wide_fb.fb_id, 0, NULL);
 	igt_assert(rc == -EINVAL || rc == 0);
 	do_assertions(rc == 0 ? ASSERT_FBC_DISABLED : 0);
 
@@ -3244,9 +3002,9 @@ static void stridechange_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, NULL);
 
-	old_fb = params->fb.fb;
+	old_fb = params->primary.fb;
 
-	create_fb(t->format, params->fb.fb->width + 512, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width + 512, params->primary.fb->height,
 		  opt.tiling, t->plane, &new_fb);
 	fill_fb(&new_fb, COLOR_PRIM_BG);
 
@@ -3254,21 +3012,21 @@ static void stridechange_subtest(const struct test_mode *t)
 
 	/* We can't assert that FBC will be enabled since there may not be
 	 * enough space for the CFB, but we can check the CRC. */
-	params->fb.fb = &new_fb;
+	params->primary.fb = &new_fb;
 	set_mode_for_params(params);
 	do_assertions(DONT_ASSERT_FEATURE_STATUS);
 
 	/* Go back to the fb that can have FBC. */
-	params->fb.fb = old_fb;
+	params->primary.fb = old_fb;
 	set_mode_for_params(params);
 	do_assertions(0);
 
 	/* This operation is the same as above, but with the planes API. */
-	params->fb.fb = &new_fb;
+	params->primary.fb = &new_fb;
 	set_prim_plane_for_params(params);
 	do_assertions(DONT_ASSERT_FEATURE_STATUS);
 
-	params->fb.fb = old_fb;
+	params->primary.fb = old_fb;
 	set_prim_plane_for_params(params);
 	do_assertions(0);
 
@@ -3276,7 +3034,7 @@ static void stridechange_subtest(const struct test_mode *t)
 	 * Try to set a new stride. with the page flip api. This is allowed
 	 * with the atomic page flip helper, but not with the legacy page flip.
 	 */
-	rc = drmModePageFlip(drm.fd, params->crtc_id, new_fb.fb_id, 0, NULL);
+	rc = drmModePageFlip(drm.fd, drm.display.pipes[params->pipe].crtc_id, new_fb.fb_id, 0, NULL);
 	igt_assert(rc == -EINVAL || rc == 0);
 	do_assertions(0);
 
@@ -3307,9 +3065,9 @@ static void tilingchange_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, NULL);
 
-	old_fb = params->fb.fb;
+	old_fb = params->primary.fb;
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  LOCAL_DRM_FORMAT_MOD_NONE, t->plane, &new_fb);
 	fill_fb(&new_fb, COLOR_PRIM_BG);
 
@@ -3317,12 +3075,12 @@ static void tilingchange_subtest(const struct test_mode *t)
 		igt_debug("Flip type: %d\n", flip_type);
 
 		/* Set a buffer with no tiling. */
-		params->fb.fb = &new_fb;
+		params->primary.fb = &new_fb;
 		page_flip_for_params(params, flip_type);
 		do_assertions(ASSERT_FBC_DISABLED);
 
 		/* Put FBC back in a working state. */
-		params->fb.fb = old_fb;
+		params->primary.fb = old_fb;
 		page_flip_for_params(params, flip_type);
 		do_assertions(0);
 	}
@@ -3365,15 +3123,15 @@ static void basic_subtest(const struct test_mode *t)
 
 	prepare_subtest(t, pattern);
 
-	create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
 		  opt.tiling, t->plane, &fb2);
-	fb1 = params->fb.fb;
+	fb1 = params->primary.fb;
 
 	for (r = 0, method = 0; method < IGT_DRAW_METHOD_COUNT; method++, r++) {
 		if (r == pattern->n_rects) {
-			params->fb.fb = (params->fb.fb == fb1) ? &fb2 : fb1;
+			params->primary.fb = (params->primary.fb == fb1) ? &fb2 : fb1;
 
-			fill_fb_region(&params->fb, COLOR_PRIM_BG);
+			fill_fb_region(&params->primary, COLOR_PRIM_BG);
 			update_wanted_crc(t, &blue_crcs[t->format].crc);
 
 			page_flip_for_params(params, t->flip);
@@ -3382,7 +3140,7 @@ static void basic_subtest(const struct test_mode *t)
 			r = 0;
 		}
 
-		draw_rect(pattern, &params->fb, method, r);
+		draw_rect(pattern, &params->primary, method, r);
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
 		do_assertions(assertions);
 	}
Signature · 6 lines
2.16.2

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#5 lore raw

PATCH 4/4 tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.

In reply to Maarten Lankhorst

CRC capturing enables the display, then disables it again. With igt_display we can use igt_display_reset to restore the original state, without committing it to the hw.

All subtests first set their own state anyway, so we can save up on the number of commits.

---
 tests/kms_frontbuffer_tracking.c | 38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)
tests/kms_frontbuffer_tracking.c +32 -6
index 6672154e67b9..51ae9db9f735 100644
@@ -712,7 +712,7 @@ static void create_fbs(enum pixel_format format)
 		  opt.tiling, PLANE_SPR, &s->scnd_spr);
 }
 
-static void set_mode_for_params(struct modeset_params *params)
+static void __set_mode_for_params(struct modeset_params *params)
 {
 	igt_output_override_mode(params->output, params->mode);
 	igt_output_set_pipe(params->output, params->pipe);
@@ -721,6 +721,11 @@ static void set_mode_for_params(struct modeset_params *params)
 	igt_plane_set_position(params->primary.plane, 0, 0);
 	igt_fb_set_position(params->primary.fb, params->primary.plane, params->primary.x, params->primary.y);
 	igt_fb_set_size(params->primary.fb, params->primary.plane, params->primary.w, params->primary.h);
+}
+
+static void set_mode_for_params(struct modeset_params *params)
+{
+	__set_mode_for_params(params);
 	igt_display_commit(&drm.display);
 }
 
@@ -1280,7 +1285,7 @@ static void init_blue_crc(enum pixel_format format, bool mandatory_sink_crc)
 
 	print_crc("Blue CRC:  ", &blue_crcs[format].crc);
 
-	unset_all_crtcs();
+	igt_display_reset(&drm.display);
 
 	igt_remove_fb(drm.fd, &blue);
 
@@ -1332,7 +1337,7 @@ static void init_crcs(enum pixel_format format,
 		print_crc("", &pattern->crcs[format][r]);
 	}
 
-	unset_all_crtcs();
+	igt_display_reset(&drm.display);
 
 	for (r = 0; r < pattern->n_rects; r++)
 		igt_remove_fb(drm.fd, &tmp_fbs[r]);
@@ -1797,6 +1802,22 @@ static void enable_scnd_screen_and_wait(const struct test_mode *t)
 	do_assertions(ASSERT_NO_ACTION_CHANGE);
 }
 
+static void enable_both_screens_and_wait(const struct test_mode *t)
+{
+	fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
+	fill_fb_region(&scnd_mode_params.primary, COLOR_SCND_BG);
+
+	__set_mode_for_params(&prim_mode_params);
+	__set_mode_for_params(&scnd_mode_params);
+
+	igt_display_commit2(&drm.display, drm.display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+	wanted_crc = &blue_crcs[t->format].crc;
+	fbc_update_last_action();
+
+	do_assertions(ASSERT_NO_ACTION_CHANGE);
+}
+
 static void set_region_for_test(const struct test_mode *t,
 				struct fb_region *reg)
 {
@@ -1915,18 +1936,24 @@ static void prepare_subtest_data(const struct test_mode *t,
 	if (t->screen == SCREEN_OFFSCREEN)
 		fill_fb_region(&offscreen_fb, COLOR_OFFSCREEN_BG);
 
-	unset_all_crtcs();
+	igt_display_reset(&drm.display);
 
 	init_blue_crc(t->format, t->feature & FEATURE_PSR);
 	if (pattern)
 		init_crcs(t->format, pattern, t->feature & FEATURE_PSR);
 
+	igt_display_reset(&drm.display);
+
 	enable_features_for_test(t);
 }
 
 static void prepare_subtest_screens(const struct test_mode *t)
 {
-	enable_prim_screen_and_wait(t);
+	if (t->pipes == PIPE_DUAL)
+		enable_both_screens_and_wait(t);
+	else
+		enable_prim_screen_and_wait(t);
+
 	if (t->screen == SCREEN_PRIM) {
 		if (t->plane == PLANE_CUR)
 			set_region_for_test(t, &prim_mode_params.cursor);
@@ -1937,7 +1964,6 @@ static void prepare_subtest_screens(const struct test_mode *t)
 	if (t->pipes == PIPE_SINGLE)
 		return;
 
-	enable_scnd_screen_and_wait(t);
 	if (t->screen == SCREEN_SCND) {
 		if (t->plane == PLANE_CUR)
 			set_region_for_test(t, &scnd_mode_params.cursor);
Signature · 6 lines
2.16.2

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#6 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups.

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: kms_panel_fitting and kms_frontbuffer_tracking cleanups.
URL : https://patchwork.freedesktop.org/series/38948/
State : success

== Summary ==

IGT patchset tested on top of latest successful build a2664f86bb75e642c432531e2bf30e030fb3e828 meson: Don't build docs when cross-compiling

with latest DRM-Tip kernel build CI_DRM_3832
23012f548f1f drm-tip: 2018y-02m-26d-10h-58m-50s UTC integration manifest

No testlist changes.

---- Known issues:

Test gem_ringfill:

        Subgroup basic-default-hang:
                dmesg-warn -> INCOMPLETE (fi-pnv-d510) fdo#101600
Test kms_chamelium:
        Subgroup dp-crc-fast:
                pass       -> DMESG-FAIL (fi-kbl-7500u) fdo#103841

fdo#101600 https://bugs.freedesktop.org/show_bug.cgi?id=101600
fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:415s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:429s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:379s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:488s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:285s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:482s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:470s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:459s
fi-cfl-8700k     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:391s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:570s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:410s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:285s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:504s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:384s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:409s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:454s
fi-kbl-7500u     total:288  pass:262  dwarn:1   dfail:1   fail:0   skip:24  time:454s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:483s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:448s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:488s
fi-pnv-d510      total:146  pass:113  dwarn:0   dfail:0   fail:0   skip:32 
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:499s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:517s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:486s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:470s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:403s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:392s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1005/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#7 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups.

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: kms_panel_fitting and kms_frontbuffer_tracking cleanups.
URL : https://patchwork.freedesktop.org/series/38948/
State : success

== Summary ==

---- Possible new issues:

Test kms_draw_crc:

        Subgroup fill-fb:
                pass       -> SKIP       (shard-snb)
Test kms_frontbuffer_tracking:
        Subgroup fbc-2p-indfb-fliptrack:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-pri-indfb-multidraw:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-cur-indfb-draw-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-cur-indfb-draw-mmap-cpu:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-cur-indfb-draw-mmap-gtt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-cur-indfb-draw-mmap-wc:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-cur-indfb-draw-pwrite:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-cur-indfb-draw-render:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-cur-indfb-move:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-cur-indfb-onoff:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-indfb-msflip-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-indfb-pgflip-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-indfb-plflip-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-pri-indfb-draw-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-pri-indfb-draw-mmap-cpu:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-pri-indfb-draw-mmap-gtt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-pri-indfb-draw-mmap-wc:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-pri-indfb-draw-pwrite:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-blt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-mmap-gtt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-mmap-wc:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-pwrite:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-render:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-primscrn-shrfb-msflip-blt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-primscrn-shrfb-pgflip-blt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-primscrn-shrfb-plflip-blt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-draw-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-draw-mmap-cpu:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-draw-mmap-gtt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-draw-mmap-wc:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-draw-pwrite:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-draw-render:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-fullscreen:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-move:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-primscrn-spr-indfb-onoff:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-rte:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-cur-indfb-draw-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-cur-indfb-draw-mmap-cpu:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-cur-indfb-draw-mmap-gtt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-cur-indfb-draw-mmap-wc:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-cur-indfb-draw-pwrite:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-cur-indfb-draw-render:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-cur-indfb-move:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-cur-indfb-onoff:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-indfb-msflip-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-indfb-pgflip-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-indfb-plflip-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-indfb-draw-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-indfb-draw-mmap-cpu:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-indfb-draw-mmap-gtt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-indfb-draw-mmap-wc:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-indfb-draw-pwrite:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-indfb-draw-render:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-cpu:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-gtt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-wc:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-pwrite:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-render:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-scndscrn-shrfb-msflip-blt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-scndscrn-shrfb-pgflip-blt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-scndscrn-shrfb-plflip-blt:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-draw-blt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-draw-mmap-cpu:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-draw-mmap-gtt:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-draw-mmap-wc:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-draw-pwrite:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-draw-render:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-fullscreen:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-move:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-scndscrn-spr-indfb-onoff:
                skip       -> FAIL       (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> FAIL       (shard-snb)
        Subgroup fbc-2p-shrfb-fliptrack:
                skip       -> CRASH      (shard-apl)
                pass       -> SKIP       (shard-hsw)
                skip       -> CRASH      (shard-snb)

---- Known issues:

Test kms_flip:

        Subgroup 2x-plain-flip-fb-recreate:
                fail       -> PASS       (shard-hsw) fdo#100368 +2
Test kms_frontbuffer_tracking:
        Subgroup fbc-2p-primscrn-pri-indfb-draw-render:
                skip       -> FAIL       (shard-snb) fdo#101623 +5
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-mmap-cpu:
                skip       -> CRASH      (shard-snb) fdo#103167 +2
Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-apl) fdo#99912
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047
Test perf:
        Subgroup enable-disable:
                pass       -> FAIL       (shard-apl) fdo#103715

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715

shard-apl        total:3460 pass:1819 dwarn:1   dfail:0   fail:62  skip:1558 time:12252s
shard-hsw        total:3460 pass:1692 dwarn:1   dfail:0   fail:2   skip:1764 time:11308s
shard-snb        total:3558 pass:1400 dwarn:1   dfail:0   fail:60  skip:2078 time:6758s
Blacklisted hosts:
shard-glkb       total:3460 pass:1755 dwarn:1   dfail:0   fail:348 skip:1300 time:14635s
shard-kbl        total:3412 pass:1917 dwarn:1   dfail:0   fail:61  skip:1413 time:9541s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1005/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#8 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev2)

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev2)
URL : https://patchwork.freedesktop.org/series/38948/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
c68b8ee935c75fa4c946f2d97f64ffe9decef010 igt/gem_softpin: Only expect EINVAL for color-overlaps for user objects

with latest DRM-Tip kernel build CI_DRM_3835
7c50cf4f0dc7 drm-tip: 2018y-02m-26d-22h-51m-08s UTC integration manifest

No testlist changes.

---- Known issues:

Test gem_mmap_gtt:

        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575
Test prime_vgem:
        Subgroup basic-fence-flip:
                pass       -> FAIL       (fi-ilk-650) fdo#104008

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:417s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:426s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:377s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:485s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:285s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:478s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:483s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:467s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:456s
fi-cfl-8700k     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:392s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:566s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:565s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:420s
fi-gdg-551       total:288  pass:180  dwarn:0   dfail:0   fail:0   skip:108 time:286s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:506s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:386s
fi-ilk-650       total:288  pass:227  dwarn:0   dfail:0   fail:1   skip:60  time:411s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:451s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:410s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:452s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:483s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:449s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:495s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:588s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:421s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:498s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:522s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:488s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:480s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:404s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:515s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:394s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1010/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#9 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev2)

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev2)
URL : https://patchwork.freedesktop.org/series/38948/
State : success

== Summary ==

---- Possible new issues:

Test gem_tiled_blits:

        Subgroup interruptible:
                skip       -> PASS       (shard-apl)
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-mmap-gtt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-blt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-mmap-gtt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-mmap-wc:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-pwrite:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-primscrn-shrfb-msflip-blt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-primscrn-shrfb-pgflip-blt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-primscrn-shrfb-plflip-blt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-cpu:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-gtt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-wc:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-pwrite:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-shrfb-msflip-blt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-shrfb-pgflip-blt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-shrfb-plflip-blt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-shrfb-fliptrack:
                pass       -> FAIL       (shard-hsw)

---- Known issues:

Test gem_eio:

        Subgroup in-flight:
                pass       -> INCOMPLETE (shard-apl) fdo#104945
Test kms_chv_cursor_fail:
        Subgroup pipe-b-64x64-bottom-edge:
                dmesg-warn -> PASS       (shard-snb) fdo#105185
Test kms_flip:
        Subgroup flip-vs-absolute-wf_vblank:
                fail       -> PASS       (shard-hsw) fdo#100368
        Subgroup modeset-vs-vblank-race:
                fail       -> PASS       (shard-hsw) fdo#103060
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-pri-shrfb-draw-mmap-cpu:
                pass       -> FAIL       (shard-hsw) fdo#103167 +2
        Subgroup fbc-1p-primscrn-pri-shrfb-draw-mmap-gtt:
                pass       -> FAIL       (shard-hsw) fdo#101623 +5
Test kms_rotation_crc:
        Subgroup sprite-rotation-180:
                pass       -> FAIL       (shard-snb) fdo#103925
Test kms_vblank:
        Subgroup pipe-a-query-forked-busy-hang:
                dmesg-warn -> PASS       (shard-hsw) fdo#102614
Test perf:
        Subgroup oa-exponents:
                pass       -> INCOMPLETE (shard-apl) fdo#102254

fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254

shard-apl        total:3451 pass:1816 dwarn:1   dfail:0   fail:7   skip:1624 time:11978s
shard-hsw        total:3460 pass:1742 dwarn:1   dfail:0   fail:26  skip:1690 time:11783s
shard-snb        total:3460 pass:1357 dwarn:1   dfail:0   fail:3   skip:2099 time:6688s

Blacklisted hosts:
shard-kbl total:3416 pass:1832 dwarn:81 dfail:3 fail:8 skip:1491 time:9554s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1010/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev