[PATCH] drm/i915/gt: Add GEM_BUG_ON to ensure at least one engine supports migration
apoorva.singh at intel.com
apoorva.singh at intel.com
Fri Dec 27 11:11:28 UTC 2024
From: Apoorva Singh <apoorva.singh at intel.com>
Ensure GEM_BUG_ON verifies at least one engine supports migration.
Additionally, it prevents passing an uninitialized variable to
intel_context_create().
Cc: Chris Wilson <chris.p.wilson at linux.intel.com>
Signed-off-by: Apoorva Singh <apoorva.singh at intel.com>
---
drivers/gpu/drm/i915/gt/intel_migrate.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c
index 6f7af4077135..528a7cba3623 100644
--- a/drivers/gpu/drm/i915/gt/intel_migrate.c
+++ b/drivers/gpu/drm/i915/gt/intel_migrate.c
@@ -296,6 +296,9 @@ static struct intel_context *__migrate_engines(struct intel_gt *gt)
engines[count++] = engine;
}
+ /* At least one engine must support migration! */
+ GEM_BUG_ON(!count);
+
return intel_context_create(engines[random_index(count)]);
}
--
2.34.1
More information about the Intel-gfx
mailing list