[igt-dev] [PATCH i-g-t] igt/kms_addfb_basic: Skip if the KMS interface is not supported

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 13 19:24:48 UTC 2018


Quoting Ville Syrjälä (2018-09-13 20:22:26)
> On Thu, Sep 13, 2018 at 08:09:42PM +0100, Chris Wilson wrote:
> > Some drivers and some hardware do not support KMS and so the addfb
> > ioctls are expected to fail. However, since they are expected to fail
> > with a specific errno (ENOTSUPP) in the case KMS is not supported on the
> > fd, we can check for that and skip the tests where they are not
> > appropriate.
> > 
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > ---
> >  tests/kms_addfb_basic.c | 27 ++++++++++++++++++++++++++-
> >  1 file changed, 26 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
> > index ce48d24fa..400241a92 100644
> > --- a/tests/kms_addfb_basic.c
> > +++ b/tests/kms_addfb_basic.c
> > @@ -667,12 +667,37 @@ static void prop_tests(int fd)
> >  
> >  }
> >  
> > +static bool has_addfb2_iface(int fd)
> > +{
> > +     struct local_drm_mode_fb_cmd2 f = {};
> > +     int err;
> > +
> > +     err = 0;
> > +     if (drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f))
> > +             err = -errno;
> > +     switch (err) {
> > +     case -ENOTTY: /* ioctl unrecognised (kernel too old) */
> > +     case -ENOTSUP: /* driver doesn't support KMS */
> 
> P once or P twice?
> 
> Oh, ENOTSUPP not in uapi headers AFAICS. Is this the same thing even?

No. It wasn't. The danger in testing! I had to send v3 with the
correction as the kernel calls this EOPNOTSUPP, much to POSIX's chagrin.
-Chris


More information about the igt-dev mailing list