All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Kunal Joshi <kunal1.joshi@intel.com>, <igt-dev@lists.freedesktop.org>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>,
	Karthik B S <karthik.b.s@intel.com>,
	Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Subject: Re: [PATCH i-g-t 4/5] tests/intel/kms_big_joiner: add tests for force joiner
Date: Mon, 1 Apr 2024 10:46:16 +0530	[thread overview]
Message-ID: <93ad9ef2-114a-4932-9c75-68f31af23631@intel.com> (raw)
In-Reply-To: <20240328144554.1371727-5-kunal1.joshi@intel.com>


On 3/28/2024 8:15 PM, Kunal Joshi wrote:
> add tests for force joiner
>
> v2: check status after forcing (Ankit)
>      take out commoon code (Ankit)
>      fix missing force_joiner (Ankit)
>
> v3: add doc (Ankit)
>
> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>   tests/intel/kms_big_joiner.c | 119 +++++++++++++++++++++++++++++------
>   1 file changed, 100 insertions(+), 19 deletions(-)
>
> diff --git a/tests/intel/kms_big_joiner.c b/tests/intel/kms_big_joiner.c
> index c13d58bcc..7daf47cda 100644
> --- a/tests/intel/kms_big_joiner.c
> +++ b/tests/intel/kms_big_joiner.c
> @@ -44,9 +44,20 @@
>    * SUBTEST: basic
>    * Description: Verify the basic modeset on big joiner mode on all pipes
>    *
> + * SUBTEST: invalid-modeset-force-joiner
> + * Description: Verify if the modeset on the adjoining pipe is rejected when
> + *              the pipe is active with a force joiner modeset
Nitpick : This sentence should here.
> + *              force joiner is to used to force bigjoiner functionality on

Force joiner is used to..


> + *              non bigjoiner outputs, hence test will run only on non bigjoiner
> + *              outputs
> + *
> + * SUBTEST: basic-force-joiner
> + * Description: Verify the basic modeset on force joiner mode on all pipes
Nitpick: This sentence should end here.
> + *              force joiner is to used to force bigjoiner functionality on

Force joiner is used to..


Other than that looks good to me.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

