[Intel-gfx] [PATCH] tests/kms_sink_crc_basic: Wait 2 vblanks before grabing the new crc.

Rodrigo Vivi rodrigo.vivi at intel.com
Wed Sep 10 01:09:49 CEST 2014


Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 tests/kms_sink_crc_basic.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

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);
 
-- 
1.9.3




More information about the Intel-gfx mailing list