All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Maxime Ripard <maxime.ripard@bootlin.com>, igt-dev@lists.freedesktop.org
Cc: eben@raspberrypi.org, Maxime Ripard <maxime.ripard@bootlin.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode
Date: Thu, 09 Aug 2018 14:28:12 -0700	[thread overview]
Message-ID: <87tvo3s00j.fsf@anholt.net> (raw)
In-Reply-To: <cbedc79edb2bcfc1ad2ed89cb86b15bc9088e634.1532596850.git-series.maxime.ripard@bootlin.com>


[-- Attachment #1.1: Type: text/plain, Size: 1740 bytes --]

Maxime Ripard <maxime.ripard@bootlin.com> writes:

> The current code is testing the first mode in the connector list when it's
> testing a single mode. While this is arbitrarily chosen, it makes more
> sense to use the preferred mode reported by the display.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  tests/kms_chamelium.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
> index 490bacc6f5fe..5d7fb83fb74f 100644
> --- a/tests/kms_chamelium.c
> +++ b/tests/kms_chamelium.c
> @@ -534,6 +534,20 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port,
>  	igt_remove_fb(data->drm_fd, &fb);
>  }
>  
> +static drmModeModeInfo *find_preferred_mode(drmModeConnector *connector)
> +{
> +	int i;
> +
> +	for (i = 0; i < connector->count_modes; i++) {
> +		drmModeModeInfo *mode = &connector->modes[i];
> +
> +		if (mode->type & DRM_MODE_TYPE_PREFERRED)
> +			return mode;
> +	}
> +
> +	return NULL;
> +}
> +
>  static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
>  				      int count)
>  {
> @@ -549,7 +563,10 @@ static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
>  	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
>  	igt_assert(primary);
>  
> -	do_test_display_crc(data, port, output, &connector->modes[0], count);
> +	mode = find_preferred_mode(connector);
> +	igt_assert(mode);
> +
> +	do_test_display_crc(data, port, output, mode, count);

Instead of asserting, should we pick the first if there was no
preferred?  I don't really know, so I'd ack the patch either way.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-08-09 21:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 01/13] fb: Add buffer map/unmap functions Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 02/13] fb: convert: Remove swizzle from the arguments Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 03/13] fb: Create common function to convert frame formats Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 04/13] fb: Add format conversion routine Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 05/13] fb: Add support for conversions through pixman Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 06/13] fb: Add more formats Maxime Ripard
2018-08-09 21:25   ` Eric Anholt
2018-07-26 10:42 ` [igt-dev] [PATCH v4 07/13] chamelium: Split CRC test function in two Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode Maxime Ripard
2018-08-09 21:28   ` Eric Anholt [this message]
2018-08-23 11:46     ` Maxime Ripard
2018-08-23 15:17   ` Ville Syrjälä
2018-08-24  7:49     ` Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 09/13] chamelium: Add function to generate our test pattern Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one Maxime Ripard
2018-08-09 21:31   ` Eric Anholt
2018-08-24  7:59     ` Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 11/13] chamelium: Add format support Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 12/13] chamelium: Add format subtests Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 13/13] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
2018-07-27  8:49 ` [igt-dev] ✗ Fi.CI.BAT: failure for chamelium: Test the plane formats (rev3) Patchwork
2018-07-27 11:32 ` Patchwork
2018-07-28 12:42 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2018-07-28 16:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=87tvo3s00j.fsf@anholt.net \
    --to=eric@anholt.net \
    --cc=eben@raspberrypi.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.