Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Hersen Wu <hersenxs.wu@amd.com>,
	igt-dev@lists.freedesktop.org, rodrigo.siqueira@amd.com,
	aurabindo.pillai@amd.com, stylon.wang@amd.com,
	hamza.mahfooz@amd.com
Subject: Re: [igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_vrr_range: fix test crash when n_pipes > n_outputs
Date: Tue, 13 Jun 2023 11:22:38 -0600	[thread overview]
Message-ID: <049981b6-e56f-34b9-77c9-e3acfbfec34f@amd.com> (raw)
In-Reply-To: <20230613124647.37529-1-hersenxs.wu@amd.com>

The subject and commit messages imply there are variables "n_pipes" and 
"n_outputs", but there aren't such variables.

Do you mean the test crashes if there are more pipes than outputs?

On 2023-06-13 06:46, Hersen Wu wrote:
> Fix test crash by looping outputs using
> for_each_connected_output(display, output).
> 
> When n_pipes > n_outputs, i >= n_outputs,
> display->outputs[i]->config.connector within
> for_each_pipe(display, i) are invalid.
> Invalid connectors cause test crash.
> 
> Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
> ---
>   tests/amdgpu/amd_vrr_range.c | 20 ++++++--------------
>   1 file changed, 6 insertions(+), 14 deletions(-)
> 
> diff --git a/tests/amdgpu/amd_vrr_range.c b/tests/amdgpu/amd_vrr_range.c
> index 3f8f23e9a..611f41f95 100644
> --- a/tests/amdgpu/amd_vrr_range.c
> +++ b/tests/amdgpu/amd_vrr_range.c
> @@ -258,18 +258,14 @@ static void test_freesync_parsing_base(data_t *data, uint32_t test_flags)
>   	const struct edid *edid;
>   	range_t range, expected_range;
>   	igt_output_t *output;
> -	int i, j, test_conn_cnt = 0;
> +	int j, test_conn_cnt = 0;
> +	igt_display_t *display = &data->display;
>   
>   	test_init(data);
>   
>   	igt_amd_require_hpd(&data->display, data->fd);
>   
> -	for_each_pipe(&data->display, i) {
> -		/* setup the output */
> -		output = data->output[i];
> -		if (!output || !igt_output_is_connected(output))
> -			continue;
> -
> +	for_each_connected_output(display, output) {
>   		/* find a test EDID */
>   		j = find_test_edid_index(output->config.connector->connector_type);
>   
> @@ -335,18 +331,14 @@ static void test_freesync_range_base(data_t *data, uint32_t test_flags)
>   {
>   	range_t range;
>   	igt_output_t *output;
> -	int i, test_conn_cnt = 0;
> +	int test_conn_cnt = 0;
> +	igt_display_t *display = &data->display;
>   
>   	test_init(data);
>   
>   	igt_amd_require_hpd(&data->display, data->fd);
>   
> -	for_each_pipe(&data->display, i) {
> -		/* setup the output */
> -		output = data->output[i];
> -		if (!output || !igt_output_is_connected(output))
> -			continue;
> -
> +	for_each_connected_output(display, output) {
>   		igt_debug_on_f(!has_vrr(output), "Requires output supports VRR\n");
>   
>   		if (!has_vrr(output)) {

  parent reply	other threads:[~2023-06-13 17:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 12:46 [igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_vrr_range: fix test crash when n_pipes > n_outputs Hersen Wu
2023-06-13 13:36 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2023-06-13 14:08 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-06-13 16:27   ` Kamil Konieczny
2023-06-15 13:25     ` Yedireswarapu, SaiX Nandan
2023-06-13 17:22 ` Alex Hung [this message]
2023-06-13 17:53   ` [igt-dev] [PATCH] [i-g-t] " Wu, Hersen
2023-06-13 23:28 ` Alex Hung
2023-06-14 19:21 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/amdgpu/amd_vrr_range: fix test crash when n_pipes > n_outputs (rev2) Patchwork
2023-06-14 21:02 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-06-15 13:01 ` Patchwork
2023-06-15 13:18 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2023-06-15 15:11 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/amdgpu/amd_vrr_range: fix test crash when n_pipes > n_outputs (rev3) Patchwork
2023-06-15 18:26 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-06-15 19:06 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/amdgpu/amd_vrr_range: fix test crash when n_pipes > n_outputs (rev4) Patchwork
2023-06-15 19:39 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-06-16  8:52   ` Kamil Konieczny
2023-06-17  7:05     ` Yedireswarapu, SaiX Nandan
2023-06-16 12:41 ` Patchwork
2023-06-16 13:06 ` Patchwork
2023-06-16 13:40 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/amdgpu/amd_vrr_range: fix test crash when n_pipes > n_outputs (rev3) Patchwork
2023-06-16 13:47 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/amdgpu/amd_vrr_range: fix test crash when n_pipes > n_outputs (rev4) 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=049981b6-e56f-34b9-77c9-e3acfbfec34f@amd.com \
    --to=alex.hung@amd.com \
    --cc=aurabindo.pillai@amd.com \
    --cc=hamza.mahfooz@amd.com \
    --cc=hersenxs.wu@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=rodrigo.siqueira@amd.com \
    --cc=stylon.wang@amd.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