Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kunal Joshi <kunal1.joshi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Kunal Joshi" <kunal1.joshi@intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Ankit Nautiyal" <ankit.k.nautiyal@intel.com>,
	"Bhanuprakash Modem" <bhanuprakash.modem@intel.com>
Subject: [PATCH i-g-t 2/7] tests/intel/kms_big_joiner: fix crash in multi joiner test
Date: Mon, 22 Apr 2024 11:04:49 +0530	[thread overview]
Message-ID: <20240422053454.2523989-3-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20240422053454.2523989-1-kunal1.joshi@intel.com>

Fix test from crashing on out of bound.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/intel/kms_big_joiner.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/intel/kms_big_joiner.c b/tests/intel/kms_big_joiner.c
index 078f76ac1..88923be6b 100644
--- a/tests/intel/kms_big_joiner.c
+++ b/tests/intel/kms_big_joiner.c
@@ -162,7 +162,7 @@ static void test_single_joiner(data_t *data, int output_count, bool force_joiner
 
 static void test_multi_joiner(data_t *data, int output_count, bool force_joiner)
 {
-	int i;
+	int i, cleanup;
 	uint32_t available_pipe_mask;
 	enum pipe pipe, master_pipe;
 	igt_output_t **outputs;
@@ -173,6 +173,7 @@ static void test_multi_joiner(data_t *data, int output_count, bool force_joiner)
 
 	available_pipe_mask = BIT(data->n_pipes) - 1;
 	outputs = force_joiner ? data->non_big_joiner_output : data->big_joiner_output;
+	cleanup = 0;
 
 	igt_display_reset(&data->display);
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
@@ -183,6 +184,7 @@ static void test_multi_joiner(data_t *data, int output_count, bool force_joiner)
 			master_pipe = setup_pipe(data, output, pipe, available_pipe_mask);
 			if (master_pipe == PIPE_NONE)
 				continue;
+			cleanup++;
 			mode = igt_output_get_mode(output);
 			primary[i] = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 			igt_create_pattern_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888,
@@ -195,7 +197,7 @@ static void test_multi_joiner(data_t *data, int output_count, bool force_joiner)
 		}
 	}
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
-	for (i = 0; i < output_count; i++) {
+	for (i = 0; i < cleanup; i++) {
 		igt_plane_set_fb(primary[i], NULL);
 		igt_remove_fb(data->drm_fd, &fb[i]);
 	}
-- 
2.25.1


  parent reply	other threads:[~2024-04-22  5:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  5:34 [PATCH i-g-t 0/7] cleanup and fixes for kms_big_joiner Kunal Joshi
2024-04-22  5:34 ` [PATCH i-g-t 1/7] lib/igt_kms: don't run on unsupported platform Kunal Joshi
2024-04-22 10:40   ` Modem, Bhanuprakash
2024-04-22  5:34 ` Kunal Joshi [this message]
2024-04-22  5:34 ` [PATCH i-g-t 3/7] tests/intel/kms_big_joiner: add missing commit after reset Kunal Joshi
2024-04-22 10:40   ` Modem, Bhanuprakash
2024-04-22  5:34 ` [PATCH i-g-t 4/7] lib/igt_kms: add support for forcing bigjoiner on particular connector Kunal Joshi
2024-04-22 10:59   ` Modem, Bhanuprakash
2024-04-22  5:34 ` [PATCH i-g-t 5/7] tests/intel/kms_big_joiner: use kmstest_force_connector_bigjoiner Kunal Joshi
2024-04-22 11:09   ` Modem, Bhanuprakash
2024-04-22  5:34 ` [PATCH i-g-t 6/7] lib/igt_kms: remove unused igt_force_and_check_bigjoiner_status Kunal Joshi
2024-04-22  5:34 ` [PATCH i-g-t 7/7] HAX: Do not merge Kunal Joshi
2024-04-22 11:37 ` ✗ Fi.CI.BAT: failure for cleanup and fixes for kms_big_joiner (rev4) Patchwork
2024-04-22 11:47 ` ✓ CI.xeBAT: success " Patchwork
2024-04-22 18:51 ` ✗ CI.xeFULL: failure " Patchwork
2024-04-23  8:55 ` [PATCH i-g-t 0/7] cleanup and fixes for kms_big_joiner Modem, Bhanuprakash
  -- strict thread matches above, loose matches on Subject: below --
2024-04-19  6:39 Kunal Joshi
2024-04-19  6:39 ` [PATCH i-g-t 2/7] tests/intel/kms_big_joiner: fix crash in multi joiner test Kunal Joshi
2024-04-19  9:42   ` Modem, Bhanuprakash
2024-04-18 15:28 [PATCH i-g-t 0/7] cleanup and fixes for kms_big_joiner Kunal Joshi
2024-04-18 15:28 ` [PATCH i-g-t 2/7] tests/intel/kms_big_joiner: fix crash in multi joiner test Kunal Joshi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240422053454.2523989-3-kunal1.joshi@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox