On Wed, 1 Sept 2021 at 03:21, <john.c.harri...@intel.com> wrote: > > From: Daniele Ceraolo Spurio <daniele.ceraolospu...@intel.com> > > The firmware binary has to be loaded from lmem and the recommendation is > to put all other objects in there as well. Note that we don't fall back > to system memory if the allocation in lmem fails because all objects are > allocated during driver load and if we have issues with lmem at that point > something is seriously wrong with the system, so no point in trying to > handle it. > > Cc: Matthew Auld <matthew.a...@intel.com> > Cc: Abdiel Janulgue <abdiel.janul...@linux.intel.com> > Cc: Michal Wajdeczko <michal.wajdec...@intel.com> > Cc: Vinay Belgaumkar <vinay.belgaum...@intel.com> > Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenb...@intel.com> > Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospu...@intel.com> > Signed-off-by: Matthew Brost <matthew.br...@intel.com> > --- > drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 26 ++++++++ > drivers/gpu/drm/i915/gem/i915_gem_lmem.h | 4 ++ > drivers/gpu/drm/i915/gt/uc/intel_guc.c | 9 ++- > drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c | 13 ++-- > drivers/gpu/drm/i915/gt/uc/intel_huc.c | 14 ++++- > drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 75 +++++++++++++++++++++-- > 6 files changed, 128 insertions(+), 13 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_lmem.c > b/drivers/gpu/drm/i915/gem/i915_gem_lmem.c > index eb345305dc52..034226c5d4d0 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_lmem.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_lmem.c > @@ -103,6 +103,32 @@ __i915_gem_object_create_lmem_with_ps(struct > drm_i915_private *i915, > size, page_size, flags); > } > > +struct drm_i915_gem_object * > +i915_gem_object_create_lmem_from_data(struct drm_i915_private *i915, > + const void *data, size_t size) > +{ > + struct drm_i915_gem_object *obj; > + void *map; > + > + obj = i915_gem_object_create_lmem(i915, > + round_up(size, PAGE_SIZE), > + I915_BO_ALLOC_CONTIGUOUS);
Maybe push the ALLOC_CONTIG into the caller and expose the flags instead, assuming it's still needed for something GuC related? pin_map() at least no longer has that constraint.