diff mbox

tests/kms_sink_crc_basic: Wait 2 vblanks before grabing the new crc.

Message ID 1410304189-5886-1-git-send-email-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi Sept. 9, 2014, 11:09 p.m. UTC
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 tests/kms_sink_crc_basic.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c
index a7febe8..69329bd 100644
--- a/tests/kms_sink_crc_basic.c
+++ b/tests/kms_sink_crc_basic.c
@@ -48,9 +48,14 @@  typedef struct {
 	igt_plane_t *primary;
 } data_t;
 
-static void get_crc(char *crc) {
+static void get_crc(data_t *data, char *crc) {
 	int ret;
-	FILE *file = igt_debugfs_fopen("i915_sink_crc_eDP1", "r");
+	FILE *file;
+
+	igt_wait_for_vblank(data->drm_fd, 0);
+	igt_wait_for_vblank(data->drm_fd, 0);
+
+	file = igt_debugfs_fopen("i915_sink_crc_eDP1", "r");
 	igt_require(file);
 
 	ret = fscanf(file, "%s\n", crc);
@@ -111,7 +116,7 @@  static void basic_sink_crc_check(data_t *data)
 	igt_display_commit(&data->display);
 
 	/* It should be Green */
-	get_crc(crc);
+	get_crc(data, crc);
 	assert_color(crc, GREEN);
 
 	/* Go Red */
@@ -119,7 +124,7 @@  static void basic_sink_crc_check(data_t *data)
 	igt_display_commit(&data->display);
 
 	/* It should be Red */
-	get_crc(crc);
+	get_crc(data, crc);
 	assert_color(crc, RED);
 }
 
@@ -136,7 +141,7 @@  static void run_test(data_t *data)
 		    c->connection != DRM_MODE_CONNECTED)
 			continue;
 
-		igt_output_set_pipe(output, PIPE_ANY);
+		igt_output_set_pipe(output, 0);
 
 		mode = igt_output_get_mode(output);