refactor: debug flag to override PAT index for given memory type

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-10-12 14:06:59 +00:00
committed by Compute-Runtime-Automation
parent 19aba581d4
commit 06a02552ce
14 changed files with 149 additions and 53 deletions

View File

@@ -154,15 +154,15 @@ bool DrmAllocation::setCacheRegion(Drm *drm, CacheRegion regionIndex) {
return false;
}
return setCacheAdvice(drm, regionSize, regionIndex);
return setCacheAdvice(drm, regionSize, regionIndex, !isAllocatedInLocalMemoryPool());
}
bool DrmAllocation::setCacheAdvice(Drm *drm, size_t regionSize, CacheRegion regionIndex) {
bool DrmAllocation::setCacheAdvice(Drm *drm, size_t regionSize, CacheRegion regionIndex, bool isSystemMemoryPool) {
if (!drm->getCacheInfo()->getCacheRegion(regionSize, regionIndex)) {
return false;
}
auto patIndex = drm->getPatIndex(getDefaultGmm(), allocationType, regionIndex, CachePolicy::WriteBack, true);
auto patIndex = drm->getPatIndex(getDefaultGmm(), allocationType, regionIndex, CachePolicy::WriteBack, true, isSystemMemoryPool);
if (fragmentsStorage.fragmentCount > 0) {
for (uint32_t i = 0; i < fragmentsStorage.fragmentCount; i++) {