mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
Add mem advise control flags to drm alocation
Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0859f99d64
commit
5aeae0cf99
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user