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] [RESEND PATCH v6 i-g-t] tests/kms_flip: Skip VBlank tests in modules without VBlank
Date: Thu, 18 Apr 2019 14:05:18 -0300	[thread overview]
Message-ID: <20190418170518.fsjtvduqvvxrxewg@smtp.gmail.com> (raw)
In-Reply-To: <155560190887.7644.3682179601045366401@skylake-alporthouse-com>


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

On 04/18, Chris Wilson wrote:
> Quoting Rodrigo Siqueira (2019-04-18 15:01:49)
> > +bool kms_has_vblank(int fd)
> > +{
> > +       drmVBlank dummy_vbl;
> > +
> > +       memset(&dummy_vbl, 0, sizeof(drmVBlank));
> > +       dummy_vbl.request.type = DRM_VBLANK_RELATIVE;
> > +
> > +       drmWaitVBlank(fd, &dummy_vbl);
> > +       return (errno != EOPNOTSUPP);
> 
> errno is only set on error. It is conceivably that drmWaitVBlank()
> suceeed but errno is still set to EOPNOTSUPP from an earlier syscall.
> -Chris

Nice catch!

Before I send a V7, how about this fix:

bool kms_has_vblank(int fd)
{
  ...
  errno = 0;
  drmWaitVBlank(fd, &dummy_vbl);
  return (errno != EOPNOTSUPP);
}

--
Rodrigo Siqueira
https://siqueira.tech

[-- 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-04-18 17:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 14:01 [igt-dev] [RESEND PATCH v6 i-g-t] tests/kms_flip: Skip VBlank tests in modules without VBlank Rodrigo Siqueira
2019-04-18 15:24 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_flip: Skip VBlank tests in modules without VBlank (rev4) Patchwork
2019-04-18 15:38 ` [igt-dev] [RESEND PATCH v6 i-g-t] tests/kms_flip: Skip VBlank tests in modules without VBlank Chris Wilson
2019-04-18 17:05   ` Rodrigo Siqueira [this message]
2019-04-18 17:25 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/kms_flip: Skip VBlank tests in modules without VBlank (rev4) 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=20190418170518.fsjtvduqvvxrxewg@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