From: Daniel Vetter <daniel@ffwll.ch>
To: Gabriel Feceoru <gabriel.feceoru@intel.com>
Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t] tests/kms_flip: Adjust tolerance when counting frames
Date: Tue, 17 May 2016 09:30:59 +0200 [thread overview]
Message-ID: <20160517073059.GP27098@phenom.ffwll.local> (raw)
In-Reply-To: <5731ED09.7060002@intel.com>
On Tue, May 10, 2016 at 05:15:37PM +0300, Gabriel Feceoru wrote:
>
>
> On 10.05.2016 16:52, Jani Nikula wrote:
> >On Tue, 10 May 2016, Gabriel Feceoru <gabriel.feceoru@intel.com> wrote:
> >>Comparing 2 numbers with 1% accuracy depends on which one is the
> >>reference. If count == 100 and expected == 99 this condition fails,
> >>although it should pass.
> >
> >Well, the expectation should be the reference. If you expect 50 at 50%
> >tolerance, 25..75 is okay. 100 is clearly out of tolerance, but your
> >method would accept it too.
> >
> >Would it help to round the lower limit down and upper limit up? I think
> >that would be more acceptable.
>
> Yes, you are right. I'll adjust it to 98/100 and 102/100.
Maybe also extract the computation for lower/upper limit into local
variables, to make the code less dense and easier to understand.
-Daniel
>
> Thanks,
> Gabriel.
>
> >
> >BR,
> >Jani.
> >
> >>Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
> >>---
> >> tests/kms_flip.c | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >>diff --git a/tests/kms_flip.c b/tests/kms_flip.c
> >>index eda2fcc..938b32d 100644
> >>--- a/tests/kms_flip.c
> >>+++ b/tests/kms_flip.c
> >>@@ -1187,7 +1187,8 @@ static void check_final_state(struct test_output *o, struct event_state *es,
> >>
> >> count *= o->seq_step;
> >> expected = elapsed / frame_time(o);
> >>- igt_assert_f(count >= expected * 99/100 && count <= expected * 101/100,
> >>+ igt_assert_f((count >= expected * 99/100 && count <= expected * 101/100) ||
> >>+ (expected >= count * 99/100 && expected <= count * 101/100),
> >> "dropped frames, expected %d, counted %d, encoder type %d\n",
> >> expected, count, o->kencoder[0]->encoder_type);
> >> }
> >
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-05-17 7:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-10 13:27 [PATCH i-g-t] tests/kms_flip: Adjust tolerance when counting frames Gabriel Feceoru
2016-05-10 13:52 ` Jani Nikula
2016-05-10 14:15 ` Gabriel Feceoru
2016-05-17 7:30 ` Daniel Vetter [this message]
2016-05-17 7:41 ` Chris Wilson
2016-05-10 14:33 ` [PATCH i-g-t v2] " Gabriel Feceoru
2016-05-10 15:39 ` Jani Nikula
2016-05-11 12:35 ` Gabriel Feceoru
2016-05-13 5:45 ` Jani Nikula
2016-05-13 11:45 ` [PATCH i-g-t v3] " Gabriel Feceoru
2016-05-13 12:00 ` Chris Wilson
2016-05-13 12:04 ` Chris Wilson
2016-05-13 12:54 ` Gabriel Feceoru
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=20160517073059.GP27098@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=gabriel.feceoru@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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