summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Vivi <rodrigo.vivi@intel.com>2014-09-09 12:25:47 -0400
committerRodrigo Vivi <rodrigo.vivi@intel.com>2014-09-11 11:41:52 -0400
commitd92fbc23138b1014e8574daf29dbb06b8c81aa7a (patch)
tree6ac210637d2396d4dd47f568b5f918064ed3abe0
parent1d7b062621fa291d3412f47265d0ba603b65cc96 (diff)
tests/kms_sink_crc_basic: Wait 2 vblanks before grabing the new crc.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r--tests/kms_sink_crc_basic.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c
index 2df9568b..679a5f4b 100644
--- a/tests/kms_sink_crc_basic.c
+++ b/tests/kms_sink_crc_basic.c
@@ -48,9 +48,15 @@ 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 = fopen("/sys/kernel/debug/dri/0/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 +117,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 +125,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 +142,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);