[igt-dev] [PATCH v4 1/8] tests/fbdev: Move existing tests into separate subgroups
Daniel Vetter
daniel.vetter at ffwll.ch
Wed Nov 18 10:36:34 UTC 2020
On Wed, Nov 18, 2020 at 9:27 AM Thomas Zimmermann <tzimmermann at suse.de> wrote:
>
> Hi
>
> Am 17.11.20 um 14:41 schrieb Chris Wilson:
> > Quoting Thomas Zimmermann (2020-11-17 12:52:50)
> >> +static void framebuffer_tests(int fd)
> >> +{
> >> + struct fb_fix_screeninfo fix_info;
> >> +
> >> + igt_fixture {
> >> + igt_require(ioctl(fd, FBIOGET_FSCREENINFO, &fix_info) == 0);
> >
> > igt_info("Testing fbdev: %s\n", fix_info.id);
> >
> > would be a useful addition.
>
> Ok.
>
> >
> >> + }
> >>
> >> + igt_describe("Check mmap operations on framebuffer memory");
> >> igt_subtest("mmap") {
> >> void *map;
> >>
> >> @@ -77,11 +76,39 @@ igt_main
> >>
> >> map = mmap(NULL, fix_info.smem_len,
> >> PROT_WRITE, MAP_SHARED, fd, 0);
> >> - igt_assert(map != MAP_FAILED);
> >> + igt_require(map != MAP_FAILED);
> >
> > Under what conditions do we want to allow a driver to fail to provide
> > mmap()? I haven't spotted anything in uapi/fb.h to indicate what bits of
> > the iface are optional, or other rules userspace needs to follow.
It's fbdev, there's no spec, no rules, no testsuites. We get to make
these, 25 years after it landed :-)
> Fbdev without mmap() is mostly useless for userspace. After all, it's
> the main interface for drawing to the framebuffer.
>
> >
> > igt_skip_on(!fix_info.smem_len)?
>
> What's the difference to igt_assert() rsp igt_require()?
igt_assert will result in a test failure status. igt_require in a test
skip for optional features. E.g. cursor tests skip if there's no
cursor, but if there is a cursor and it fails to show up after a
successful atomic ioctl (as observed through crc checks), then that's
a failure.
Now for this here I think igt_assert is the right thing to do
actually, since smem_len is required for the fbdev mmap uapi. Since
without mmap there's really no point in the fbdev chardev for
userspace.
-Daneil
>
> >
> > If mmap() failing is the only true indicator that its not supported, so
> > be it. In which case is errno significant?
>
> mmap() failing could be anything: drivers, mmap infrastructure, address
> space. I would not invest too much effort in sorting out individual errors.
>
> Best regards
> Thomas
>
> > -Chris
> >
>
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the igt-dev
mailing list