intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v3 4/4] chamelium: Dump obtained and reference frames to png on crc error
Date: Mon, 10 Jul 2017 13:31:00 +0300	[thread overview]
Message-ID: <1499682660.1374.5.camel@linux.intel.com> (raw)
In-Reply-To: <1499378273.20388.27.camel@redhat.com>

On Thu, 2017-07-06 at 17:57 -0400, Lyude Paul wrote:
> --snip--
> (also sorry this one took a while to get to, had to do a lot of
> thinking because I never really solved the problems mentioned here
> when
> I tried working on this...)
> 
> On Thu, 2017-07-06 at 16:33 +0300, Paul Kocialkowski wrote:
> > On Thu, 2017-07-06 at 14:31 +0300, Paul Kocialkowski wrote:
> > > > 
> > > > There's lots of potential here for copy pasta to form in the
> > > > future,
> > > > since the API here puts a lot of work on the caller to set
> > > > things
> > > > up
> > > > for frame dumping. IMO, it would be worth it to teach the CRC
> > > > checking
> > > > functions to automatically do frame dumps on mismatch if the CRC
> > > > source
> > > > supports it. This will save us from having to have separate
> > > > frame
> > > > dump
> > > > APIs in the future if we ever end up adding support for other
> > > > kinds
> > > > of
> > > > automated test equipment.
> > > 
> > > I don't think it makes so much sense to do this in the CRC
> > > checking
> > > functions,
> > > just because they are semantically expected to do one thing: CRC
> > > checking, and
> > > doing frame dumps seems like going overboard.
> > > 
> > > On the other hand, I do agree that the dumping and saving part can
> > > and
> > > should be
> > > made common, but maybe as a separate function. So that would be
> > > two
> > > calls for
> > > the tests: one to check the crc and one to dump and save the
> > > frame.
> > 
> > A strong case to support this vision: in VGA frame testing, we have
> > already dumped the frame and don't do CRC checking, yet we also need
> > to
> > save the frames if there is a mismatch.
> > 
> > It would be a shame that the dumping logic becomes part of the CRC
> > functions, since that would mean duplicating that logic for VGA
> > testing
> > (as it's currently done in the version I just sent out).
> 
> That is a good point, but there's some things I think you might want
> to
> consider. Mainly that in a test that passes, we of course don't write
> any framedumps back to the disk since nothing failed. IMO, I would
> -think- that we care a bit more about the performance hit that happens
> on passing tests vs. failing tests, since tests aren't really supposed
> to fail under ideal conditions anyway. Might be better to verify with
> the mupuf and the other people actually running Intel's CI though,
> since I'm not one of them.
> 
> As well, one advantage we do have here from the chamelium end is that
> you can only really be screen grabbing from one port at a time. So you
> could actually just track stuff internally in the igt_chamelium API
> and when a user tries to download a framedump that we've already
> downloaded, we can just hand them back a cached copy of it.

I forgot to answer this point. I think this bring way too much overhead
and is not really necessary anyway. With the solution I proposed in my
previous email on this thread, the two wrapper functions (one for CRC,
one for analogue frame comparison) will either dump the frame for CRC
comparison (because it was never dumped before) or use the provided one
for analogue comparison, so there is no particular need to track what
was or wasn't dumped before.

> > In spite of that, I think having a common function, called from the
> > test
> > itself is probably the best approach here.
> 
> Not sure if I misspoke here but I didn't mean to imply that I'm
> against
> having functions for doing frame dumping exposed to the callers. I had
> already figured there'd probably be situations where just having the
> CRC checking do the frame dumping wouldn't be enough.
> 
> This being said though, your viewpoint does make me realize it might
> not be a great idea to do autoframe dumping in -all- crc checking
> functions necessarily, but also makes me realize that this might even
> be a requirement if we still want to try keeping around
> igt_assert_crc_equal() and not just replace it outright with a
> function
> that doesn't fail the whole test (if we fail the test, there isn't
> really a way we can do a framedump from it afterwards). So I would
> think we can at least exclude igt_check_crc_equal() from doing
> automatic framedumping, but I still think it would be a good idea to
> implement igt_assert_crc_equal().
> 
> As for the what you're talking about, e.g. doing frame dump
> comparisons
> on VGA, I think the solution might be not to make any of the code for
> doing the actual frame comparisons chamelium specific either (except
> maybe for the part where we trim the framebuffer we get so it only
> contains the actual image dump).
> 
> So how about this: let's introduce a generic frame comparison API
> using
> the code you've already written for doing this on VGA with the
> chamelium. Make it part of the igt library, and have it just accept
> normal pixman images and perform fuzzy comparisons between them. In
> doing that, we can introduce a generic dump-frames-on-error API
> through
> there much more easily.
> 
> My big aim here is just to make it so that people using igt don't have
> to do anything to get frame dumping in their tests, it just "works".
> 
> > 
> > > I have also duplicated that logic in upcoming VGA frame testing,
> > > so
> > > there is definitely a need for less duplication.
> > > 
> > > > As well, I like how you removed the redundancy between
> > > > test_display_crc_single() and test_display_crc_multiple().
> > > > However
> > > > since those are somewhat unrelated changes to the code path for
> > > > these
> > > > tests it would be better to have that re-factoring as a separate
> > > > patch
> > > > so as to make it easier for anyone who might need to bisect this
> > > > code
> > > > in the future.
> > > 
> > > Fair enough, it just felt weird to commit two functions that were
> > > nearly the
> > > exact same, but I have no problem with doing this in two separate
> > > patches.
> > > 
> > > > >  
> > > > >  		free(expected_crc);
> > > > >  		free(crc);
> > > > > @@ -644,10 +618,10 @@ igt_main
> > > > >  							edid_
> > > > > i
> > > > > d,
> > > > > alt_edid_id);
> > > > >  
> > > > >  		connector_subtest("dp-crc-single",
> > > > > DisplayPort)
> > > > > -			test_display_crc_single(&data, port);
> > > > > +			test_display_crc(&data, port, 1);
> > > > >  
> > > > >  		connector_subtest("dp-crc-multiple",
> > > > > DisplayPort)
> > > > > -			test_display_crc_multiple(&data,
> > > > > port);
> > > > > +			test_display_crc(&data, port, 3);
> > > > >  	}
> > > > >  
> > > > >  	igt_subtest_group {
> > > > > @@ -698,10 +672,10 @@ igt_main
> > > > >  							edid_
> > > > > i
> > > > > d,
> > > > > alt_edid_id);
> > > > >  
> > > > >  		connector_subtest("hdmi-crc-single", HDMIA)
> > > > > -			test_display_crc_single(&data, port);
> > > > > +			test_display_crc(&data, port, 1);
> > > > >  
> > > > >  		connector_subtest("hdmi-crc-multiple", HDMIA)
> > > > > -			test_display_crc_multiple(&data,
> > > > > port);
> > > > > +			test_display_crc(&data, port, 3);
> > > > >  	}
> > > > >  
> > > > >  	igt_subtest_group {
-- 
Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo, Finland
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-07-10 10:31 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  8:04 [PATCH i-g-t v3 1/4] chamelium: Calculate CRC from framebuffer instead of hardcoding it Paul Kocialkowski
2017-07-05  8:04 ` [PATCH i-g-t v3 2/4] tests/ chamelium: Remove the frame dump tests Paul Kocialkowski
2017-07-05 20:53   ` Lyude Paul
2017-07-06  7:37     ` Martin Peres
2017-07-06 13:29     ` Paul Kocialkowski
2017-07-05  8:04 ` [PATCH i-g-t v3 3/4] lib/igt_chamelium: Add support for dumping chamelium frames to a png Paul Kocialkowski
2017-07-05 21:16   ` Lyude Paul
2017-07-05  8:04 ` [PATCH i-g-t v3 4/4] chamelium: Dump obtained and reference frames to png on crc error Paul Kocialkowski
2017-07-05 21:44   ` Lyude Paul
2017-07-06  7:41     ` Martin Peres
2017-07-06 11:35       ` Paul Kocialkowski
2017-07-06 22:23         ` Lyude Paul
2017-07-10 10:12           ` Paul Kocialkowski
2017-07-06 11:31     ` Paul Kocialkowski
2017-07-06 13:33       ` Paul Kocialkowski
2017-07-06 21:57         ` Lyude Paul
2017-07-10 10:27           ` Paul Kocialkowski
2017-07-11 17:27             ` Lyude Paul
2017-07-10 10:31           ` Paul Kocialkowski [this message]
2017-07-10 10:33             ` Martin Peres
2017-07-10 12:06               ` Paul Kocialkowski
2017-07-10 13:56                 ` Martin Peres
2017-07-10 14:11                   ` Paul Kocialkowski
2017-07-10 16:02                     ` Martin Peres
2017-07-05 20:34 ` [PATCH i-g-t v3 1/4] chamelium: Calculate CRC from framebuffer instead of hardcoding it Lyude Paul
2017-07-05 20:49   ` Lyude Paul
2017-07-06  8:49   ` Paul Kocialkowski
2017-07-06 13:14   ` Paul Kocialkowski
2017-07-06 22:33     ` Lyude Paul
2017-07-12 14:50 ` [PATCH i-g-t v4 0/7] CRC testing with Chamelium improvements Paul Kocialkowski
2017-07-12 14:50   ` [PATCH i-g-t v4 1/7] lib/igt_fb: Export the cairo surface instead of writing to a png Paul Kocialkowski
2017-07-12 14:50   ` [PATCH i-g-t v4 2/7] chamelium: Calculate CRC from framebuffer instead of hardcoding it Paul Kocialkowski
2017-07-17 16:29     ` Lyude Paul
2017-07-19 11:11       ` Paul Kocialkowski
2017-07-12 14:50   ` [PATCH i-g-t v4 3/7] lib/igt_debugfs: Introduce CRC check function, with logic made common Paul Kocialkowski
2017-07-12 14:50   ` [PATCH i-g-t v4 4/7] Introduce common frame dumping configuration and helpers Paul Kocialkowski
2017-07-12 14:50   ` [PATCH i-g-t v4 5/7] lib/igt_debugfs: Add extended helper to format crc to string Paul Kocialkowski
2017-07-12 14:50   ` [PATCH i-g-t v4 6/7] chamelium: Dump captured and reference frames to png on crc error Paul Kocialkowski
2017-07-12 14:50   ` [PATCH i-g-t v4 7/7] tests/chamelium: Merge the crc testing functions into one Paul Kocialkowski
2017-07-12 14:53   ` [PATCH i-g-t v4 0/7] CRC testing with Chamelium improvements Paul Kocialkowski
2017-07-17 17:04   ` Lyude Paul
2017-07-19 13:46 ` [PATCH i-g-t v5 " Paul Kocialkowski
2017-07-19 13:46   ` [PATCH i-g-t v5 1/7] lib/igt_fb: Export the cairo surface instead of writing to a png Paul Kocialkowski
2017-07-19 13:46   ` [PATCH i-g-t v5 2/7] chamelium: Calculate CRC from framebuffer instead of hardcoding it Paul Kocialkowski
2017-07-19 13:46   ` [PATCH i-g-t v5 3/7] lib/igt_debugfs: Introduce CRC check function, with logic made common Paul Kocialkowski
2017-07-19 13:46   ` [PATCH i-g-t v5 4/7] Introduce common frame dumping configuration and helpers Paul Kocialkowski
2017-07-20  7:24     ` Daniel Vetter
2017-07-20 14:14       ` Paul Kocialkowski
2017-07-19 13:46   ` [PATCH i-g-t v5 5/7] lib/igt_debugfs: Add extended helper to format crc to string Paul Kocialkowski
2017-07-19 13:46   ` [PATCH i-g-t v5 6/7] chamelium: Dump captured and reference frames to png on crc error Paul Kocialkowski
2017-07-19 13:46   ` [PATCH i-g-t v5 7/7] tests/chamelium: Merge the crc testing functions into one Paul Kocialkowski
2017-07-19 16:09   ` [PATCH i-g-t v5 0/7] CRC testing with Chamelium improvements Lyude Paul
2017-07-20  9:39   ` Jani Nikula
2017-07-20 11:15     ` Martin Peres
2017-07-20 11:27     ` Paul Kocialkowski
2017-07-20 12:41       ` Daniel Vetter
2017-07-20 12:44         ` Paul Kocialkowski

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=1499682660.1374.5.camel@linux.intel.com \
    --to=paul.kocialkowski@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lyude@redhat.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;
as well as URLs for NNTP newsgroup(s).