Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: George Zhang <george.zhang@amd.com>, igt-dev@lists.freedesktop.org
Cc: Fangzhi Zuo <jerry.zuo@amd.com>,
	Ivan Lipski <ivan.lipski@amd.com>,
	Harry Wentland <harry.wentland@amd.com>
Subject: Re: [i-g-t 2/2] tests/amdgpu/amd_dp_dsc: Reset link settings after subtest
Date: Thu, 3 Sep 2026 12:39:11 -0600	[thread overview]
Message-ID: <3bff8685-3441-42a3-8586-4d6cc096a1c0@amd.com> (raw)
In-Reply-To: <20260902155742.990457-2-george.zhang@amd.com>



On 9/2/26 09:57, George Zhang wrote:
> Currently, the link settings persist after the link settings subtest,
> and can retain a lowered link rate/lane count going into subsequent subtests.
> 
> Fix it by resetting the link settings on an igt_fixture after running
> the dsc_link_settings subtest. We can do so by setting it to lane count
> and link rate unknown and letting the driver set it to the default values.
> 
> Signed-off-by: George Zhang <george.zhang@amd.com>
> ---
>   tests/amdgpu/amd_dp_dsc.c | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
> 
> diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c
> index ccaf64c66..a5668a31a 100644
> --- a/tests/amdgpu/amd_dp_dsc.c
> +++ b/tests/amdgpu/amd_dp_dsc.c
> @@ -351,6 +351,25 @@ static void test_dsc_slice_dimensions_change(data_t *data)
>   	igt_skip_on(test_conn_cnt == 0);
>   }
> 
> +static void reset_link_settings(data_t *data)
> +{
> +      igt_output_t *output;
> +      igt_crtc_t *crtc;
> +
> +      if (!data)
> +              return;
data is an array so this null check is redundant.

> +
> +      for_each_crtc(&data->display, crtc) {
> +              output = data->output[crtc->crtc_index];
> +              if (!output || !igt_output_is_connected(output) ||
> +                  !is_dsc_capable(&data->mode[crtc->crtc_index]))
Not directly related to this patch, but the above conditions repeat 
multiple times so it may make sense to refactor them to a function.

> +                      continue;
Let's add a new line here.
> +              igt_amd_write_link_settings(data->fd, output->name,
> +                                          LANE_COUNT_UNKNOWN, LINK_RATE_UNKNOWN,
> +                                          LINK_TRAINING_DEFAULT);
> +      }
> +}

Use tabs instead of spaces for indentation in reset_link_settings().

> +
>   static void test_dsc_link_settings(data_t *data)
>   {
>   	igt_output_t *output;
> @@ -604,6 +623,9 @@ int igt_main() {
>   	igt_subtest("dsc-link-settings")
>   	    test_dsc_link_settings(&data);
> 
> +	igt_fixture()
> +		reset_link_settings(&data);
> +
>   	igt_describe("Tests different bpc settings and logs if DSC is enabled/disabled");
>   	igt_subtest("dsc-bpc")
>   	    test_dsc_bpc(&data);
> --
> 2.55.0


  reply	other threads:[~2026-09-03 18:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 15:57 [i-g-t 1/2] tests/amdgpu/amd_dp_dsc: Do not disable DSC for high bw panels George Zhang
2026-09-02 15:57 ` [i-g-t 2/2] tests/amdgpu/amd_dp_dsc: Reset link settings after subtest George Zhang
2026-09-03 18:39   ` Alex Hung [this message]
2026-09-02 22:53 ` ✓ i915.CI.BAT: success for series starting with [i-g-t,1/2] tests/amdgpu/amd_dp_dsc: Do not disable DSC for high bw panels Patchwork
2026-09-02 22:59 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-03 14:55 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-03 18:29 ` [i-g-t 1/2] " Alex Hung
2026-09-03 19:17   ` George Zhang
2026-09-03 19:12 ` ✓ i915.CI.Full: success for series starting with [i-g-t,1/2] " 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=3bff8685-3441-42a3-8586-4d6cc096a1c0@amd.com \
    --to=alex.hung@amd.com \
    --cc=george.zhang@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ivan.lipski@amd.com \
    --cc=jerry.zuo@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