All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups.
@ 2018-02-27  8:52 Maarten Lankhorst
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 1/4] tests/kms_panel_fitting: Test cleanups Maarten Lankhorst
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Maarten Lankhorst @ 2018-02-27  8:52 UTC (permalink / raw)
  To: igt-dev

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, v3.
  tests/kms_frontbuffer_tracking: Remove redundant modesets during
    subtest start.

 lib/igt_kms.c                    |   1 +
 tests/kms_frontbuffer_tracking.c | 804 ++++++++++++++-------------------------
 tests/kms_panel_fitting.c        |  74 +---
 3 files changed, 315 insertions(+), 564 deletions(-)

-- 
2.16.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v3 1/4] tests/kms_panel_fitting: Test cleanups.
  2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
@ 2018-02-27  8:52 ` Maarten Lankhorst
  2018-03-05 13:45   ` Arkadiusz Hiler
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too Maarten Lankhorst
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Maarten Lankhorst @ 2018-02-27  8:52 UTC (permalink / raw)
  To: igt-dev

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.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_panel_fitting.c | 74 ++++++++++++-----------------------------------
 1 file changed, 19 insertions(+), 55 deletions(-)

diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index b3cee223a8e7..1f087ecc82a0 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -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);
-- 
2.16.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v3 2/4] lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too
  2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 1/4] tests/kms_panel_fitting: Test cleanups Maarten Lankhorst
@ 2018-02-27  8:52 ` Maarten Lankhorst
  2018-03-05 13:48   ` Arkadiusz Hiler
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3 Maarten Lankhorst
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Maarten Lankhorst @ 2018-02-27  8:52 UTC (permalink / raw)
  To: igt-dev

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 lib/igt_kms.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d8c8e7a3cdfb..5900c46296a0 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -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)
-- 
2.16.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3.
  2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 1/4] tests/kms_panel_fitting: Test cleanups Maarten Lankhorst
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too Maarten Lankhorst
@ 2018-02-27  8:52 ` Maarten Lankhorst
  2018-03-07 15:17   ` Arkadiusz Hiler
  2018-03-08  8:57   ` Arkadiusz Hiler
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start Maarten Lankhorst
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 22+ messages in thread
From: Maarten Lankhorst @ 2018-02-27  8:52 UTC (permalink / raw)
  To: igt-dev

Straight conversion, no behavioral changes yet.

Changes since v1:
- Handle 2x outputs correctly.
Changes since v2:
- Set correct parameters in set_mode_for_params, so atomic commit for
  2x outputs doesn't scale.
- Fix accidental scaling in set_prim_plane_for_params.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_frontbuffer_tracking.c | 789 ++++++++++++++-------------------------
 1 file changed, 277 insertions(+), 512 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 1483c228044e..19a69cca5b37 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -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)
+static drmModeModeInfo *connector_get_mode(igt_output_t *output)
 {
-	int i;
-
-	for (i = 0; i < drm.res->count_connectors; i++)
-		if (drm.res->connectors[i] == id)
-			return drm.connectors[i];
+	drmModeModeInfo *mode = NULL;
 
-	igt_assert(false);
-}
-
-static drmModeEncoderPtr get_encoder(uint32_t id)
-{
-	int i;
-
-	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;
+	drmModeModeInfo *mode;
 
-	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;
-		}
+	igt_output_override_mode(output, NULL);
+	mode = connector_get_mode(output);
 
-	igt_require(overlay_plane_id);
+	params->pipe = pipe;
+	params->output = output;
+	params->mode_copy = *mode;
+	params->mode = &params->mode_copy;
 
-	params->crtc_id = crtc_id;
-	params->connector_id = connector->connector_id;
-	params->mode = mode;
-	params->sprite_id = overlay_plane_id;
-
-	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)
+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)
 {
-	*mode = NULL;
+	igt_output_t *output;
+	enum pipe pipe;
 
-	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)
-{
-	drmModeConnectorPtr c = NULL;
-	drmModeModeInfoPtr mode = NULL;
-	int i;
-
-	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,29 @@ 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_prim_plane_for_params(struct modeset_params *params)
 {
-	int rc;
+	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->mode->hdisplay, params->mode->vdisplay);
+}
 
-	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);
+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);
+
+	__set_prim_plane_for_params(params);
+}
+
+static void set_mode_for_params(struct modeset_params *params)
+{
+	__set_mode_for_params(params);
+	igt_display_commit(&drm.display);
 }
 
 static void __debugfs_read(const char *param, char *buf, int len)
@@ -830,7 +781,7 @@ static void psr_print_status(void)
 	igt_info("PSR status:\n%s\n", buf);
 }
 
-void drrs_set(unsigned int val)
+static void drrs_set(unsigned int val)
 {
 	char buf[2];
 	int ret;
@@ -1238,22 +1189,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 +1262,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 +1277,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 +1304,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 +1332,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 +1353,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 +1368,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 +1380,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 +1395,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 +1405,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 +1420,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 +1491,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 +1503,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 +1535,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 +1554,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 +1623,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 +1793,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 +1804,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)
+static void set_region_for_test(const struct test_mode *t,
+				struct fb_region *reg)
 {
-	int rc;
-
-	fill_fb_region(&params->cursor, COLOR_PRIM_BG);
-
-	rc = drmModeMoveCursor(drm.fd, params->crtc_id, 0, 0);
-	igt_assert_eq(rc, 0);
+	fill_fb_region(reg, COLOR_PRIM_BG);
 
-	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)
-{
-	int rc;
-
-	fill_fb_region(&params->sprite, 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 +1840,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 +1878,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 +1942,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 +1953,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 +1990,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 +2227,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 +2339,8 @@ 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);
+	__set_prim_plane_for_params(params);
+	igt_display_commit2(&drm.display, COMMIT_UNIVERSAL);
 }
 
 static void page_flip_for_params(struct modeset_params *params,
@@ -2498,8 +2350,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 +2406,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 +2452,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 +2491,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 +2544,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 +2557,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 +2580,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 +2607,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 +2618,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 +2637,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 +2672,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 +2764,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 +2874,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 +2942,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 +2974,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 +3009,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 +3019,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 +3041,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 +3072,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 +3082,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 +3130,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 +3147,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);
 	}
-- 
2.16.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.
  2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
                   ` (2 preceding siblings ...)
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3 Maarten Lankhorst
@ 2018-02-27  8:52 ` Maarten Lankhorst
  2018-03-01 15:33   ` Maarten Lankhorst
  2018-02-27  9:15 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3) Patchwork
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Maarten Lankhorst @ 2018-02-27  8:52 UTC (permalink / raw)
  To: igt-dev

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.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_frontbuffer_tracking.c | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 19a69cca5b37..015d7a7a3948 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1293,7 +1293,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);
 
