[igt-dev] [RFC PATCH 2/4] lib/i915/intel_memory_region: Add lib to manage memory regions

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Aug 14 12:46:01 UTC 2019


Quoting Chris Wilson (2019-08-14 13:31:10)
> Quoting Lukasz Kalamarz (2019-08-14 11:21:38)
> > +/**
> > + *  gem_get_page_size:
> > + *  @fd: open i915 drm file descriptor
> > + *  @mem_region_type: used memory_region type
> > + *
> > + *  With introduction of LMEM we observe different page sizes for those two
> > + *  memory regions. Without this helper function we may be prone to forget
> > + *  about setting proper page size.
> > + */
> > +uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type)
> > +{
> > +       return (mem_region_type == LOCAL_I915_DEVICE_MEMORY) ? 65536 : 4096;
> 
> You have to be kidding me. This, this constitutes a forward thinking uAPI?

We should be just fine requesting the minimum BO size we need, letting the KMD
round the sizes up and reading back the created BO size.

(Now that the regression has been fixed, too :) )

So the code logic needs to be updated to follow that.

Regards, Joonas


More information about the igt-dev mailing list