Igt-dev Archive on 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>
Subject: Re: [PATCH i-g-t 2/6] tests/intel/kms_dp_linktrain_fallback: reuse from mst helper lib
Date: Tue, 11 Feb 2025 09:33:14 +0530	[thread overview]
Message-ID: <37b90ff4-afa4-4494-9e37-76054d5780b8@intel.com> (raw)
In-Reply-To: <20250210185606.1327892-3-kunal1.joshi@intel.com>


On 2/11/2025 12:26 AM, Kunal Joshi wrote:
> Start using igt_find_all_mst_output_in_topology from the helper
> instead.
>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> ---
>   tests/intel/kms_dp_linktrain_fallback.c | 28 ++++---------------------
>   tests/meson.build                       |  1 +
>   2 files changed, 5 insertions(+), 24 deletions(-)
>
> diff --git a/tests/intel/kms_dp_linktrain_fallback.c b/tests/intel/kms_dp_linktrain_fallback.c
> index 415005774..95aa7eee4 100644
> --- a/tests/intel/kms_dp_linktrain_fallback.c
> +++ b/tests/intel/kms_dp_linktrain_fallback.c
> @@ -16,6 +16,7 @@
>   #include <sys/types.h>
>   #include "igt_sysfs.h"
>   #include "igt.h"
> +#include "kms_mst_helper.h"
>   
>   /**
>    * SUBTEST: dp-fallback
> @@ -47,28 +48,6 @@ typedef int (*condition_check_fn)(int drm_fd, igt_output_t *output);
>   
>   IGT_TEST_DESCRIPTION("Test link training fallback");
>   
> -static void find_mst_outputs(int drm_fd, data_t *data,
> -			     igt_output_t *output,
> -			     igt_output_t *mst_outputs[],
> -			     int *num_mst_outputs)
> -{
> -	int output_root_id, root_id;
> -	igt_output_t *connector_output;
> -
> -	output_root_id = igt_get_dp_mst_connector_id(output);
> -	/*
> -	 * If output is MST check all other connected output which shares
> -	 * same path and fill mst_outputs and num_mst_outputs
> -	 */
> -	for_each_connected_output(&data->display, connector_output) {
> -		if (!igt_check_output_is_dp_mst(connector_output))
> -			continue;
> -		root_id = igt_get_dp_mst_connector_id(connector_output);
> -		if (((*num_mst_outputs) < IGT_MAX_PIPES) && root_id == output_root_id)
> -			mst_outputs[(*num_mst_outputs)++] = connector_output;
> -	}
> -}
> -

IMO, first make changes to this function in this file to return error 
code and use it in the caller in this function.

In next patch simply move the function (renaming it to 
igt_find_all_mst_output_in_topology) in a new file.

Then it will be easier to verify (using git show --color-moved) that 
only function movement has happened, and there is no change functionally.

Regards,

Ankit

>   static bool setup_mst_outputs(data_t *data, igt_output_t *mst_output[],
>   			      int *output_count)
>   {
> @@ -83,8 +62,9 @@ static bool setup_mst_outputs(data_t *data, igt_output_t *mst_output[],
>   		    traversed_mst_outputs[i] == data->output->config.connector->connector_id)
>   			return false;
>   
> -	find_mst_outputs(data->drm_fd, data, data->output,
> -			 mst_output, output_count);
> +       igt_assert_f(igt_find_all_mst_output_in_topology(data->drm_fd, &data->display, data->output,
> +							mst_output, output_count) == 0,
> +							"Unable to find mst outputs\n");
>   
>   	for (i = 0; i < *output_count; i++) {
>   		output = mst_output[i];
> diff --git a/tests/meson.build b/tests/meson.build
> index 33dffad31..a6f6ad560 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -366,6 +366,7 @@ extra_sources = {
>   	'kms_chamelium_edid': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ],
>   	'kms_chamelium_frames': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ],
>   	'kms_chamelium_hpd': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ],
> +	'kms_dp_linktrain_fallback': [ join_paths ('intel', 'kms_mst_helper.c') ],
>   	'kms_dsc': [ join_paths ('intel', 'kms_dsc_helper.c') ],
>   	'kms_psr2_sf':  [ join_paths ('intel', 'kms_dsc_helper.c') ],
>   }

  reply	other threads:[~2025-02-11  4:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 18:56 [PATCH i-g-t 0/6] add dsc-fallback test Kunal Joshi
2025-02-10 18:56 ` [PATCH i-g-t 1/6] tests/intel/kms_mst_helper: add helper for MST-related functions Kunal Joshi
2025-02-11  3:57   ` Nautiyal, Ankit K
2025-02-11  8:34     ` Kamil Konieczny
2025-02-11 12:44       ` Nautiyal, Ankit K
2025-02-10 18:56 ` [PATCH i-g-t 2/6] tests/intel/kms_dp_linktrain_fallback: reuse from mst helper lib Kunal Joshi
2025-02-11  4:03   ` Nautiyal, Ankit K [this message]
2025-02-10 18:56 ` [PATCH i-g-t 3/6] tests/intel/kms_dp_linktrain_fallback: refactor dp-fallback subtest Kunal Joshi
2025-02-11  5:04   ` Nautiyal, Ankit K
2025-02-10 18:56 ` [PATCH i-g-t 4/6] tests/intel/kms_dp_linktrain_fallback: add dsc-fallback test Kunal Joshi
2025-02-11  5:27   ` Nautiyal, Ankit K
2025-02-10 18:56 ` [PATCH i-g-t 5/6] tests/intel/kms_dp_linktrain_fallback: disable ignore long hpd Kunal Joshi
2025-02-11  5:30   ` Nautiyal, Ankit K
2025-02-10 18:56 ` [PATCH i-g-t 6/6] HAX: Do not merge Kunal Joshi
2025-02-10 23:59 ` ✗ i915.CI.BAT: failure for add dsc-fallback test (rev3) Patchwork
2025-02-11  0:04 ` ✗ Xe.CI.BAT: " Patchwork
2025-02-11 11:15 ` ✗ Xe.CI.Full: " 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=37b90ff4-afa4-4494-9e37-76054d5780b8@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kunal1.joshi@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