diff options
author | Bhanuprakash Modem <bhanuprakash.modem@intel.com> | 2021-07-05 18:26:16 +0530 |
---|---|---|
committer | Kunal Joshi <kunal1.joshi@intel.com> | 2021-07-27 09:49:37 +0530 |
commit | 424c22fc55e78cd03a210bca63759be2be37d734 (patch) | |
tree | 1c0a630b273034c81e4733644ecce98045e472cd /tests/kms_flip.c | |
parent | 030c28d099a5c6793c92e2b22c8e9abd3d340fdc (diff) |
tests/kms_flip: Restrict the hang tests execution to two pipes
To save the CI execution time, instead of running on all pipes
restrict the hang tests execution to two pipes (first & last).
If we want to execute on all pipes, we need to pass an extra
argument "-e" indicates extended.
Example: ./build/tests/kms_flip -e --r flip-vs-modeset-vs-hang
v2, v3:
* Fix the typo in args handler (Petri)
v4:
* Refactor to run on first & last pipes.
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Diffstat (limited to 'tests/kms_flip.c')
-rwxr-xr-x | tests/kms_flip.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 09762ae8..f2fce8d2 100755 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -85,6 +85,8 @@ #define DRM_CAP_TIMESTAMP_MONOTONIC 6 #endif +static bool all_pipes = false; + drmModeRes *resources; int drm_fd; static struct buf_ops *bops; @@ -1450,6 +1452,11 @@ static int run_test(int duration, int flags) /* Count output configurations to scale test runtime. */ for (i = 0; i < resources->count_connectors; i++) { for (n = 0; n < resources->count_crtcs; n++) { + /* Limit the execution to 2 CRTCs (first & last) for hang tests */ + if ((flags & TEST_HANG) && !all_pipes && + n != 0 && n != (resources->count_crtcs - 1)) + continue; + memset(&o, 0, sizeof(o)); o.count = 1; o._connector[0] = resources->connectors[i]; @@ -1474,6 +1481,11 @@ static int run_test(int duration, int flags) for (n = 0; n < resources->count_crtcs; n++) { int crtc_idx; + /* Limit the execution to 2 CRTCs (first & last) for hang tests */ + if ((flags & TEST_HANG) && !all_pipes && + n != 0 && n != (resources->count_crtcs - 1)) + continue; + memset(&o, 0, sizeof(o)); o.count = 1; o._connector[0] = resources->connectors[i]; @@ -1604,7 +1616,23 @@ static void test_nonblocking_read(int in) close(fd); } -igt_main +static int opt_handler(int opt, int opt_index, void *data) +{ + switch (opt) { + case 'e': + all_pipes = true; + break; + default: + return IGT_OPT_HANDLER_ERROR; + } + + return IGT_OPT_HANDLER_SUCCESS; +} + +const char *help_str = + " -e \tRun on all pipes. (By default subtests will run on two pipes)\n"; + +igt_main_args("e", NULL, help_str, opt_handler, NULL) { struct { int duration; |