From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Luca Coelho <luciano.coelho@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] tests/kms_plane_scaling: get mode only after setting the output pipe
Date: Thu, 16 Jan 2025 14:23:19 +0530 [thread overview]
Message-ID: <cfc096f4-ba74-4cd3-99b8-70f889350e23@intel.com> (raw)
In-Reply-To: <20250110123403.1818011-1-luciano.coelho@intel.com>
Hi Luca,
Patch LGTM.
Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
Please add "Closes" tag with valid gitlab issue# in commit.
On 10-01-2025 06:04 pm, Luca Coelho wrote:
> We find the mode before adding the dynamic intel-max-source-size
> subtests because we don't want to add substests that don't have a
> valid mode. However, during the test itself, the mode info instance
> is not valid anymore, because it is deallocated when setting the
> output pipe.
>
> To solve this, we need to get the mode info _after_ setting the output
> pipe. Avoid passing the mode to intel_max_source_size_test(), pass
> the entire invalid_paramtests struct and let the function find the
> correct mode info again.
>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> tests/kms_plane_scaling.c | 29 ++++++++++++++++++-----------
> 1 file changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
> index 43f578d5553b..4e74f0e107df 100644
> --- a/tests/kms_plane_scaling.c
> +++ b/tests/kms_plane_scaling.c
> @@ -1271,15 +1271,26 @@ static drmModeModeInfo *find_mode(data_t *data, igt_output_t *output, const stru
> * max_dst_h = 8192
> */
> static void intel_max_source_size_test(data_t *d, enum pipe pipe, igt_output_t *output,
> - drmModeModeInfo *mode, const uint32_t planesize[])
> + const struct invalid_paramtests *param)
> {
> igt_fb_t fb;
> igt_plane_t *plane;
> int rval;
> + drmModeModeInfo *mode = NULL;
>
> cleanup_crtc(d);
>
> igt_output_set_pipe(output, pipe);
> +
> + /*
> + * Need to get the mode again, because it may have changed
> + * after setting the pipe.
> + */
> + mode = find_mode(d, output, param);
> + igt_assert(mode);
> + if (!mode)
> + return;
> +
> igt_output_override_mode(output, mode);
> plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
>
> @@ -1290,7 +1301,7 @@ static void intel_max_source_size_test(data_t *d, enum pipe pipe, igt_output_t *
>
> igt_plane_set_position(plane, 0, 0);
> igt_plane_set_fb(plane, &fb);
> - igt_plane_set_size(plane, planesize[0], planesize[1]);
> + igt_plane_set_size(plane, param->planesize[0], param->planesize[1]);
>
> rval = igt_display_try_commit2(&d->display, COMMIT_ATOMIC);
>
> @@ -1563,27 +1574,23 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
> igt_require_intel(data.drm_fd);
> for_each_pipe(&data.display, pipe) {
> for_each_valid_output_on_pipe(&data.display, pipe, output) {
> - drmModeModeInfo *mode = NULL;
> -
> if (get_num_scalers(&data.display, pipe) < 1)
> continue;
> /*
> * Need to find mode with lowest vrefresh else
> * we can exceed cdclk limits.
> */
> - mode = find_mode(&data, output, &intel_paramtests[index]);
> - if (mode) {
> + if (find_mode(&data, output, &intel_paramtests[index]))
> igt_dynamic_f("pipe-%s-%s",
> - kmstest_pipe_name(pipe), igt_output_name(output))
> - intel_max_source_size_test(&data, pipe, output, mode,
> - intel_paramtests[index].planesize);
> - } else {
> + kmstest_pipe_name(pipe), igt_output_name(output))
> + intel_max_source_size_test(&data, pipe, output,
> + &intel_paramtests[index]);
> + else
> igt_info("Unable to find the lowest " \
> "refresh rate mode on output " \
> "%s pipe %s\n",
> igt_output_name(output),
> kmstest_pipe_name(pipe));
> - }
> continue;
> }
> break;
prev parent reply other threads:[~2025-01-16 8:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 12:34 [PATCH i-g-t] tests/kms_plane_scaling: get mode only after setting the output pipe Luca Coelho
2025-01-10 13:38 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-01-10 13:48 ` ✓ i915.CI.BAT: " Patchwork
2025-01-13 5:46 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-13 12:17 ` Luca Coelho
2025-01-16 4:49 ` Ravali, JupallyX
2025-01-14 16:32 ` ✗ i915.CI.Full: " Patchwork
2025-01-15 18:59 ` ✓ i915.CI.Full: success " Patchwork
2025-01-16 8:53 ` Sharma, Swati2 [this message]
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=cfc096f4-ba74-4cd3-99b8-70f889350e23@intel.com \
--to=swati2.sharma@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=luciano.coelho@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