[igt-dev] [PATCH v3 2/8] tests/fbdev: Map framebuffer in igt_fixture
Thomas Zimmermann
tzimmermann at suse.de
Tue Nov 10 07:50:56 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 | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/tests/fbdev.c b/tests/fbdev.c
index 46641fea..fc66210a 100644
--- a/tests/fbdev.c
+++ b/tests/fbdev.c
@@ -63,15 +63,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_describe("Check mmap operations on framebuffer memory");
- igt_subtest("mmap") {
- void *map;
-
igt_require(fix_info.smem_len);
map = mmap(NULL, fix_info.smem_len,
@@ -79,6 +74,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.2
More information about the igt-dev
mailing list