refactor: Unify getters to check platform support for KMD migration

Related-To: NEO-6465

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2023-05-17 00:17:32 +00:00
committed by Compute-Runtime-Automation
parent d236bcbba9
commit ac9a96c07f
6 changed files with 62 additions and 15 deletions

View File

@@ -336,12 +336,9 @@ bool DrmAllocation::shouldAllocationPageFault(const Drm *drm) {
return DebugManager.flags.EnableImplicitMigrationOnFaultableHardware.get();
}
auto &productHelper = drm->getRootDeviceEnvironment().getHelper<ProductHelper>();
auto isKmdMigrationSupported = productHelper.isKmdMigrationSupported();
switch (this->allocationType) {
case AllocationType::UNIFIED_SHARED_MEMORY:
return (DebugManager.flags.UseKmdMigration.get() == -1) ? isKmdMigrationSupported : DebugManager.flags.UseKmdMigration.get();
return drm->hasKmdMigrationSupport();
case AllocationType::BUFFER:
return DebugManager.flags.UseKmdMigrationForBuffers.get() > 0;
default: