summaryrefslogtreecommitdiff
path: root/tests/kms_flip.c
diff options
context:
space:
mode:
authorKarthik B S <karthik.b.s@intel.com>2022-05-06 09:45:33 +0530
committerKunal Joshi <kunal1.joshi@intel.com>2022-05-09 22:20:07 +0530
commitfe3c194ba90615e2402461348357c88a23864275 (patch)
tree576273e392bad210fce6a9130fe944c5e9a5d27e /tests/kms_flip.c
parentcffa5fffe9acddf49565b4caeeb5e3355ff2ea44 (diff)
tests/kms_flip: Update logic to calculate test duration
Few of the subtests are intended to run only for one iteration with duration of 0. But because of the existing logic to calculate duration, even these subtests are running in loop for 0.5s. This is causing excessive logging in the nonexisting-fb subtests. Added check to use duration calculation logic only if duration is non-zero in the first place. Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Diffstat (limited to 'tests/kms_flip.c')
-rwxr-xr-xtests/kms_flip.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index ce452dc8..773e6597 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1537,8 +1537,11 @@ static int run_test(int duration, int flags)
}
igt_require(modes);
- duration = duration * 1000 / modes;
- duration = max(500, duration);
+
+ if (duration) {
+ duration = duration * 1000 / modes;
+ duration = max(500, duration);
+ }
/* Find any connected displays */
for (i = 0; i < resources->count_connectors; i++) {
@@ -1605,8 +1608,11 @@ static int run_pair(int duration, int flags)
/* If we have fewer than 2 connected outputs then we won't have any
* configuration at all. So skip in that case. */
igt_require_f(modes, "At least two displays required\n");
- duration = duration * 1000 / modes;
- duration = max(duration, 500);
+
+ if (duration) {
+ duration = duration * 1000 / modes;
+ duration = max(duration, 500);
+ }
/* Find a pair of connected displays */
for (i = 0; i < resources->count_connectors; i++) {