public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ser, Simon" <simon.ser@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_plane: Make sure the crcs aren't all equal
Date: Wed, 12 Jun 2019 15:38:11 +0000	[thread overview]
Message-ID: <1dc299ce6ef717e6938b3a018c8cf453ab0803be.camel@intel.com> (raw)
In-Reply-To: <20190502200648.14693-1-ville.syrjala@linux.intel.com>

On Thu, 2019-05-02 at 23:06 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Make sure there is at least one unique crc among the set of
> reference crcs. This avoids the test succeeding when the plane
> is never even on, as happened with SDR planes on icl after
> I fumbled switchhing the pipe HDR and non-HDR modes.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

This patch LGTM.

Reviewed-by: SImon Ser <simon.ser@intel.com>

> ---
>  tests/kms_plane.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 471bcbeb8f77..29a768d7830c 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -448,6 +448,25 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
>  	igt_remove_fb(data->drm_fd, &old_fb);
>  }
>  
> +static int num_unique_crcs(const igt_crc_t crc[], int num_crc)
> +{
> +	int num_unique_crc = 0;
> +
> +	for (int i = 0; i < num_crc; i++) {
> +		int j;
> +
> +		for (j = i + 1; j < num_crc; j++) {
> +			if (igt_check_crc_equal(&crc[i], &crc[j]))
> +				break;
> +		}
> +
> +		if (j == num_crc)
> +			num_unique_crc++;
> +	}
> +
> +	return num_unique_crc;
> +}
> +
>  static bool test_format_plane(data_t *data, enum pipe pipe,
>  			      igt_output_t *output, igt_plane_t *plane)
>  {
> @@ -520,6 +539,13 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>  					i, &ref_crc[i], &fb);
>  	}
>  
> +	/*
> +	 * Make sure we have some difference between the colors. This
> +	 * at least avoids claiming success when everything is just
> +	 * black all the time (eg. if the plane is never even on).
> +	 */
> +	igt_require(num_unique_crcs(ref_crc, ARRAY_SIZE(colors)) > 1);
> +
>  	for (int i = 0; i < plane->format_mod_count; i++) {
>  		int crc_mismatch_count = 0;
>  		int crc_mismatch_mask = 0;
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      parent reply	other threads:[~2019-06-12 15:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 20:06 [igt-dev] [PATCH i-g-t] tests/kms_plane: Make sure the crcs aren't all equal Ville Syrjala
2019-05-02 21:56 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-05-03  3:25 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-06-03 15:15 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_plane: Make sure the crcs aren't all equal (rev2) Patchwork
2019-06-04  0:18 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-06-12 15:16   ` Ville Syrjälä
2019-06-12 15:38 ` Ser, Simon [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=1dc299ce6ef717e6938b3a018c8cf453ab0803be.camel@intel.com \
    --to=simon.ser@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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