[igt-dev] [PATCH v4 1/8] tests/fbdev: Move existing tests into separate subgroups
Thomas Zimmermann
tzimmermann at suse.de
Wed Nov 18 08:27:00 UTC 2020
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.
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()?
>
> 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
More information about the igt-dev
mailing list