Add mem advise control flags to drm alocation

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2021-10-11 09:27:26 +00:00
committed by Compute-Runtime-Automation
parent 0859f99d64
commit 5aeae0cf99
11 changed files with 91 additions and 14 deletions

View File

@@ -31,4 +31,15 @@ bool DrmAllocation::setCacheRegion(Drm *drm, CacheRegion regionIndex) {
return setCacheAdvice(drm, 0, regionIndex);
}
bool DrmAllocation::setMemAdvise(Drm *drm, MemAdviseFlags flags) {
if (flags.cached_memory != enabledMemAdviseFlags.cached_memory) {
CachePolicy memType = flags.cached_memory ? CachePolicy::WriteBack : CachePolicy::Uncached;
setCachePolicy(memType);
}
enabledMemAdviseFlags = flags;
return true;
}
} // namespace NEO