From: Tvrtko Ursulin <[email protected]>

It brings enough value for the basic test set to check
one connector with one pipe only, rather every connector
with all possible pipes.

Signed-off-by: Tvrtko Ursulin <[email protected]>
---
 tests/kms_flip.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 1e7336e1ba95..992c59b53fb9 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1283,7 +1283,7 @@ static void free_test_output(struct test_output *o)
        }
 }
 
-static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
+static bool run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
                                 int crtc_count, int duration_ms)
 {
        char test_name[128];
@@ -1296,7 +1296,7 @@ static void run_test_on_crtc_set(struct test_output *o, 
int *crtc_idxs,
        case 1:
                connector_find_preferred_mode(o->_connector[0], crtc_idxs[0], 
o);
                if (!o->mode_valid)
-                       return;
+                       return false;
                snprintf(test_name, sizeof(test_name),
                         "%s on pipe %s, connector %s-%d",
                         igt_subtest_name(),
@@ -1307,7 +1307,7 @@ static void run_test_on_crtc_set(struct test_output *o, 
int *crtc_idxs,
        case 2:
                connector_find_compatible_mode(crtc_idxs[0], crtc_idxs[1], o);
                if (!o->mode_valid)
-                       return;
+                       return false;
                snprintf(test_name, sizeof(test_name),
                         "%s on pipe %s:%s, connector %s-%d:%s-%d",
                         igt_subtest_name(),
@@ -1422,6 +1422,8 @@ out:
        last_connector = NULL;
 
        free_test_output(o);
+
+       return true;
 }
 
 static int run_test(int duration, int flags)
@@ -1454,6 +1456,9 @@ static int run_test(int duration, int flags)
                                modes++;
 
                        free_test_output(&o);
+
+                       if ((flags & TEST_BASIC) && modes > 0)
+                               break;
                }
        }
 
@@ -1462,6 +1467,7 @@ static int run_test(int duration, int flags)
        duration = max(500, duration);
 
        /* Find any connected displays */
+       modes = 0;
        for (i = 0; i < resources->count_connectors; i++) {
                for (n = 0; n < resources->count_crtcs; n++) {
                        int crtc_idx;
@@ -1476,7 +1482,11 @@ static int run_test(int duration, int flags)
                        o.depth = 24;
 
                        crtc_idx = n;
-                       run_test_on_crtc_set(&o, &crtc_idx, 1, duration);
+                       if (run_test_on_crtc_set(&o, &crtc_idx, 1, duration))
+                               modes++;
+
+                       if ((flags & TEST_BASIC) && modes > 0)
+                               break;
                }
        }
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to