drm/i915/stolen: treat stolen local as normal local memory
authorMatthew Auld <matthew.auld@intel.com>
Wed, 21 Apr 2021 10:46:56 +0000 (11:46 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Thu, 22 Apr 2021 07:50:17 +0000 (08:50 +0100)
Underneath it's the same stuff, so things like the PTE_LM bits for the
GTT should just keep working as-is.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210421104658.304142-2-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/i915_gem_lmem.c

index ce1c83c..017db8f 100644 (file)
@@ -19,7 +19,10 @@ const struct drm_i915_gem_object_ops i915_gem_lmem_obj_ops = {
 
 bool i915_gem_object_is_lmem(struct drm_i915_gem_object *obj)
 {
-       return obj->ops == &i915_gem_lmem_obj_ops;
+       struct intel_memory_region *mr = obj->mm.region;
+
+       return mr && (mr->type == INTEL_MEMORY_LOCAL ||
+                     mr->type == INTEL_MEMORY_STOLEN_LOCAL);
 }
 
 struct drm_i915_gem_object *