@@ -1345,7 +1345,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]);
@@ -1810,6 +1810,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)
 {
@@ -1928,18 +1944,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);
@@ -1950,7 +1972,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);
-- 
2.16.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3)
  2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
                   ` (3 preceding siblings ...)
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start Maarten Lankhorst
@ 2018-02-27  9:15 ` Patchwork
  2018-02-27 10:00 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2018-02-27  9:15 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

Series: kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3)
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_3836
644755b0a6e4 drm-tip: 2018y-02m-27d-07h-41m-50s UTC integration manifest

No testlist changes.

---- Known issues:

Test drv_module_reload:
        Subgroup basic-no-display:
                incomplete -> PASS       (fi-bwr-2160) fdo#105268
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                incomplete -> PASS       (fi-bxt-dsi) fdo#103927

fdo#105268 https://bugs.freedesktop.org/show_bug.cgi?id=105268
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:416s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:428s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:375s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:484s
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:477s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:485s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:471s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:457s
fi-cfl-8700k     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:393s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:564s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:583s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:415s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:288s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:510s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:389s
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:450s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:412s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:453s
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:451s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:490s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:591s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:425s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:497s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:510s
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:471s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:405s
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:528s
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_1012/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3)
  2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
                   ` (4 preceding siblings ...)
  2018-02-27  9:15 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3) Patchwork
@ 2018-02-27 10:00 ` Patchwork
  2018-03-06 11:21 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
  2018-03-06 15:21 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  7 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2018-02-27 10:00 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

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

== Summary ==

---- Possible new issues:

Test gem_tiled_blits:
        Subgroup interruptible:
                skip       -> PASS       (shard-apl)
Test gem_tiled_fence_blits:
        Subgroup normal:
                pass       -> SKIP       (shard-apl)
Test kms_cursor_legacy:
        Subgroup cursor-vs-flip-legacy:
                pass       -> INCOMPLETE (shard-hsw)
        Subgroup flip-vs-cursor-busy-crc-legacy:
                pass       -> FAIL       (shard-apl)
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-mmap-gtt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-shrfb-pgflip-blt:
                pass       -> FAIL       (shard-hsw)
Test kms_universal_plane:
        Subgroup cursor-fb-leak-pipe-a:
                pass       -> FAIL       (shard-snb)

---- Known issues:

Test gem_eio:
        Subgroup in-flight-contexts:
                incomplete -> PASS       (shard-apl) fdo#104945
Test gem_softpin:
        Subgroup noreloc-s3:
                pass       -> SKIP       (shard-snb) fdo#103375
