[igt-dev] [PATCH v2 2/8] tests/fbdev: Map framebuffer in igt_fixture
Thomas Zimmermann
tzimmermann at suse.de
Fri Nov 6 08:29:49 UTC 2020
The mapping of the framebuffer memory will be useful for read/write
tests. Move it into an igt_fixture block.
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
---
tests/fbdev.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/tests/fbdev.c b/tests/fbdev.c
index b61e1cea..078aa880 100644
--- a/tests/fbdev.c
+++ b/tests/fbdev.c
@@ -64,16 +64,10 @@ static void mode_tests(int fd)
static void framebuffer_tests(int fd)
{
struct fb_fix_screeninfo fix_info;
+ void *map;
igt_fixture {
igt_require(ioctl(fd, FBIOGET_FSCREENINFO, &fix_info) == 0);
- }
-
- igt_subtest("mmap") {
- void *map;
-
- igt_describe("Check mmap operations on framebuffer memory");
-
igt_require(fix_info.smem_len);
map = mmap(NULL, fix_info.smem_len,
@@ -81,6 +75,9 @@ static void framebuffer_tests(int fd)
igt_assert(map != MAP_FAILED);
memset(map, 0, fix_info.smem_len);
+ }
+
+ igt_fixture {
munmap(map, fix_info.smem_len);
}
}
--
2.29.0
More information about the igt-dev
mailing list