summaryrefslogtreecommitdiff
path: root/tests/kms_pwrite_crc.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-01-05 14:07:39 +0100
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-01-05 14:21:48 +0100
commit5bef56d52b0e226a54318960044a4dd877e3b6aa (patch)
tree4192565237b365a8954d9b981cc210cd7d2e4c13 /tests/kms_pwrite_crc.c
parenteb66123f9bf71f3562323f021929dd909e1d4611 (diff)
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 <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests/kms_pwrite_crc.c')
-rw-r--r--tests/kms_pwrite_crc.c29
1 files changed, 8 insertions, 21 deletions
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");