public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Louis Chauvet <louis.chauvet@bootlin.com>
To: Jason-JH Lin <jason-jh.lin@mediatek.com>,
	igt-dev@lists.freedesktop.org,
	Karthik B S <karthik.b.s@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Bhanuprakash Modem <bhanuprakash.modem@gmail.com>,
	Fei Shao <fshao@chromium.org>
Cc: Jani <jani.nikula@intel.com>,
	Paul-PL Chen <paul-pl.chen@mediatek.com>,
	Nancy Lin <nancy.lin@mediatek.com>,
	Singo Chang <singo.chang@mediatek.com>,
	Gil Dekel <gildekel@google.com>, Yacoub <markyacoub@chromium.org>,
	Project_Global_Chrome_Upstream_Group@mediatek.com
Subject: Re: [PATCH i-g-t] tests/kms_bw: Skip tests when outputs don't support the mode
Date: Mon, 9 Mar 2026 11:31:51 +0100	[thread overview]
Message-ID: <e4bd5ad3-9d1f-4be3-941e-004fd57233b8@bootlin.com> (raw)
In-Reply-To: <20260225160408.4116524-1-jason-jh.lin@mediatek.com>



On 2/25/26 17:03, Jason-JH Lin wrote:
> The kms_bw test uses hardcoded display timings that may not match
> what connected panels support. This causes test failures when forcing
> unsupported modes on fixed-mode panels like DSI.
> 
> Add output_mode_supported() to check if a mode exists in the
> connector's mode list before using it. Skip outputs that don't
> support the requested mode during buffer creation, CRC collection,
> and cleanup.
> 
> For multi-output tests, proceed if at least one output supports
> the mode. Skip only if all outputs reject it.
> 
> Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
> ---
>   tests/kms_bw.c | 39 +++++++++++++++++++++++++++++++++++----
>   1 file changed, 35 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/kms_bw.c b/tests/kms_bw.c
> index 778900d8c9f1..dc79ccc001f1 100644
> --- a/tests/kms_bw.c
> +++ b/tests/kms_bw.c
> @@ -187,6 +187,35 @@ static void force_output_mode(data_t *d, igt_output_t *output,
>   	igt_output_override_mode(output, mode);
>   }
>   
> +static bool output_mode_supported(igt_output_t *output, const drmModeModeInfo *mode)
> +{
> +	drmModeConnector *connector = output->config.connector;
> +	int i;
> +
> +	/* Virtual/forced sinks support all modes */
> +	if (!igt_output_is_connected(output))
> +		return true;> +	for (i = 0; i < connector->count_modes; i++) {
> +		drmModeModeInfo *conn_mode = &connector->modes[i];
> +
> +		if (conn_mode->hdisplay == mode->hdisplay &&
> +		    conn_mode->vdisplay == mode->vdisplay &&
> +		    conn_mode->vrefresh == mode->vrefresh) {
> +			igt_info("Found matching mode for %dx%d@%dHz on %s\n",
> +				 mode->hdisplay, mode->vdisplay, mode->vrefresh,
> +				 igt_output_name(output));

Hello,

I think this should be a igt_debug, I don't think this is useful to see 
it every time in normal operations.

With or without this:
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>

Thanks,
Louis Chauvet

> +			return true;
> +		}
> +	}
> +
> +	igt_info("Mode %dx%d@%dHz not supported by %s (has %d modes)\n",
> +		 mode->hdisplay, mode->vdisplay, mode->vrefresh,
> +		 igt_output_name(output), connector->count_modes);
> +
> +	return false;
> +}
> +
>   static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo *mode, bool physical) {
>   	igt_display_t *display = &data->display;
>   	igt_output_t *output;
> @@ -194,7 +223,7 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo
>   	igt_crc_t zero, captured[IGT_MAX_PIPES];
>   	int i = 0, num_pipes = 0;
>   	igt_crtc_t *crtc;
> -	int ret;
> +	int ret = -EINVAL;
>   
>   	/* Cannot use igt_display_n_crtcs() due to fused pipes on i915 where they do
>   	 * not give the numver of valid crtcs and always return IGT_MAX_PIPES */
> @@ -211,7 +240,7 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo
>   	/* create buffers */
>   	for (i = 0; i <= pipe; i++) {
>   		output = physical ? data->connected_output[i] : data->output[i];
> -		if (!output) {
> +		if (!output || !output_mode_supported(output, mode)) {
>   			continue;
>   		}
>   
> @@ -228,7 +257,9 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo
>   		igt_plane_set_fb(data->primary[i], &buffer[i]);
>   		igt_info("Assigning pipe %s to output %s with mode %s\n",
>   			 kmstest_pipe_name(i), igt_output_name(output), mode->name);
> +		ret = 0;
>   	}
> +	igt_skip_on_f(ret != 0, "Unsupported mode for all pipes\n");
 >
>   	ret = igt_display_try_commit_atomic(display,
>   					    DRM_MODE_ATOMIC_ALLOW_MODESET |
> @@ -240,7 +271,7 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo
>   
>   	for (i = 0; i <= pipe; i++) {
>   		output = physical ? data->connected_output[i] : data->output[i];
> -		if (!output) {
> +		if (!output || !output_mode_supported(output, mode)) {
>   			continue;
>   		}
>   
> @@ -251,7 +282,7 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo
>   
>   	for (i = pipe; i >= 0; i--) {
>   		output = physical ? data->connected_output[i] : data->output[i];
> -		if (!output)
> +		if (!output || !output_mode_supported(output, mode))
>   			continue;
>   
>   		igt_remove_fb(display->drm_fd, &buffer[i]);


  parent reply	other threads:[~2026-03-09 10:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 16:03 [PATCH i-g-t] tests/kms_bw: Skip tests when outputs don't support the mode Jason-JH Lin
2026-02-26  0:48 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-02-26  1:15 ` ✓ i915.CI.BAT: success " Patchwork
2026-02-26  3:58 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-26  5:40 ` ✗ i915.CI.Full: " Patchwork
2026-03-06  7:44 ` [PATCH i-g-t] " Fei Shao
2026-03-09  3:16   ` Jason-JH Lin (林睿祥)
2026-03-09 10:31 ` Louis Chauvet [this message]
2026-03-10  7:20   ` Jason-JH Lin (林睿祥)

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=e4bd5ad3-9d1f-4be3-941e-004fd57233b8@bootlin.com \
    --to=louis.chauvet@bootlin.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=bhanuprakash.modem@gmail.com \
    --cc=fshao@chromium.org \
    --cc=gildekel@google.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jason-jh.lin@mediatek.com \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=karthik.b.s@intel.com \
    --cc=markyacoub@chromium.org \
    --cc=nancy.lin@mediatek.com \
    --cc=paul-pl.chen@mediatek.com \
    --cc=singo.chang@mediatek.com \
    --cc=swati2.sharma@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