From 5bef56d52b0e226a54318960044a4dd877e3b6aa Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 5 Jan 2017 14:07:39 +0100 Subject: kms_pwrite_crc: Stop looking at output->valid. Use the proper iterator macros to prevent ever having an invalid config. Signed-off-by: Maarten Lankhorst --- tests/kms_pwrite_crc.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'tests/kms_pwrite_crc.c') diff --git a/tests/kms_pwrite_crc.c b/tests/kms_pwrite_crc.c index 86292bda..b63afbc6 100644 --- a/tests/kms_pwrite_crc.c +++ b/tests/kms_pwrite_crc.c @@ -100,7 +100,7 @@ static void test(data_t *data) igt_assert_crc_equal(&crc, &data->ref_crc); } -static bool prepare_crtc(data_t *data) +static void prepare_crtc(data_t *data) { igt_display_t *display = &data->display; igt_output_t *output = data->output; @@ -108,13 +108,6 @@ static bool prepare_crtc(data_t *data) /* select the pipe we want to use */ igt_output_set_pipe(output, data->pipe); - igt_display_commit(display); - - if (!output->valid) { - igt_output_set_pipe(output, PIPE_ANY); - igt_display_commit(display); - return false; - } mode = igt_output_get_mode(output); @@ -136,8 +129,6 @@ static bool prepare_crtc(data_t *data) /* get reference crc for the white fb */ igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc); - - return true; } static void cleanup_crtc(data_t *data) @@ -164,20 +155,16 @@ static void run_test(data_t *data) igt_output_t *output; enum pipe pipe; - for_each_connected_output(display, output) { + for_each_pipe_with_valid_output(display, pipe, output) { data->output = output; - for_each_pipe(display, pipe) { - data->pipe = pipe; - - if (!prepare_crtc(data)) - continue; + data->pipe = pipe; - test(data); - cleanup_crtc(data); + prepare_crtc(data); + test(data); + cleanup_crtc(data); - /* once is enough */ - return; - } + /* once is enough */ + return; } igt_skip("no valid crtc/connector combinations found\n"); -- cgit v1.2.3