mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
feature: enable defer backing by default
Related-To: NEO-13403 Signed-off-by: Bellekallu Rajkiran <bellekallu.rajkiran@intel.com> Signed-off-by: Narendra Bagria <narendra.bagria@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c79877c3ef
commit
19bef4f891
@@ -1637,6 +1637,7 @@ void *DrmMemoryManager::lockResourceImpl(GraphicsAllocation &graphicsAllocation)
|
||||
if (ioctlHelper->makeResidentBeforeLockNeeded()) {
|
||||
auto memoryOperationsInterface = static_cast<DrmMemoryOperationsHandler *>(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.get());
|
||||
auto graphicsAllocationPtr = &graphicsAllocation;
|
||||
registerAllocationInOs(graphicsAllocationPtr);
|
||||
[[maybe_unused]] auto ret = memoryOperationsInterface->makeResidentWithinOsContext(getDefaultOsContext(rootDeviceIndex), ArrayRef<NEO::GraphicsAllocation *>(&graphicsAllocationPtr, 1), false, false, true) == MemoryOperationsStatus::success;
|
||||
DEBUG_BREAK_IF(!ret);
|
||||
}
|
||||
|
||||
@@ -271,6 +271,11 @@ bool IoctlHelperXe::initialize() {
|
||||
assignValue(tileIdToMediaGtId, gt.tile_id, gt.gt_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (debugManager.flags.EnableDeferBacking.get() != -1) {
|
||||
enableDeferBacking = debugManager.flags.EnableDeferBacking.get();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -653,7 +658,7 @@ int IoctlHelperXe::createGemExt(const MemRegionsVec &memClassInstances, size_t a
|
||||
create.placement = static_cast<uint32_t>(memoryInstances.to_ulong());
|
||||
create.cpu_caching = this->getCpuCachingMode(isCoherent, isSysMemOnly);
|
||||
|
||||
if (debugManager.flags.EnableDeferBacking.get()) {
|
||||
if (enableDeferBacking) {
|
||||
create.flags |= DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING;
|
||||
}
|
||||
|
||||
@@ -699,7 +704,7 @@ uint32_t IoctlHelperXe::createGem(uint64_t size, uint32_t memoryBanks, std::opti
|
||||
create.placement = static_cast<uint32_t>(memoryInstances.to_ulong());
|
||||
create.cpu_caching = this->getCpuCachingMode(isCoherent, isSysMemOnly);
|
||||
|
||||
if (debugManager.flags.EnableDeferBacking.get()) {
|
||||
if (enableDeferBacking) {
|
||||
create.flags |= DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING;
|
||||
}
|
||||
|
||||
@@ -1816,11 +1821,7 @@ bool IoctlHelperXe::isImmediateVmBindRequired() const {
|
||||
}
|
||||
|
||||
bool IoctlHelperXe::makeResidentBeforeLockNeeded() const {
|
||||
auto makeResidentBeforeLockNeeded = false;
|
||||
if (debugManager.flags.EnableDeferBacking.get()) {
|
||||
makeResidentBeforeLockNeeded = true;
|
||||
}
|
||||
return makeResidentBeforeLockNeeded;
|
||||
return enableDeferBacking;
|
||||
}
|
||||
|
||||
void IoctlHelperXe::insertEngineToContextParams(ContextParamEngines<> &contextParamEngines, uint32_t engineId, const EngineClassInstance *engineClassInstance, uint32_t tileId, bool hasVirtualEngines) {
|
||||
|
||||
@@ -232,6 +232,8 @@ class IoctlHelperXe : public IoctlHelper {
|
||||
};
|
||||
|
||||
std::unique_ptr<EuDebugInterface> euDebugInterface;
|
||||
|
||||
bool enableDeferBacking = true;
|
||||
};
|
||||
|
||||
template <typename... XeLogArgs>
|
||||
|
||||
Reference in New Issue
Block a user