> + *              non bigjoiner outputs, hence test will run only on non bigjoiner
> + *              outputs
>    */
> -
> -IGT_TEST_DESCRIPTION("Test big joiner");
> +IGT_TEST_DESCRIPTION("Test big joiner / force joiner");
>   
>   #define INVALID_TEST_OUTPUT 2
>   
> @@ -79,6 +90,19 @@ static void set_all_master_pipes_for_platform(data_t *data)
>   	}
>   }
>   
> +static void toggle_force_joiner_on_all_non_big_joiner_outputs(data_t *data, bool toggle)
> +{
> +	bool status;
> +	igt_output_t *output;
> +	int i;
> +
> +	for (i = 0; i < data->non_big_joiner_output_count; i++) {
> +		output = data->non_big_joiner_output[i];
> +		status = igt_force_and_check_bigjoiner_status(data->drm_fd, output->name, toggle);
> +		igt_assert_f(status, "Failed to toggle force joiner\n");
> +	}
> +}
> +
>   static enum pipe get_next_master_pipe(data_t *data, uint32_t available_pipe_mask)
>   {
>   	if ((data->master_pipes & available_pipe_mask) == 0)
> @@ -105,7 +129,7 @@ static enum pipe setup_pipe(data_t *data, igt_output_t *output, enum pipe pipe,
>   	return master_pipe;
>   }
>   
> -static void test_single_joiner(data_t *data, int output_count)
> +static void test_single_joiner(data_t *data, int output_count, bool force_joiner)
>   {
>   	int i;
>   	enum pipe pipe, master_pipe;
> @@ -116,12 +140,13 @@ static void test_single_joiner(data_t *data, int output_count)
>   	igt_fb_t fb;
>   	drmModeModeInfo *mode;
>   
> -	outputs = data->big_joiner_output;
> +	outputs = force_joiner ? data->non_big_joiner_output : data->big_joiner_output;
> +	igt_display_reset(&data->display);
> +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
>   
>   	for (i = 0; i < output_count; i++) {
>   		output = outputs[i];
>   		for (pipe = 0; pipe < data->n_pipes - 1; pipe++) {
> -			igt_display_reset(&data->display);
>   			master_pipe = setup_pipe(data, output, pipe, available_pipe_mask);
>   			if (master_pipe == PIPE_NONE)
>   				continue;
> @@ -131,13 +156,14 @@ static void test_single_joiner(data_t *data, int output_count)
>   					      DRM_FORMAT_MOD_LINEAR, &fb);
>   			igt_plane_set_fb(primary, &fb);
>   			igt_display_commit2(&data->display, COMMIT_ATOMIC);
> +			igt_display_reset(&data->display);
>   			igt_plane_set_fb(primary, NULL);
>   			igt_remove_fb(data->drm_fd, &fb);
>   		}
>   	}
>   }
>   
> -static void test_multi_joiner(data_t *data, int output_count)
> +static void test_multi_joiner(data_t *data, int output_count, bool force_joiner)
>   {
>   	int i;
>   	uint32_t available_pipe_mask;
> @@ -149,9 +175,11 @@ static void test_multi_joiner(data_t *data, int output_count)
>   	drmModeModeInfo *mode;
>   
>   	available_pipe_mask = BIT(data->n_pipes) - 1;
> -	outputs = data->big_joiner_output;
> +	outputs = force_joiner ? data->non_big_joiner_output : data->big_joiner_output;
>   
>   	igt_display_reset(&data->display);
> +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> +
>   	for (i = 0; i < output_count; i++) {
>   		output = outputs[i];
>   		for (pipe = 0; pipe < data->n_pipes; pipe++) {
> @@ -177,7 +205,7 @@ static void test_multi_joiner(data_t *data, int output_count)
>   }
>   
>   static void test_invalid_modeset_two_joiner(data_t *data,
> -					    bool mixed)
> +					    bool mixed, bool force_joiner)
>   {
>   	int i, j, ret;
>   	uint32_t available_pipe_mask;
> @@ -190,10 +218,12 @@ static void test_invalid_modeset_two_joiner(data_t *data,
>   	drmModeModeInfo *mode;
>   
>   	available_pipe_mask = BIT(data->n_pipes) - 1;
> -	outputs = mixed ? data->mixed_output : data->big_joiner_output;
> +	outputs = force_joiner ? data->non_big_joiner_output :
> +		  mixed ? data->mixed_output : data->big_joiner_output;
> +	igt_display_reset(&data->display);
> +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
>   
>   	for (i = 0; i < data->n_pipes - 1; i++) {
> -		igt_display_reset(&data->display);
>   		attempt_mask = BIT(data->pipe_seq[i]);
>   		master_pipe = get_next_master_pipe(data, available_pipe_mask & attempt_mask);
>   
> @@ -215,6 +245,7 @@ static void test_invalid_modeset_two_joiner(data_t *data,
>   			igt_plane_set_fb(primary[j], &fb[j]);
>   		}
>   		ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
> +		igt_display_reset(&data->display);
>   		for (j = 0; j < INVALID_TEST_OUTPUT; j++) {
>   			igt_plane_set_fb(primary[j], NULL);
>   			igt_remove_fb(data->drm_fd, &fb[j]);
> @@ -223,7 +254,7 @@ static void test_invalid_modeset_two_joiner(data_t *data,
>   	}
>   }
>   
> -static void test_big_joiner_on_last_pipe(data_t *data)
> +static void test_joiner_on_last_pipe(data_t *data, bool force_joiner)
>   {
>   	int i, len, ret;
>   	igt_output_t **outputs;
> @@ -232,8 +263,8 @@ static void test_big_joiner_on_last_pipe(data_t *data)
>   	igt_fb_t fb;
>   	drmModeModeInfo *mode;
>   
> -	len = data->big_joiner_output_count;
> -	outputs = data->big_joiner_output;
> +	len = force_joiner ? data->non_big_joiner_output_count : data->big_joiner_output_count;
> +	outputs = force_joiner ? data->non_big_joiner_output : data->big_joiner_output;
>   
>   	for (i = 0; i < len; i++) {
>   		igt_display_reset(&data->display);
> @@ -257,12 +288,14 @@ static void test_big_joiner_on_last_pipe(data_t *data)
>   
>   igt_main
>   {
> +	bool force_joiner_supported;
>   	int i, j;
>   	igt_output_t *output;
>   	drmModeModeInfo mode;
>   	data_t data;
>   
>   	igt_fixture {
> +		force_joiner_supported = false;
>   		data.big_joiner_output_count = 0;
>   		data.non_big_joiner_output_count = 0;
>   		data.mixed_output_count = 0;
> @@ -290,7 +323,10 @@ igt_main
>   				data.big_joiner_output[data.big_joiner_output_count++] = output;
>   				igt_output_override_mode(output, &mode);
>   			} else {
> -				data.non_big_joiner_output[data.non_big_joiner_output_count++] = output;
> +				if (igt_has_force_joiner_debugfs(data.drm_fd, output)) {
> +					force_joiner_supported = true;
> +					data.non_big_joiner_output[data.non_big_joiner_output_count++] = output;
> +				}
>   			}
>   			data.output_count++;
>   		}
> @@ -316,10 +352,10 @@ igt_main
>   			igt_require_f(data.n_pipes > 1,
>   				      "Minimum 2 pipes required\n");
>   			igt_dynamic_f("single-joiner")
> -				test_single_joiner(&data, data.big_joiner_output_count);
> +				test_single_joiner(&data, data.big_joiner_output_count, false);
>   			if (data.big_joiner_output_count > 1)
>   				igt_dynamic_f("multi-joiner")
> -					test_multi_joiner(&data, data.big_joiner_output_count);
> +					test_multi_joiner(&data, data.big_joiner_output_count, false);
>   	}
>   
>   	igt_describe("Verify if the modeset on the adjoining pipe is rejected "
> @@ -329,13 +365,58 @@ igt_main
>   		igt_require_f(data.n_pipes > 1, "Minimum of 2 pipes are required\n");
>   		if (data.big_joiner_output_count >= 1)
>   			igt_dynamic_f("big_joiner_on_last_pipe")
> -				test_big_joiner_on_last_pipe(&data);
> +				test_joiner_on_last_pipe(&data, false);
>   		if (data.big_joiner_output_count > 1)
>   			igt_dynamic_f("invalid_combinations")
> -				test_invalid_modeset_two_joiner(&data, false);
> +				test_invalid_modeset_two_joiner(&data, false, false);
>   		if (data.mixed_output_count)
>   			igt_dynamic_f("mixed_output")
> -				test_invalid_modeset_two_joiner(&data, true);
> +				test_invalid_modeset_two_joiner(&data, true, false);
> +	}
> +
> +	igt_describe("Verify the basic modeset on big joiner mode on all pipes");
> +	igt_subtest_with_dynamic("basic-force-joiner") {
> +		igt_require_f(force_joiner_supported,
> +			      "force joiner not supported on this platform or none of the connected output supports it\n");
> +		igt_require_f(data.non_big_joiner_output_count > 0,
> +			      "No non big joiner output found\n");
> +		igt_require_f(data.n_pipes > 1,
> +			      "Minimum 2 pipes required\n");
> +		igt_dynamic_f("single") {
> +			toggle_force_joiner_on_all_non_big_joiner_outputs(&data, true);
> +			test_single_joiner(&data, data.non_big_joiner_output_count, true);
> +			toggle_force_joiner_on_all_non_big_joiner_outputs(&data, false);
> +		}
> +		if (data.non_big_joiner_output_count > 1) {
> +			igt_dynamic_f("multi") {
> +				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, true);
> +				test_multi_joiner(&data, data.non_big_joiner_output_count, true);
> +				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, false);
> +			}
> +		}
> +	}
> +
> +	igt_subtest_with_dynamic("invalid-modeset-force-joiner") {
> +		igt_require_f(force_joiner_supported,
> +			      "force joiner not supported on this platform or none of the connected output supports it\n");
> +		igt_require_f(data.non_big_joiner_output_count > 0,
> +			      "Non big joiner output not found\n");
> +		igt_require_f(data.n_pipes > 1,
> +			      "Minimum of 2 pipes are required\n");
> +		if (data.non_big_joiner_output_count >= 1) {
> +			igt_dynamic_f("big_joiner_on_last_pipe") {
> +				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, true);
> +				test_joiner_on_last_pipe(&data, true);
> +				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, false);
> +			}
> +		}
> +		if (data.non_big_joiner_output_count > 1) {
> +			igt_dynamic_f("invalid_combinations") {
> +				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, true);
> +				test_invalid_modeset_two_joiner(&data, false, true);
> +				toggle_force_joiner_on_all_non_big_joiner_outputs(&data, false);
> +			}
> +		}
>   	}
>   
>   	igt_fixture {

  reply	other threads:[~2024-04-01  5:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 14:45 [PATCH i-g-t 0/5] revamp big joiner test Kunal Joshi
2024-03-28 14:45 ` [PATCH i-g-t 1/5] lib/igt_kms: move bigjoiner_mode_found to lib Kunal Joshi
2024-03-28 14:45 ` [PATCH i-g-t 2/5] tests/intel/kms_big_joiner: revamp bigjoiner Kunal Joshi
2024-03-28 14:45 ` [PATCH i-g-t 3/5] lib/igt_kms: add helper to enable/disable force joiner Kunal Joshi
2024-03-28 14:45 ` [PATCH i-g-t 4/5] tests/intel/kms_big_joiner: add tests for " Kunal Joshi
2024-04-01  5:16   ` Nautiyal, Ankit K [this message]
2024-03-28 14:45 ` [PATCH i-g-t 5/5] HAX: tests/intel-ci/fast-feedback: do not merge Kunal Joshi
2024-03-28 22:49 ` ✓ Fi.CI.BAT: success for revamp big joiner test (rev11) Patchwork
2024-03-28 23:01 ` ✗ CI.xeBAT: failure " Patchwork
2024-03-29 17:40 ` ✗ Fi.CI.IGT: " Patchwork
2024-04-01  5:17 ` [PATCH i-g-t 0/5] revamp big joiner test Nautiyal, Ankit K
2024-04-01  5:37   ` Joshi, Kunal1

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=93ad9ef2-114a-4932-9c75-68f31af23631@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@intel.com \
    --cc=kunal1.joshi@intel.com \
    --cc=stanislav.lisovskiy@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 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.