Re: [PATCH i-g-t v4 02/10] tests/imagination: Add GEM mmap tests
Kamil Konieczny <[email protected]> Mon, 27 Jul 2026 20:15:40 +0200
| Newsgroups | org.freedesktop.lists.igt-dev |
|---|---|
| Message-ID | <[email protected]> |
Hi Robert, On 2026-07-27 at 14:00:31 +0200, Robert Mazur wrote: > From: Matt Coster <[email protected]> > > Add subtests for mmap operations on GEM buffer objects. > There was a problem with fdo mailsever and not all patches got to patchwork, please resend a complete series with RESEND after PATCH word (or send it again with v5, your choice). Regards, Kamil > Signed-off-by: Matt Coster <[email protected]> > Signed-off-by: Robert Mazur <[email protected]> > Acked-by: Kamil Konieczny <[email protected]> > --- > tests/imagination/pvr_gem.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/tests/imagination/pvr_gem.c b/tests/imagination/pvr_gem.c > index 273f4d56f..74bfd4eee 100644 > --- a/tests/imagination/pvr_gem.c > +++ b/tests/imagination/pvr_gem.c > @@ -59,6 +59,50 @@ int igt_main() > do_ioctl_err(fd, DRM_IOCTL_PVR_CREATE_BO, &arg, EINVAL); > } > > + igt_describe("Test valid buffer object mapping"); > + igt_subtest("mmap-bo-4096") > + { > + size_t size = 4096; > + uint32_t handle = igt_pvr_ioctl_create_bo(fd, &size); > + > + off_t offset = igt_pvr_ioctl_get_bo_mmap_offset(fd, handle); > + > + char *mapped = mmap(NULL, size, PROT_WRITE, MAP_SHARED, > + fd, offset); > + igt_assert(mapped != MAP_FAILED); > + > + /* Test writing to beginning and end of mapped range. */ > + mapped[0] = 0xff; > + mapped[size - 1] = 0xff; > + > + munmap(mapped, size); > + gem_close(fd, handle); > + } > + > + igt_describe("Test buffer object mapping with bad handle"); > + igt_subtest("mmap-bo-bad-handle") > + { > + struct drm_pvr_ioctl_get_bo_mmap_offset_args arg = { > + .handle = 0xbad6bad6, > + }; > + > + do_ioctl_err(fd, DRM_IOCTL_PVR_GET_BO_MMAP_OFFSET, &arg, ENOENT); > + } > + > + igt_describe("Test buffer object mapping with bad padding"); > + igt_subtest("mmap-bo-bad-padding") > + { > + size_t size = 4096; > + uint32_t handle = igt_pvr_ioctl_create_bo(fd, &size); > + > + struct drm_pvr_ioctl_get_bo_mmap_offset_args arg = { > + .handle = handle, > + ._padding_4 = 0xbad6bad6, > + }; > + > + do_ioctl_err(fd, DRM_IOCTL_PVR_GET_BO_MMAP_OFFSET, &arg, EINVAL); > + } > + > igt_fixture() > { > drm_close_driver(fd); > > -- > 2.43.0 >