[PATCH 09/10] Always migrate
Jason Ekstrand
jason at jlekstrand.net
Thu Jul 22 15:46:57 UTC 2021
---
drivers/gpu/drm/i915/gem/i915_gem_object.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index d09bd9bdb38ac..9d3497e1235a0 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -607,12 +607,15 @@ int i915_gem_object_migrate(struct drm_i915_gem_object *obj,
mr = i915->mm.regions[id];
GEM_BUG_ON(!mr);
- if (obj->mm.region == mr)
- return 0;
-
if (!i915_gem_object_can_migrate(obj, id))
return -EINVAL;
+ if (!obj->ops->migrate) {
+ if (GEM_WARN_ON(obj->mm.region != mr))
+ return -EINVAL;
+ return 0;
+ }
+
return obj->ops->migrate(obj, mr);
}
--
2.31.1
More information about the Intel-gfx-trybot
mailing list