[Intel-gfx] [PATCH i-g-t 2/4] tests/kms_flip: Disable all pipes before each test

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Wed Nov 11 09:32:46 PST 2015


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Currently kms_flip leaks the state of the pipes from one subtest to the
next. Meaning a single pipe test can actually have two or more pipes
actually up and running, and similarly a two pipe test can have three
pipes running.

This is particularly nasty on IVB since one of the pipes still running
but not actually part of the test maybe have reserved the shared FDI
lanes, thus preventing one of the pipes taking part in the test from
being enabled.

To avoid such problems explicitly disable all pipes before each
subtests.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tests/kms_flip.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 649678c..632f264 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -849,6 +849,22 @@ static bool is_hung(int fd)
 	return errno == EIO;
 }
 
+static void disable_crtcs(void)
+{
+	int n;
+
+	for (n = 0; n < resources->count_crtcs; n++) {
+		drmModeCrtc *crtc = drmModeGetCrtc(drm_fd, resources->crtcs[n]);
+
+		int ret = drmModeSetCrtc(drm_fd, crtc->crtc_id,
+					 0, 0, 0,
+					 0, 0, 0);
+		igt_assert(ret == 0);
+
+		drmModeFreeCrtc(crtc);
+	}
+}
+
 static int set_mode(struct test_output *o, uint32_t fb, int x, int y)
 {
 	int n;
@@ -1425,6 +1441,8 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 	for (i = 0; i < o->count; i++)
 		kmstest_dump_mode(&o->kmode[i]);
 
+	disable_crtcs();
+
 	if (set_mode(o, o->fb_ids[0], 0, 0)) {
 		/* We may fail to apply the mode if there are hidden
 		 * constraints, such as bandwidth on the third pipe.
-- 
2.4.10



More information about the Intel-gfx mailing list