From 8d33b6114d95565a71f12810eca4eff15efbc6a3 Mon Sep 17 00:00:00 2001
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Date: Tue, 11 Oct 2022 22:15:25 +0300
Subject: [PATCH] tests/kms_addfb_basic: avoid excessive logging on legacy
 format test

legacy format addfb test try to fuzz kernel with random parameters,
these random parameters cause logging into dmesg. Limit fuzzing
rounds to maximum of 10k (or 1 second) to limit size of created log.

Fixes: https://gitlab.freedesktop.org/drm/intel/-/issues/7017
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
---
 tests/kms_addfb_basic.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
index afb4bdf6f..f91153b5b 100644
--- a/tests/kms_addfb_basic.c
+++ b/tests/kms_addfb_basic.c
@@ -241,6 +241,13 @@ static void invalid_tests(int fd)
 			}
 
 			count++;
+
+			/*
+			 * to avoid exessive logging stop after 10k loops
+			 */
+			if (count >= 10000) {
+				break;
+			}
 		}
 
 		/* After all the abuse, confirm the known_formats */
-- 
GitLab