[igt-dev] [RFC PATCH i-g-t v2] tests/gem_userptr_blits: Enhance invalid mapping exercise

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Thu Feb 20 12:36:20 UTC 2020


Hi Chris,

On Tuesday, February 11, 2020 5:44:59 PM CET Chris Wilson wrote:
> Quoting Janusz Krzysztofik (2020-02-11 14:30:48)
> > @@ -2009,8 +2016,31 @@ igt_main_args("c:", NULL, help_str, opt_handler, 
NULL)
> >                 igt_subtest("invalid-null-pointer")
> >                         test_invalid_null_pointer(fd);
> >  
> > -               igt_subtest("invalid-gtt-mapping")
> > -                       test_invalid_gtt_mapping(fd);
> > +               igt_describe("Verify userptr on top of GTT mapping to GEM 
object will fail");
> > +               igt_subtest("invalid-gtt-mapping") {
> > +                       gem_require_mappable_ggtt(fd);
> > +                       test_invalid_mapping(fd, I915_MMAP_OFFSET_GTT);
> > +               }
> 
> #include "i915/gem_mman.h"
> igt_subtest_with_dynamic("invalid-mmap-offset") {
> 	for_each_mmap_offset_type(t) {
> 		igt_dynamic_f("%s", t->name)
> 			test_invalid_mapping(fd, t);
> 
> In test_invalid_mapping, instead of do_ioctl(MMAP_OFFSET) use
> igt_require(igt_ioctl(MMAP_OFFSET, &arg) == 0);

Inspired by Michał, I've revisited this construct and now I think a confusing 
side effect of it may be expected.  When run on a driver with no mmap-offset 
support, igt_ioctl(MMAP_OFFSET, &arg) would succeed for each t->type and the 
test would claim success for every mapping type.

Something like this should help:

	if (t->type != I915_MMAP_OFFSET_GTT)
		igt_require(gem_has_mmap_offset(fd);

If my finding occurs correct, I'll update my patches and resubmit.

Thanks,
Janusz


> 
> (Or igt_require_f if you like to keep the spiel.)
> 
> 		}
> 	}
> }
> 






More information about the igt-dev mailing list