Test kms_flip:
        Subgroup 2x-dpms-vs-vblank-race-interruptible:
                fail       -> PASS       (shard-hsw) fdo#103060
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-mmap-wc:
                pass       -> FAIL       (shard-hsw) fdo#101623
        Subgroup fbc-1p-primscrn-pri-shrfb-draw-mmap-wc:
                pass       -> FAIL       (shard-snb) fdo#103167 +3
Test kms_rotation_crc:
        Subgroup sprite-rotation-180:
                pass       -> FAIL       (shard-snb) fdo#103925

fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925

shard-apl        total:3460 pass:1818 dwarn:1   dfail:0   fail:8   skip:1633 time:12211s
shard-hsw        total:3426 pass:1746 dwarn:1   dfail:0   fail:7   skip:1670 time:11141s
shard-snb        total:3460 pass:1355 dwarn:1   dfail:0   fail:4   skip:2100 time:6519s
Blacklisted hosts:
shard-kbl        total:3460 pass:1942 dwarn:1   dfail:0   fail:7   skip:1510 time:9645s

== Logs ==

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start Maarten Lankhorst
@ 2018-03-01 15:33   ` Maarten Lankhorst
  2018-03-21 19:47     ` Paulo Zanoni
  0 siblings, 1 reply; 22+ messages in thread
From: Maarten Lankhorst @ 2018-03-01 15:33 UTC (permalink / raw)
  To: igt-dev

Hey,

Op 27-02-18 om 09:52 schreef 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.

I patched igt_kms to report the number of modesets..

Without this patch running ./kms_frontbuffer_tracking on a 2 output system (f2-snb-2600, forced VGA-1 enabled):
Performed 382 modesets

With this patch on a 2 output system:
Performed 23 modesets

On geminilake this means we save a lot of time, so could someone review this series?

Also for comparison, single output enabled, fbc-1p-rte:
Unpatched:
Performed 4 modesets

Patched:
Performed 2 modesets

Hack below:

