Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v5 1/1] tests/intel/kms_joiner: switch modeset between uj and bj
Date: Thu, 7 Nov 2024 10:58:13 +0530	[thread overview]
Message-ID: <0733f802-b411-4826-a50d-38dd1a44e248@intel.com> (raw)
In-Reply-To: <20241022022953.1422653-2-santhosh.reddy.guddati@intel.com>


On 10/22/2024 7:59 AM, Santhosh Reddy Guddati wrote:
> Add a subtest to validate switching from ultra joiner to big joiner
> and vice-versa.
>
> v2: Add new subtests for switching without force joiner (Karthik)
> v3: start with uj to bj switch, if not available switch to force mode
> v4: check for uj, bj support before starting dynamic tests (karthik)
>      call reset_connectors after forcing to uj
> v5: Add a separate function to switch modes and execute test for each
>      connected supported output (karthik)
>
> Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
> ---
>   tests/intel/kms_joiner.c | 94 ++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 94 insertions(+)
>
> diff --git a/tests/intel/kms_joiner.c b/tests/intel/kms_joiner.c
> index 9a353ee1b..88d1567d7 100644
> --- a/tests/intel/kms_joiner.c
> +++ b/tests/intel/kms_joiner.c
> @@ -71,6 +71,9 @@
>    * SUBTEST: invalid-modeset-force-ultra-joiner
>    * Description: Verify if the modeset on the other pipes are rejected when
>    *              the pipe A is active with force ultra joiner modeset.
> + *
> + * SUBTEST: switch-modeset-ultra-joiner-big-joiner
> + * Description: Verify switching between ultra joiner and big joiner modeset.
>    */
>   IGT_TEST_DESCRIPTION("Test joiner / force joiner");
>   
> @@ -161,6 +164,82 @@ static enum pipe setup_pipe(data_t *data, igt_output_t *output, enum pipe pipe,
>   	return master_pipe;
>   }
>   
> +static void set_joiner_mode(data_t *data, igt_output_t *output, drmModeModeInfo *mode)
> +{
> +	igt_plane_t *primary;
> +	igt_fb_t fb;
> +
> +	igt_output_set_pipe(output, PIPE_A);
> +	igt_output_override_mode(output, mode);
> +	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> +	igt_create_pattern_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888,
> +			      DRM_FORMAT_MOD_LINEAR, &fb);
> +	igt_plane_set_fb(primary, &fb);
> +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> +
> +	igt_display_reset(&data->display);
> +	igt_reset_connectors();
> +	igt_plane_set_fb(primary, NULL);
> +	igt_remove_fb(data->drm_fd, &fb);
> +}
> +
> +static void switch_modeset_ultra_joiner_big_joiner(data_t *data, igt_output_t *output)
> +{
> +	drmModeModeInfo bj_mode;
> +	drmModeModeInfo uj_mode;
> +	int status;
> +	bool ultrajoiner_found;
> +	enum pipe pipe;
> +
> +	drmModeConnector *connector = output->config.connector;
> +
> +	igt_display_reset(&data->display);
> +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> +
> +	ultrajoiner_found = ultrajoiner_mode_found(data->drm_fd, connector, max_dotclock, &uj_mode);
> +
> +	if (ultrajoiner_found) {
Hi Santhosh,
> +		uj_mode = *igt_output_get_mode(output);
This is redundant as this is already being populated in the previous 
function. Please remove this.
> +	} else if (data->non_ultra_joiner_output_count > 0) {
> +		status = kmstest_force_connector_joiner(data->drm_fd, output->config.connector,
> +							JOINED_PIPES_ULTRA_JOINER);
> +		igt_assert_f(status, "Failed to toggle force joiner\n");
> +		uj_mode = *igt_output_get_mode(output);
This sequence will lead to test fail whenever we have an output which 
doesn't support either UJ or force UJ. Please use 
"force_joiner_supported && is_dsc_supported_by_sink" check before 
toggling the joiner debugfs.
> +	} else {
> +		igt_skip("No ultra joiner mode found on output %s\n", output->name);
> +	}
> +
> +	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name) {
> +		set_joiner_mode(data, output, &uj_mode);
> +		/* Switch to big joiner mode */
> +		if (bigjoiner_mode_found(data->drm_fd, output->config.connector,
> +					 max_dotclock, &bj_mode)) {
> +			bj_mode = *igt_output_get_mode(output);
> +			igt_output_override_mode(output, &bj_mode);
Same as above.
> +		} else {
> +			status = kmstest_force_connector_joiner(data->drm_fd,
> +								output->config.connector,
> +								JOINED_PIPES_BIG_JOINER);
> +			igt_assert_f(status, "Failed to toggle force joiner\n");
> +			bj_mode = *igt_output_get_mode(output);

Same as above.

Regards,
Karthik.B.S
> +		}
> +
> +		set_joiner_mode(data, output, &bj_mode);
> +
> +		/* Switch back to ultra joiner*/
> +		if (ultrajoiner_found) {
> +			igt_output_override_mode(output, &uj_mode);
> +		} else {
> +			status = kmstest_force_connector_joiner(data->drm_fd,
> +								output->config.connector,
> +								JOINED_PIPES_ULTRA_JOINER);
> +			igt_assert_f(status, "Failed to toggle force joiner\n");
> +		}
> +
> +		set_joiner_mode(data, output, &uj_mode);
> +	}
> +}
> +
>   static void test_single_joiner(data_t *data, int output_count, bool force_joiner)
>   {
>   	int i;
> @@ -592,6 +671,21 @@ igt_main
>   		}
>   	}
>   
> +	igt_describe("Verify modeset switch between ultra joiner and big joiner");
> +	igt_subtest_with_dynamic("switch-modeset-ultra-joiner-big-joiner") {
> +		igt_require_f(ultra_joiner_supported,
> +			      "Ultra joiner not supported on this platform\n");
> +		igt_require_f(data.ultra_joiner_output_count > 0 ||
> +			      data.non_ultra_joiner_output_count > 0,
> +				  "No ultra joiner or force ultra joiner output found\n");
> +		igt_require_f(data.n_pipes > 3,
> +			      "Minimum 4 pipes required\n");
> +
> +		for_each_connected_output(&data.display, output) {
> +			switch_modeset_ultra_joiner_big_joiner(&data, output);
> +		}
> +	}
> +
>   	igt_subtest_with_dynamic("invalid-modeset-force-ultra-joiner") {
>   		igt_require_f(ultra_joiner_supported,
>   			      "Ultra joiner not supported on this platform\n");

  reply	other threads:[~2024-11-07  5:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22  2:29 [PATCH i-g-t v5 0/1] tests/intel/kms_joiner: switch modeset from uj to bj and vice-versa Santhosh Reddy Guddati
2024-10-22  2:29 ` [PATCH i-g-t v5 1/1] tests/intel/kms_joiner: switch modeset between uj and bj Santhosh Reddy Guddati
2024-11-07  5:28   ` Karthik B S [this message]
2024-10-22  4:08 ` ✓ Fi.CI.BAT: success for tests/intel/kms_joiner: switch modeset from uj to bj and vice-versa (rev5) Patchwork
2024-10-22  4:11 ` ✓ CI.xeBAT: " Patchwork
2024-10-22  5:22 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-10-22 10:16 ` ✗ CI.xeFULL: " Patchwork

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=0733f802-b411-4826-a50d-38dd1a44e248@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=santhosh.reddy.guddati@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