[igt-dev] [PATCH i-g-t v4 4/4] tests/i915/gem_mmap_offset: Add new API test for gem_mmap_offset

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Fri Nov 22 08:27:55 UTC 2019


On Fri, Nov 22, 2019 at 08:07:15AM +0000, Chris Wilson wrote:
> Quoting Zbigniew Kempczyński (2019-11-22 07:48:46)
 > +}
> > +
> > +static void
> > +mmap_offset_bad_object(int fd, struct local_i915_query_memory_region_info *regions)
> > +{
> > +       const char *region_name;
> > +       struct local_i915_memory_region_info *mem_region;
> > +       uint32_t region, obj_size, batch_size, real_handle;
> > +       uint32_t handles[20];
> > +
> > +       for_each_memory_region(regions, mem_region) {
> > +               int i = 0;
> > +
> > +               region = mem_region->id;
> > +               region_name = memory_region_name(region);
> > +               if (IS_STOLEN_MEMORY_REGION(region)) {
> 
> We have a query interface, why do we need to hardcode caps?
> That does not bode well for the design.
> 
> The test is supposed to be agnostic: for a set of supported memory
> regions as reported by the kernel, verify the supported api.
> -Chris

Memory region query returns stolen memory as region available
but gem_create() on that region hangs the machine. I'm not happy
adding this conditional here but it was dicated to empirical
experience.

Zbigniew


More information about the igt-dev mailing list