---8<---
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 2d57369fe558..dfefe1f887ec 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2154,6 +2154,8 @@ void igt_display_fini(igt_display_t *display)
 {
 	int i;
 
+	igt_info("Performed %u modesets\n", display->modesets);
+
 	for (i = 0; i < display->n_pipes; i++)
 		igt_pipe_fini(&display->pipes[i]);
 
@@ -3196,8 +3198,23 @@ static int do_display_commit(igt_display_t *display,
 	igt_display_refresh(display);
 
 	if (s == COMMIT_ATOMIC) {
-		ret = igt_atomic_commit(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		ret = igt_atomic_commit(display, 0, NULL);
+
+		if (ret == -EINVAL) {
+			ret = igt_atomic_commit(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+			if (!ret)
+				display->modesets++;
+		}
+
 	} else {
+		ret = igt_atomic_commit(display, DRM_MODE_ATOMIC_TEST_ONLY, NULL);
+		if (ret == -EINVAL) {
+			ret = igt_atomic_commit(display, DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+			if (!ret)
+				display->modesets++;
+			ret = 0;
+		}
+
 		for_each_pipe(display, pipe) {
 			igt_pipe_t *pipe_obj = &display->pipes[pipe];
 
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index f27e22088ce2..718ea8ce0497 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -357,6 +357,7 @@ struct igt_display {
 	bool has_cursor_plane;
 	bool is_atomic;
 	bool first_commit;
+	int modesets;
 };
 
 void igt_display_init(igt_display_t *display, int drm_fd);

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 1/4] tests/kms_panel_fitting: Test cleanups.
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 1/4] tests/kms_panel_fitting: Test cleanups Maarten Lankhorst
@ 2018-03-05 13:45   ` Arkadiusz Hiler
  0 siblings, 0 replies; 22+ messages in thread
From: Arkadiusz Hiler @ 2018-03-05 13:45 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

On Tue, Feb 27, 2018 at 09:52:29AM +0100, Maarten Lankhorst wrote:
> 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.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 2/4] lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too Maarten Lankhorst
@ 2018-03-05 13:48   ` Arkadiusz Hiler
  0 siblings, 0 replies; 22+ messages in thread
From: Arkadiusz Hiler @ 2018-03-05 13:48 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

On Tue, Feb 27, 2018 at 09:52:30AM +0100, Maarten Lankhorst wrote:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3)
  2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
                   ` (5 preceding siblings ...)
  2018-02-27 10:00 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2018-03-06 11:21 ` Patchwork
  2018-03-06 15:21 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  7 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2018-03-06 11:21 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

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

== Summary ==

IGT patchset tested on top of latest successful build
68fb7595bc16a9672ea20e86431763f833cf47a7 lib/sysfs: s/kick_fbcon/bind_fbcon/

with latest DRM-Tip kernel build CI_DRM_3879
a994c52e8617 drm-tip: 2018y-03m-06d-09h-35m-22s UTC integration manifest

No testlist changes.

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:424s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:424s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:373s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:502s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:279s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:493s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:493s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:484s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:468s
fi-cfl-8700k     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:406s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:568s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:594s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:405s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:290s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:517s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:398s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:410s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:468s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:422s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:467s
fi-kbl-7560u     total:108  pass:104  dwarn:0   dfail:0   fail:0   skip:3  
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:464s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:505s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:585s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:434s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:513s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:530s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:500s
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:422s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:434s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:525s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:395s

== Logs ==

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [igt-dev] ✗ Fi.CI.IGT: failure for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3)
  2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
                   ` (6 preceding siblings ...)
  2018-03-06 11:21 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
@ 2018-03-06 15:21 ` Patchwork
  7 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2018-03-06 15:21 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

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

== Summary ==

---- Possible new issues:

Test kms_frontbuffer_tracking:
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-gtt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-shrfb-plflip-blt:
                pass       -> FAIL       (shard-hsw)

---- Known issues:

Test kms_chv_cursor_fail:
        Subgroup pipe-b-64x64-bottom-edge:
                pass       -> DMESG-WARN (shard-snb) fdo#105185 +2
Test kms_flip:
        Subgroup 2x-flip-vs-expired-vblank-interruptible:
                fail       -> PASS       (shard-hsw) fdo#102887
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
                pass       -> FAIL       (shard-hsw) fdo#101623 +2
        Subgroup fbc-1p-primscrn-shrfb-plflip-blt:
                pass       -> FAIL       (shard-hsw) fdo#103167 +2
Test kms_rotation_crc:
        Subgroup primary-rotation-180:
                fail       -> PASS       (shard-snb) fdo#103925
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047

fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047

shard-apl        total:3468 pass:1826 dwarn:1   dfail:0   fail:7   skip:1633 time:12411s
shard-hsw        total:3468 pass:1767 dwarn:1   dfail:0   fail:8   skip:1691 time:11907s
shard-snb        total:3468 pass:1362 dwarn:3   dfail:0   fail:1   skip:2102 time:6996s
Blacklisted hosts:
shard-kbl        total:3468 pass:1947 dwarn:2   dfail:0   fail:9   skip:1510 time:9799s

== Logs ==

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3.
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3 Maarten Lankhorst
@ 2018-03-07 15:17   ` Arkadiusz Hiler
  2018-03-07 15:26     ` Arkadiusz Hiler
  2018-03-08  8:57   ` Arkadiusz Hiler
  1 sibling, 1 reply; 22+ messages in thread
From: Arkadiusz Hiler @ 2018-03-07 15:17 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

On Tue, Feb 27, 2018 at 09:52:31AM +0100, Maarten Lankhorst wrote:
> Straight conversion, no behavioral changes yet.
> 
> Changes since v1:
> - Handle 2x outputs correctly.
> Changes since v2:
> - Set correct parameters in set_mode_for_params, so atomic commit for
>   2x outputs doesn't scale.
> - Fix accidental scaling in set_prim_plane_for_params.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Generally the conversion looks good to me, but I can't slap r-b
yet because there are those new fails:


Test kms_frontbuffer_tracking:
        Subgroup fbc-2p-primscrn-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-gtt:
                pass       -> FAIL       (shard-hsw)
        Subgroup fbc-2p-scndscrn-shrfb-plflip-blt:
                pass       -> FAIL       (shard-hsw)


There's even a bug for that (fdo#101623), but we never had hit the issue
with those particular 3 tests before, so they are not suppressed by the
cibuglog.

I've done a CI rerun to make sure it's consistent (and it is, 2/2 :-))
and I've tried to figure out why we hit the issue with your changes
while I was doing the review, but I haven't spotted anything suspicious.

-- 
Cheers,
Arek
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3.
  2018-03-07 15:17   ` Arkadiusz Hiler
@ 2018-03-07 15:26     ` Arkadiusz Hiler
  2018-03-07 16:40       ` Maarten Lankhorst
  0 siblings, 1 reply; 22+ messages in thread
From: Arkadiusz Hiler @ 2018-03-07 15:26 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

On Wed, Mar 07, 2018 at 05:17:37PM +0200, Arkadiusz Hiler wrote:
> On Tue, Feb 27, 2018 at 09:52:31AM +0100, Maarten Lankhorst wrote:
> > Straight conversion, no behavioral changes yet.
> > 
> > Changes since v1:
> > - Handle 2x outputs correctly.
> > Changes since v2:
> > - Set correct parameters in set_mode_for_params, so atomic commit for
> >   2x outputs doesn't scale.
> > - Fix accidental scaling in set_prim_plane_for_params.
> > 
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> 
> Generally the conversion looks good to me, but I can't slap r-b
> yet because there are those new fails:
> 
> 
> Test kms_frontbuffer_tracking:
>         Subgroup fbc-2p-primscrn-pri-shrfb-draw-render:
>                 pass       -> FAIL       (shard-hsw)
>         Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-gtt:
>                 pass       -> FAIL       (shard-hsw)
>         Subgroup fbc-2p-scndscrn-shrfb-plflip-blt:
>                 pass       -> FAIL       (shard-hsw)
> 
> 
> There's even a bug for that (fdo#101623), but we never had hit the issue
> with those particular 3 tests before, so they are not suppressed by the
> cibuglog.
> 
> I've done a CI rerun to make sure it's consistent (and it is, 2/2 :-))
> and I've tried to figure out why we hit the issue with your changes
> while I was doing the review, but I haven't spotted anything suspicious.

On a second thought it may be the optimizations from the 4th patch
making the issue more consistent.

I'll send the first three patches to get a round of CI treatment.

-- 
Cheers,
Arek
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3.
  2018-03-07 15:26     ` Arkadiusz Hiler
@ 2018-03-07 16:40       ` Maarten Lankhorst
  0 siblings, 0 replies; 22+ messages in thread
From: Maarten Lankhorst @ 2018-03-07 16:40 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

Op 07-03-18 om 16:26 schreef Arkadiusz Hiler:
> On Wed, Mar 07, 2018 at 05:17:37PM +0200, Arkadiusz Hiler wrote:
>> On Tue, Feb 27, 2018 at 09:52:31AM +0100, Maarten Lankhorst wrote:
>>> Straight conversion, no behavioral changes yet.
>>>
>>> Changes since v1:
>>> - Handle 2x outputs correctly.
>>> Changes since v2:
>>> - Set correct parameters in set_mode_for_params, so atomic commit for
>>>   2x outputs doesn't scale.
>>> - Fix accidental scaling in set_prim_plane_for_params.
>>>
>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Generally the conversion looks good to me, but I can't slap r-b
>> yet because there are those new fails:
>>
>>
>> Test kms_frontbuffer_tracking:
>>         Subgroup fbc-2p-primscrn-pri-shrfb-draw-render:
>>                 pass       -> FAIL       (shard-hsw)
>>         Subgroup fbc-2p-scndscrn-pri-shrfb-draw-mmap-gtt:
>>                 pass       -> FAIL       (shard-hsw)
>>         Subgroup fbc-2p-scndscrn-shrfb-plflip-blt:
>>                 pass       -> FAIL       (shard-hsw)
>>
>>
>> There's even a bug for that (fdo#101623), but we never had hit the issue
>> with those particular 3 tests before, so they are not suppressed by the
>> cibuglog.
>>
>> I've done a CI rerun to make sure it's consistent (and it is, 2/2 :-))
>> and I've tried to figure out why we hit the issue with your changes
>> while I was doing the review, but I haven't spotted anything suspicious.
> On a second thought it may be the optimizations from the 4th patch
> making the issue more consistent.
>
> I'll send the first three patches to get a round of CI treatment.
>
Yeah, I'm also looking at it. Patch 4/4 needs enable_fbc to be switchable at runtime by touching the module parameter, which I've done now,

and also psr to be switchable at runtime in the same way. https://patchwork.freedesktop.org/series/39545/

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3.
  2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3 Maarten Lankhorst
  2018-03-07 15:17   ` Arkadiusz Hiler
@ 2018-03-08  8:57   ` Arkadiusz Hiler
  2018-03-12 13:09     ` Maarten Lankhorst
  1 sibling, 1 reply; 22+ messages in thread
From: Arkadiusz Hiler @ 2018-03-08  8:57 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

On Tue, Feb 27, 2018 at 09:52:31AM +0100, Maarten Lankhorst wrote:
> Straight conversion, no behavioral changes yet.
> 
> Changes since v1:
> - Handle 2x outputs correctly.
> Changes since v2:
> - Set correct parameters in set_mode_for_params, so atomic commit for
>   2x outputs doesn't scale.
> - Fix accidental scaling in set_prim_plane_for_params.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

CI results are clean for the conversion, so:
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3.
  2018-03-08  8:57   ` Arkadiusz Hiler
@ 2018-03-12 13:09     ` Maarten Lankhorst
  0 siblings, 0 replies; 22+ messages in thread
From: Maarten Lankhorst @ 2018-03-12 13:09 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

Hey,

Op 08-03-18 om 09:57 schreef Arkadiusz Hiler:
> On Tue, Feb 27, 2018 at 09:52:31AM +0100, Maarten Lankhorst wrote:
>> Straight conversion, no behavioral changes yet.
>>
>> Changes since v1:
>> - Handle 2x outputs correctly.
>> Changes since v2:
>> - Set correct parameters in set_mode_for_params, so atomic commit for
>>   2x outputs doesn't scale.
>> - Fix accidental scaling in set_prim_plane_for_params.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> CI results are clean for the conversion, so:
> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

Thanks, I pushed the first 3 patches.

Patch 4 needs some upstream fixes first. I can switch FBC at runtime now through the module parameter,
followed by an atomic commit. But PSR needs a debugfs hook similar to drrs to switch it at runtime.

It's likely the FBC issue is real, and exposed through the altered timing.

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.
  2018-03-01 15:33   ` Maarten Lankhorst
@ 2018-03-21 19:47     ` Paulo Zanoni
  2018-04-05 16:31       ` Paulo Zanoni
  0 siblings, 1 reply; 22+ messages in thread
From: Paulo Zanoni @ 2018-03-21 19:47 UTC (permalink / raw)
  To: Maarten Lankhorst, igt-dev

Em Qui, 2018-03-01 às 16:33 +0100, Maarten Lankhorst escreveu:
> Hey,
> 
> Op 27-02-18 om 09:52 schreef 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.
> 
> I patched igt_kms to report the number of modesets..
> 
> Without this patch running ./kms_frontbuffer_tracking on a 2 output
> system (f2-snb-2600, forced VGA-1 enabled):
> Performed 382 modesets
> 
> With this patch on a 2 output system:
> Performed 23 modesets
> 
> On geminilake this means we save a lot of time, so could someone
> review this series?

Is there an analysis on how reducing the amount of modesets will *not*
invalidade the purpose of the tests? The modesets are there for a
reason.

> 
> Also for comparison, single output enabled, fbc-1p-rte:
> Unpatched:
> Performed 4 modesets
> 
> Patched:
> Performed 2 modesets
> 
> Hack below:
> 
> ---8<---
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 2d57369fe558..dfefe1f887ec 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2154,6 +2154,8 @@ void igt_display_fini(igt_display_t *display)
>  {
>  	int i;
>  
> +	igt_info("Performed %u modesets\n", display->modesets);
> +
>  	for (i = 0; i < display->n_pipes; i++)
>  		igt_pipe_fini(&display->pipes[i]);
>  
> @@ -3196,8 +3198,23 @@ static int do_display_commit(igt_display_t
> *display,
>  	igt_display_refresh(display);
>  
>  	if (s == COMMIT_ATOMIC) {
> -		ret = igt_atomic_commit(display,
> DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +		ret = igt_atomic_commit(display, 0, NULL);
> +
> +		if (ret == -EINVAL) {
> +			ret = igt_atomic_commit(display,
> DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +			if (!ret)
> +				display->modesets++;
> +		}
> +
>  	} else {
> +		ret = igt_atomic_commit(display,
> DRM_MODE_ATOMIC_TEST_ONLY, NULL);
> +		if (ret == -EINVAL) {
> +			ret = igt_atomic_commit(display,
> DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +			if (!ret)
> +				display->modesets++;
> +			ret = 0;
> +		}
> +
>  		for_each_pipe(display, pipe) {
>  			igt_pipe_t *pipe_obj = &display-
> >pipes[pipe];
>  
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index f27e22088ce2..718ea8ce0497 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -357,6 +357,7 @@ struct igt_display {
>  	bool has_cursor_plane;
>  	bool is_atomic;
>  	bool first_commit;
> +	int modesets;
>  };
>  
>  void igt_display_init(igt_display_t *display, int drm_fd);
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.
  2018-03-21 19:47     ` Paulo Zanoni
@ 2018-04-05 16:31       ` Paulo Zanoni
  2018-04-05 19:21         ` Maarten Lankhorst
  0 siblings, 1 reply; 22+ messages in thread
From: Paulo Zanoni @ 2018-04-05 16:31 UTC (permalink / raw)
  To: Maarten Lankhorst, igt-dev

Em Qua, 2018-03-21 às 12:47 -0700, Paulo Zanoni escreveu:
> Em Qui, 2018-03-01 às 16:33 +0100, Maarten Lankhorst escreveu:
> > Hey,
> > 
> > Op 27-02-18 om 09:52 schreef 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.
> > 
> > I patched igt_kms to report the number of modesets..
> > 
> > Without this patch running ./kms_frontbuffer_tracking on a 2 output
> > system (f2-snb-2600, forced VGA-1 enabled):
> > Performed 382 modesets
> > 
> > With this patch on a 2 output system:
> > Performed 23 modesets
> > 
> > On geminilake this means we save a lot of time, so could someone
> > review this series?
> 
> Is there an analysis on how reducing the amount of modesets will
> *not*
> invalidade the purpose of the tests? The modesets are there for a
> reason.

Ping?

> 
> > 
> > Also for comparison, single output enabled, fbc-1p-rte:
> > Unpatched:
> > Performed 4 modesets
> > 
> > Patched:
> > Performed 2 modesets
> > 
> > Hack below:
> > 
> > ---8<---
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > index 2d57369fe558..dfefe1f887ec 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -2154,6 +2154,8 @@ void igt_display_fini(igt_display_t *display)
> >  {
> >  	int i;
> >  
> > +	igt_info("Performed %u modesets\n", display->modesets);
> > +
> >  	for (i = 0; i < display->n_pipes; i++)
> >  		igt_pipe_fini(&display->pipes[i]);
> >  
> > @@ -3196,8 +3198,23 @@ static int do_display_commit(igt_display_t
> > *display,
> >  	igt_display_refresh(display);
> >  
> >  	if (s == COMMIT_ATOMIC) {
> > -		ret = igt_atomic_commit(display,
> > DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +		ret = igt_atomic_commit(display, 0, NULL);
> > +
> > +		if (ret == -EINVAL) {
> > +			ret = igt_atomic_commit(display,
> > DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +			if (!ret)
> > +				display->modesets++;
> > +		}
> > +
> >  	} else {
> > +		ret = igt_atomic_commit(display,
> > DRM_MODE_ATOMIC_TEST_ONLY, NULL);
> > +		if (ret == -EINVAL) {
> > +			ret = igt_atomic_commit(display,
> > DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +			if (!ret)
> > +				display->modesets++;
> > +			ret = 0;
> > +		}
> > +
> >  		for_each_pipe(display, pipe) {
> >  			igt_pipe_t *pipe_obj = &display-
> > > pipes[pipe];
> > 
> >  
> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> > index f27e22088ce2..718ea8ce0497 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -357,6 +357,7 @@ struct igt_display {
> >  	bool has_cursor_plane;
> >  	bool is_atomic;
> >  	bool first_commit;
> > +	int modesets;
> >  };
> >  
> >  void igt_display_init(igt_display_t *display, int drm_fd);
> > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.
  2018-04-05 16:31       ` Paulo Zanoni
@ 2018-04-05 19:21         ` Maarten Lankhorst
  2018-04-05 19:30           ` Paulo Zanoni
  0 siblings, 1 reply; 22+ messages in thread
From: Maarten Lankhorst @ 2018-04-05 19:21 UTC (permalink / raw)
  To: Paulo Zanoni, igt-dev

Op 05-04-18 om 18:31 schreef Paulo Zanoni:
> Em Qua, 2018-03-21 às 12:47 -0700, Paulo Zanoni escreveu:
>> Em Qui, 2018-03-01 às 16:33 +0100, Maarten Lankhorst escreveu:
>>> Hey,
>>>
>>> Op 27-02-18 om 09:52 schreef 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.
>>> I patched igt_kms to report the number of modesets..
>>>
>>> Without this patch running ./kms_frontbuffer_tracking on a 2 output
>>> system (f2-snb-2600, forced VGA-1 enabled):
>>> Performed 382 modesets
>>>
>>> With this patch on a 2 output system:
>>> Performed 23 modesets
>>>
>>> On geminilake this means we save a lot of time, so could someone
>>> review this series?
>> Is there an analysis on how reducing the amount of modesets will
>> *not*
>> invalidade the purpose of the tests? The modesets are there for a
>> reason.
> Ping?
How will doing a modeset improve the test?

We preserve the mode only if it makes sense, each subtest sets the parameters it wants. It just happens that in most cases that's the same mode, so we don't have to do a modeset.
That's all. :)

~Maarten
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.
  2018-04-05 19:21         ` Maarten Lankhorst
@ 2018-04-05 19:30           ` Paulo Zanoni
  2018-04-05 19:44             ` Daniel Vetter
  0 siblings, 1 reply; 22+ messages in thread
From: Paulo Zanoni @ 2018-04-05 19:30 UTC (permalink / raw)
  To: Maarten Lankhorst, igt-dev

Em Qui, 2018-04-05 às 21:21 +0200, Maarten Lankhorst escreveu:
> Op 05-04-18 om 18:31 schreef Paulo Zanoni:
> > Em Qua, 2018-03-21 às 12:47 -0700, Paulo Zanoni escreveu:
> > > Em Qui, 2018-03-01 às 16:33 +0100, Maarten Lankhorst escreveu:
> > > > Hey,
> > > > 
> > > > Op 27-02-18 om 09:52 schreef 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.
> > > > 
> > > > I patched igt_kms to report the number of modesets..
> > > > 
> > > > Without this patch running ./kms_frontbuffer_tracking on a 2
> > > > output
> > > > system (f2-snb-2600, forced VGA-1 enabled):
> > > > Performed 382 modesets
> > > > 
> > > > With this patch on a 2 output system:
> > > > Performed 23 modesets
> > > > 
> > > > On geminilake this means we save a lot of time, so could
> > > > someone
> > > > review this series?
> > > 
> > > Is there an analysis on how reducing the amount of modesets will
> > > *not*
> > > invalidade the purpose of the tests? The modesets are there for a
> > > reason.
> > 
> > Ping?
> 
> How will doing a modeset improve the test?
> 
> We preserve the mode only if it makes sense, each subtest sets the
> parameters it wants. It just happens that in most cases that's the
> same mode, so we don't have to do a modeset.
> That's all. :)

But having or not having a modeset, having or not having a flip changes
how the FBC code in the Kernel behaves. So changing from having a
modeset to not having one will definitely have an impact on what code
gets run. It would be good to have a detailed analysis on why this is
not the case the specific points that changed.

> 
> ~Maarten
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start.
  2018-04-05 19:30           ` Paulo Zanoni
@ 2018-04-05 19:44             ` Daniel Vetter
  0 siblings, 0 replies; 22+ messages in thread
From: Daniel Vetter @ 2018-04-05 19:44 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: igt-dev

On Thu, Apr 5, 2018 at 9:30 PM, Paulo Zanoni <paulo.r.zanoni@intel.com> wrote:
> Em Qui, 2018-04-05 às 21:21 +0200, Maarten Lankhorst escreveu:
>> Op 05-04-18 om 18:31 schreef Paulo Zanoni:
>> > Em Qua, 2018-03-21 às 12:47 -0700, Paulo Zanoni escreveu:
>> > > Em Qui, 2018-03-01 às 16:33 +0100, Maarten Lankhorst escreveu:
>> > > > Hey,
>> > > >
>> > > > Op 27-02-18 om 09:52 schreef 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.
>> > > >
>> > > > I patched igt_kms to report the number of modesets..
>> > > >
>> > > > Without this patch running ./kms_frontbuffer_tracking on a 2
>> > > > output
>> > > > system (f2-snb-2600, forced VGA-1 enabled):
>> > > > Performed 382 modesets
>> > > >
>> > > > With this patch on a 2 output system:
>> > > > Performed 23 modesets
>> > > >
>> > > > On geminilake this means we save a lot of time, so could
>> > > > someone
>> > > > review this series?
>> > >
>> > > Is there an analysis on how reducing the amount of modesets will
>> > > *not*
>> > > invalidade the purpose of the tests? The modesets are there for a
>> > > reason.
>> >
>> > Ping?
>>
>> How will doing a modeset improve the test?
>>
>> We preserve the mode only if it makes sense, each subtest sets the
>> parameters it wants. It just happens that in most cases that's the
>> same mode, so we don't have to do a modeset.
>> That's all. :)
>
> But having or not having a modeset, having or not having a flip changes
> how the FBC code in the Kernel behaves. So changing from having a
> modeset to not having one will definitely have an impact on what code
> gets run. It would be good to have a detailed analysis on why this is
> not the case the specific points that changed.

Helps to also point at the regression report:

https://bugs.freedesktop.org/show_bug.cgi?id=105503

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2018-04-05 19:53 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27  8:52 [igt-dev] [PATCH i-g-t v3 0/4] kms_panel_fitting and kms_frontbuffer_tracking cleanups Maarten Lankhorst
2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 1/4] tests/kms_panel_fitting: Test cleanups Maarten Lankhorst
2018-03-05 13:45   ` Arkadiusz Hiler
2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly too Maarten Lankhorst
2018-03-05 13:48   ` Arkadiusz Hiler
2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 3/4] tests/kms_frontbuffer_tracking: Convert test to use igt_display, v3 Maarten Lankhorst
2018-03-07 15:17   ` Arkadiusz Hiler
2018-03-07 15:26     ` Arkadiusz Hiler
2018-03-07 16:40       ` Maarten Lankhorst
2018-03-08  8:57   ` Arkadiusz Hiler
2018-03-12 13:09     ` Maarten Lankhorst
2018-02-27  8:52 ` [igt-dev] [PATCH i-g-t v3 4/4] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start Maarten Lankhorst
2018-03-01 15:33   ` Maarten Lankhorst
2018-03-21 19:47     ` Paulo Zanoni
2018-04-05 16:31       ` Paulo Zanoni
2018-04-05 19:21         ` Maarten Lankhorst
2018-04-05 19:30           ` Paulo Zanoni
2018-04-05 19:44             ` Daniel Vetter
2018-02-27  9:15 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_panel_fitting and kms_frontbuffer_tracking cleanups. (rev3) Patchwork
2018-02-27 10:00 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-03-06 11:21 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2018-03-06 15:21 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.