[PATCH 7/7] drm/i915: fix stolen mem detection
Robert Beckett
bob.beckett at collabora.com
Wed Apr 6 17:21:03 UTC 2022
Signed-off-by: Robert Beckett <bob.beckett at collabora.com>
---
drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index 7706e46d1f46..e6d90fc8d154 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -714,6 +714,13 @@ u64 i915_gem_object_stolen_offset(struct drm_i915_gem_object *obj)
bool i915_gem_object_is_stolen(const struct drm_i915_gem_object *obj)
{
- return obj->mm.region->type == INTEL_MEMORY_STOLEN_SYSTEM ||
- obj->mm.region->type == INTEL_MEMORY_STOLEN_LOCAL;
+ struct intel_memory_region *mr = READ_ONCE(obj->mm.region);
+
+#ifdef CONFIG_LOCKDEP
+ if (i915_gem_object_migratable(obj) &&
+ i915_gem_object_evictable(obj))
+ assert_object_held(obj);
+#endif
+ return mr && (mr->type == INTEL_MEMORY_STOLEN_SYSTEM ||
+ mr->type == INTEL_MEMORY_STOLEN_LOCAL);
}
--
2.25.1
More information about the Intel-gfx-trybot
mailing list