public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>,
	intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH V5 i-g-t] tests/kms_flip: Skip VBlank tests in modules without VBlank
Date: Mon, 18 Mar 2019 19:06:26 -0300	[thread overview]
Message-ID: <20190318220626.yaefplg7mqceosgr@smtp.gmail.com> (raw)
In-Reply-To: <155294615572.12148.16005320347932444344@skylake-alporthouse-com>


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

On 03/18, Chris Wilson wrote:
> Quoting Rodrigo Siqueira (2019-03-18 21:53:42)
> > On 03/18, Chris Wilson wrote:
> > > Quoting Rodrigo Siqueira (2019-03-18 21:35:44)
> > > > On 03/18, Ville Syrjälä wrote:
> > > > > On Sat, Mar 16, 2019 at 11:00:23AM -0300, Rodrigo Siqueira wrote:
> > > > > > The kms_flip test relies on VBlank support, and this situation may
> > > > > > exclude some virtual drivers to take advantage of this set of tests.
> > > > > > This commit adds a mechanism that checks if a module has VBlank. If the
> > > > > > target module has VBlank support, kms_flip will run all the VBlank
> > > > > > tests; otherwise, the VBlank tests will be skipped. Additionally, this
> > > > > > commit improves the test coverage by checks if the function
> > > > > > drmWaitVBlank() returns EOPNOTSUPP (i.e., no VBlank support).
> > > > > > 
> > > > > > V4: Replace DRM_VBLANK_ABSOLUTE by DRM_VBLANK_RELATIVE and
> > > > > > DRM_VBLANK_NEXTONMISS
> > > > > > 
> > > > > > V3: Add documentation (Daniel Vetter)
> > > > > > 
> > > > > > V2: Add new branch coverage to check if VBlank is enabled or not and
> > > > > > update commit message
> > > > > > 
> > > > > > V1: Chris Wilson
> > > > > >   - Change function name from igt_there_is_vblank to kms_has_vblank
> > > > > >   - Move vblank function check from igt_aux to igt_kms
> > > > > >   - Utilizes memset in dummy_vbl variable
> > > > > >   - Directly return the result of drmWaitVBlank()
> > > > > > 
> > > > > > Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > > > > > ---
> > > > > >  lib/igt_kms.c    | 20 ++++++++++++++++++++
> > > > > >  lib/igt_kms.h    |  2 ++
> > > > > >  tests/kms_flip.c | 22 ++++++++++++++++++++++
> > > > > >  3 files changed, 44 insertions(+)
> > > > > > 
> > > > > > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > > > > > index e1eacc1e..1d2d7188 100644
> > > > > > --- a/lib/igt_kms.c
> > > > > > +++ b/lib/igt_kms.c
> > > > > > @@ -1655,6 +1655,26 @@ void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility)
> > > > > >     igt_assert_eq(visible, visibility);
> > > > > >  }
> > > > > >  
> > > > > > +/**
> > > > > > + * kms_has_vblank:
> > > > > > + * @fd: DRM fd
> > > > > > + *
> > > > > > + * Get the VBlank errno after an attempt to call drmWaitVBlank(). This
> > > > > > + * function is useful for checking if a driver has support or not for VBlank.
> > > > > > + *
> > > > > > + * Returns: true if target driver has VBlank support, otherwise return false.
> > > > > > + */
> > > > > > +bool kms_has_vblank(int fd)
> > > > > > +{
> > > > > > +   drmVBlank dummy_vbl;
> > > > > > +
> > > > > > +   memset(&dummy_vbl, 0, sizeof(drmVBlank));
> > > > > > +   dummy_vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_NEXTONMISS;
> > > > > 
> > > > > Why the NEXTONMISS?
> > > > 
> > > > I added this flag because I was suspecting that in case of any problem
> > > > during the kms_has_vblank() execution the flag NEXTONMISS will wait for
> > > > the next VBlank and avoid to generate problems in the subsequent tests.
> > > 
> > > That is true, and a valid use for using NEXTONMISS if you want to align
> > > your code to the start of a vblank to avoid overrunning into the next
> > > vblank.
> > > 
> > > However, that is not the purpose of kms_has_vblank()! Whose only purpose
> > > is answer the question of whether the device has vblank support, and so
> > > should be as quick and simple as possible, so the trivial query of the
> > > current vblank counter.
> > 
> > Nice! Thanks for your answer.
> > 
> > So, I suppose that use DRM_VBLANK_RELATIVE is enough for this case,
> > right?
> 
> Yes, that should return immediately both on success and on failure.
> -Chris

Thanks! I will prepare a v6 tomorrow

-- 
Rodrigo Siqueira
https://siqueira.tech
Graduate Student
Department of Computer Science
University of São Paulo

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

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

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

  reply	other threads:[~2019-03-18 22:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-16 14:00 [igt-dev] [PATCH V5 i-g-t] tests/kms_flip: Skip VBlank tests in modules without VBlank Rodrigo Siqueira
2019-03-18 11:32 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_flip: Skip VBlank tests in modules without VBlank (rev2) Patchwork
2019-03-18 14:01 ` [igt-dev] [PATCH V5 i-g-t] tests/kms_flip: Skip VBlank tests in modules without VBlank Ville Syrjälä
2019-03-18 21:35   ` Rodrigo Siqueira
2019-03-18 21:38     ` Chris Wilson
2019-03-18 21:53       ` Rodrigo Siqueira
2019-03-18 21:56         ` Chris Wilson
2019-03-18 22:06           ` Rodrigo Siqueira [this message]
2019-03-18 14:39 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/kms_flip: Skip VBlank tests in modules without VBlank (rev2) 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=20190318220626.yaefplg7mqceosgr@smtp.gmail.com \
    --to=rodrigosiqueiramelo@gmail.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=petri.latvala@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