]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Take pinning into account in __i915_gem_object_is_lmem
authorMatthew Brost <matthew.brost@intel.com>
Thu, 16 Sep 2021 16:28:19 +0000 (09:28 -0700)
committerJohn Harrison <John.C.Harrison@Intel.com>
Mon, 20 Sep 2021 19:35:46 +0000 (12:35 -0700)
Don't blow up on a GEM_WARN_ON in __i915_gem_object_is_lmem if the
object is pinned (not evictable).

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210916162819.27848-6-matthew.brost@intel.com
drivers/gpu/drm/i915/gem/i915_gem_lmem.c

index 034226c5d4d0efa4d6fb4ff3dedc8e00e11edc5b..d659239fcbcc79f6e05a6221472af6a6a9c1793b 100644 (file)
@@ -56,8 +56,8 @@ bool i915_gem_object_is_lmem(struct drm_i915_gem_object *obj)
  * @obj: The object to check.
  *
  * This function is intended to be called from within the fence signaling
- * path where the fence keeps the object from being migrated. For example
- * during gpu reset or similar.
+ * path where the fence, or a pin, keeps the object from being migrated. For
+ * example during gpu reset or similar.
  *
  * Return: Whether the object is resident in lmem.
  */
@@ -66,7 +66,8 @@ bool __i915_gem_object_is_lmem(struct drm_i915_gem_object *obj)
        struct intel_memory_region *mr = READ_ONCE(obj->mm.region);
 
 #ifdef CONFIG_LOCKDEP
-       GEM_WARN_ON(dma_resv_test_signaled(obj->base.resv, true));
+       GEM_WARN_ON(dma_resv_test_signaled(obj->base.resv, true) &&
+                   !i915_gem_object_evictable(obj));
 #endif
        return mr && (mr->type == INTEL_MEMORY_LOCAL ||
                      mr->type == INTEL_MEMORY_STOLEN_LOCAL);