public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: "Lofstedt, Marta" <marta.lofstedt@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v2] tests/kms_plane_multiple: Fix reference CRC
Date: Thu, 03 Aug 2017 10:26:37 +0300	[thread overview]
Message-ID: <1501745197.16922.30.camel@intel.com> (raw)
In-Reply-To: <CA5F6A4B62957246A95956419746064382A32695@IRSMSX106.ger.corp.intel.com>

On Thu, 2017-08-03 at 10:11 +0300, Lofstedt, Marta wrote:
> Before merge, please add:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101907
> 
> Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
> 
OK. I'll update the commit message.

Cheers,
Mika

> > 
> > -----Original Message-----
> > From: Kahola, Mika
> > Sent: Thursday, August 3, 2017 9:54 AM
> > To: intel-gfx@lists.freedesktop.org
> > Cc: daniel@ffwll.ch; Latvala, Petri <petri.latvala@intel.com>;
> > Lofstedt, Marta
> > <marta.lofstedt@intel.com>
> > Subject: [PATCH i-g-t v2] tests/kms_plane_multiple: Fix reference
> > CRC
> > 
> > kms_plane_multiple wrongly expected that igt lib function would
> > modify the
> > passed igt_crc_t* object. You should use igt_crc_t** instead. This
> > patch fixes
> > this anomaly in the test.
> > 
> > While at it, remove unnecesary struct for test data as we only need
> > reference CRC here.
> > 
> > The problem was caught by CI system and at least affects on HSW
> > platform.
> > 
> > V2: Don't change function that collects CRC for reference CRC
> >     Fix CRC pointers
> >     Remove unnecessary struct for holding test data
> > 
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > ---
> >  tests/kms_plane_multiple.c | 25 +++++++++----------------
> >  1 file changed, 9 insertions(+), 16 deletions(-)
> > 
> > diff --git a/tests/kms_plane_multiple.c
> > b/tests/kms_plane_multiple.c index
> > f6c6223..4bc26b7 100644
> > --- a/tests/kms_plane_multiple.c
> > +++ b/tests/kms_plane_multiple.c
> > @@ -51,11 +51,6 @@ typedef struct {
> >  	struct igt_fb *fb;
> >  } data_t;
> > 
> > -typedef struct {
> > -	data_t *data;
> > -	igt_crc_t reference_crc;
> > -} test_position_t;
> > -
> >  /* Command line parameters. */
> >  struct {
> >  	int iterations;
> > @@ -106,7 +101,7 @@ static void test_fini(data_t *data,
> > igt_output_t
> > *output, int n_planes)
> > 
> >  static void
> >  test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe,
> > bool
> > atomic,
> > -	      color_t *color, uint64_t tiling, igt_crc_t *crc /*
> > out */)
> > +	      color_t *color, uint64_t tiling, igt_crc_t **crc /*
> > out */)
> >  {
> >  	drmModeModeInfo *mode;
> >  	igt_plane_t *primary;
> > @@ -132,7 +127,7 @@ test_grab_crc(data_t *data, igt_output_t
> > *output,
> > enum pipe pipe, bool atomic,
> >  	igt_skip_on(ret != 0);
> > 
> >  	igt_pipe_crc_start(data->pipe_crc);
> > -	n = igt_pipe_crc_get_crcs(data->pipe_crc, 1, &crc);
> > +	n = igt_pipe_crc_get_crcs(data->pipe_crc, 1, crc);
> >  	igt_assert_eq(n, 1);
> >  }
> > 
> > @@ -251,8 +246,8 @@ test_atomic_plane_position_with_output(data_t
> > *data, enum pipe pipe,  {
> >  	char buf[256];
> >  	struct drm_event *e = (void *)buf;
> > -	test_position_t test = { .data = data };
> >  	color_t blue  = { 0.0f, 0.0f, 1.0f };
> > +	igt_crc_t *ref = NULL;
> >  	igt_crc_t *crc = NULL;
> >  	unsigned int vblank_start, vblank_stop;
> >  	int i, n, ret;
> > @@ -275,8 +270,7 @@ test_atomic_plane_position_with_output(data_t
> > *data, enum pipe pipe,
> > 
> >  	test_init(data, pipe, n_planes);
> > 
> > -	test_grab_crc(data, output, pipe, true, &blue, tiling,
> > -		      &test.reference_crc);
> > +	test_grab_crc(data, output, pipe, true, &blue, tiling,
> > &ref);
> > 
> >  	i = 0;
> >  	while (i < iterations || loop_forever) { @@ -303,7 +297,7
> > @@
> > test_atomic_plane_position_with_output(data_t *data, enum pipe
> > pipe,
> >  		igt_assert(vblank_stop - vblank_start <=
> > MAX_CRCS);
> >  		igt_assert_eq(n, vblank_stop - vblank_start);
> > 
> > -		igt_assert_crc_equal(&test.reference_crc, crc);
> > +		igt_assert_crc_equal(ref, crc);
> > 
> >  		i++;
> >  	}
> > @@ -318,9 +312,9 @@ test_legacy_plane_position_with_output(data_t
> > *data, enum pipe pipe,
> >  				       igt_output_t
> > *output, int n_planes,
> >  				       uint64_t tiling)
> >  {
> > -	test_position_t test = { .data = data };
> >  	color_t blue  = { 0.0f, 0.0f, 1.0f };
> > -	igt_crc_t *crc;
> > +	igt_crc_t *ref = NULL;
> > +	igt_crc_t *crc = NULL;
> >  	int i, n;
> >  	int iterations = opt.iterations < 1 ? 1 : opt.iterations;
> >  	bool loop_forever;
> > @@ -341,8 +335,7 @@ test_legacy_plane_position_with_output(data_t
> > *data, enum pipe pipe,
> > 
> >  	test_init(data, pipe, n_planes);
> > 
> > -	test_grab_crc(data, output, pipe, false, &blue, tiling,
> > -		      &test.reference_crc);
> > +	test_grab_crc(data, output, pipe, false, &blue, tiling,
> > &ref);
> > 
> >  	i = 0;
> >  	while (i < iterations || loop_forever) { @@ -354,7 +347,7
> > @@
> > test_legacy_plane_position_with_output(data_t *data, enum pipe
> > pipe,
> > 
> >  		igt_assert_eq(n, MAX_CRCS);
> > 
> > -		igt_assert_crc_equal(&test.reference_crc, crc);
> > +		igt_assert_crc_equal(ref, crc);
> > 
> >  		i++;
> >  	}
> > --
> > 2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2017-08-03  7:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03  6:54 [PATCH i-g-t v2] tests/kms_plane_multiple: Fix reference CRC Mika Kahola
2017-08-03  7:11 ` Lofstedt, Marta
2017-08-03  7:26   ` Mika Kahola [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=1501745197.16922.30.camel@intel.com \
    --to=mika.kahola@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=marta.lofstedt@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