[igt-dev] [RESEND PATCH v6 i-g-t] tests/kms_flip: Skip VBlank tests in modules without VBlank

Rodrigo Siqueira rodrigosiqueiramelo at gmail.com
Thu Apr 18 17:05:18 UTC 2019


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20190418/98fddcc2/attachment.sig>


More information about the igt-dev mailing list