[igt-dev] [PATCH v6 2/8] tests/fbdev: Map framebuffer in igt_fixture
Petri Latvala
petri.latvala at intel.com
Mon Nov 23 11:32:02 UTC 2020
On Fri, Nov 20, 2020 at 11:52:11AM +0100, Thomas Zimmermann wrote:
> The mapping of the framebuffer memory will be useful for read/write
> tests. Move it into an igt_fixture block.
>
> v4:
> * declare map as volatile (Petri)
> * test struct fb_fix_screeninfo.smem_len with igt_assert()
> * remove mmap test from CI
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
This commit is not as standalone as one would hope, but it's
standalone enough to not break too much without the rest of the
series...
Reviewed-by: Petri Latvala <petri.latvala at intel.com>
> ---
> tests/fbdev.c | 12 +++++-------
> tests/intel-ci/fast-feedback.testlist | 1 -
> 2 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/tests/fbdev.c b/tests/fbdev.c
> index a803f445..eebd2a83 100644
> --- a/tests/fbdev.c
> +++ b/tests/fbdev.c
> @@ -63,22 +63,20 @@ static void mode_tests(int fd)
> static void framebuffer_tests(int fd)
> {
> struct fb_fix_screeninfo fix_info;
> + void * volatile 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);
> + igt_assert(fix_info.smem_len);
>
> map = mmap(NULL, fix_info.smem_len,
> PROT_WRITE, MAP_SHARED, fd, 0);
> igt_assert(map != MAP_FAILED);
>
> memset(map, 0, fix_info.smem_len);
> + }
> +
> + igt_fixture {
> munmap(map, fix_info.smem_len);
> }
> }
> diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
> index a40410a8..cf66b4da 100644
> --- a/tests/intel-ci/fast-feedback.testlist
> +++ b/tests/intel-ci/fast-feedback.testlist
> @@ -3,7 +3,6 @@
> igt at core_auth@basic-auth
> igt at debugfs_test@read_all_entries
> igt at fbdev@info
> -igt at fbdev@mmap
> igt at gem_basic@bad-close
> igt at gem_basic@create-close
> igt at gem_basic@create-fd-close
> --
> 2.29.2
>
More information about the igt-dev
mailing list