All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH v2 i-g-t] tests/kms_setmode: Restrict the test execution to two pipes
@ 2021-02-18 17:10 venkata.sai.patnana
  2021-02-18 18:32 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_setmode: Restrict the test execution to two pipes (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: venkata.sai.patnana @ 2021-02-18 17:10 UTC (permalink / raw)
  To: igt-dev; +Cc: juha-pekka.heikkila, petri.latvala

From: Patnana Venkata Sai <venkata.sai.patnana@intel.com>

Restrict execution of all subtests to two pipes(default)
If you want to execute on all pipes need to pass extra argument(-e)
Example: ./build/tests/kms_setmode -e --r basic

V2: Handle when count_crtcs is less than 2 (petri)

Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
Cc: Modem Bhanuprakash <bhanuprakash.modem@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Tested-by: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
---
 tests/kms_setmode.c | 35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 16648087d0..a87cbfc30c 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -37,10 +37,14 @@
 /* max combinations with repetitions */
 #define MAX_COMBINATION_ELEMS   MAX_CRTCS
 
+/* restricted pipe count */
+#define CRTC_RESTRICT_CNT 2
+
 static int drm_fd;
 static drmModeRes *drm_resources;
 static int filter_test_id;
 static bool dry_run;
+static bool all_pipes = false;
 
 const drmModeModeInfo mode_640_480 = {
 	.name		= "640x480",
@@ -753,7 +757,12 @@ static void test_combinations(const struct test_config *tconf,
 	struct combination_set connector_combs;
 	struct combination_set crtc_combs;
 	struct connector_config *cconfs;
-	int i;
+	int i, crtc_count;
+
+	if ((tconf->resources->count_crtcs <= CRTC_RESTRICT_CNT) || all_pipes)
+		crtc_count = tconf->resources->count_crtcs;
+	else
+		crtc_count = CRTC_RESTRICT_CNT;
 
 	if (connector_count > 2 && (tconf->flags & TEST_STEALING))
 		return;
@@ -761,20 +770,19 @@ static void test_combinations(const struct test_config *tconf,
 	igt_assert(tconf->resources);
 
 	connector_combs.capacity = pow(tconf->resources->count_connectors,
-				       tconf->resources->count_crtcs + 1);
-	crtc_combs.capacity = pow(tconf->resources->count_crtcs,
-				  tconf->resources->count_crtcs + 1);
-
+				       crtc_count + 1);
+	crtc_combs.capacity = pow(crtc_count,
+				  crtc_count + 1);
 	connector_combs.items = malloc(connector_combs.capacity * sizeof(struct combination));
 	crtc_combs.items = malloc(crtc_combs.capacity * sizeof(struct combination));
 
 	get_combinations(tconf->resources->count_connectors, connector_count,
 			 false, &connector_combs);
-	get_combinations(tconf->resources->count_crtcs, connector_count,
-			 true, &crtc_combs);
+	get_combinations(crtc_count, connector_count, true, &crtc_combs);
 
 	igt_info("Testing: %s %d connector combinations\n", tconf->name,
 		 connector_count);
+
 	for (i = 0; i < connector_combs.count; i++) {
 		int *connector_idxs;
 		int ret;
@@ -811,10 +819,11 @@ free_cconfs:
 
 static void run_test(const struct test_config *tconf)
 {
-	int connector_num;
+	int connector_num, crtc_count;
 
 	connector_num = tconf->flags & TEST_CLONE ? 2 : 1;
-	for (; connector_num <= tconf->resources->count_crtcs; connector_num++)
+	crtc_count = all_pipes ? tconf->resources->count_crtcs : CRTC_RESTRICT_CNT;
+	for (; connector_num <= crtc_count; connector_num++)
 		test_combinations(tconf, connector_num);
 }
 
@@ -824,6 +833,9 @@ static int opt_handler(int opt, int opt_index, void *data)
 	case 'd':
 		dry_run = true;
 		break;
+	case 'e':
+		all_pipes = true;
+		break;
 	case 't':
 		filter_test_id = atoi(optarg);
 		break;
@@ -836,9 +848,10 @@ static int opt_handler(int opt, int opt_index, void *data)
 
 const char *help_str =
 	"  -d\t\tDon't run any test, only print what would be done. (still needs DRM access)\n"
-	"  -t <test id>\tRun only the test with this id.";
+	"  -t <test id>\tRun only the test with this id\n"
+	"  -e \t\tRun on all pipes. (Default it will Run only two pipes)\n";
 
-igt_main_args("dt:", NULL, help_str, opt_handler, NULL)
+igt_main_args("det:", NULL, help_str, opt_handler, NULL)
 {
 	const struct {
 		enum test_flags flags;
-- 
2.25.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-19  7:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 17:10 [igt-dev] [PATCH v2 i-g-t] tests/kms_setmode: Restrict the test execution to two pipes venkata.sai.patnana
2021-02-18 18:32 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_setmode: Restrict the test execution to two pipes (rev2) Patchwork
2021-02-18 20:08 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-02-19  7:35 ` [igt-dev] [PATCH v2 i-g-t] tests/kms_setmode: Restrict the test execution to two pipes Petri Latvala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.