Add GraphicsAllocation::isLockable method

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-04-13 17:23:36 +00:00
committed by Compute-Runtime-Automation
parent 8530cbbdb7
commit 48d40ad850
2 changed files with 43 additions and 1 deletions

View File

@@ -98,7 +98,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
DEBUG_MODULE_AREA,
UNIFIED_SHARED_MEMORY,
WORK_PARTITION_SURFACE,
GPU_TIMESTAMP_DEVICE_BUFFER
GPU_TIMESTAMP_DEVICE_BUFFER,
COUNT
};
~GraphicsAllocation() override;
@@ -229,6 +230,13 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
allocationType == AllocationType::DEBUG_CONTEXT_SAVE_AREA ||
allocationType == AllocationType::DEBUG_MODULE_AREA;
}
static bool isLockable(AllocationType allocationType) {
return isCpuAccessRequired(allocationType) ||
isIsaAllocationType(allocationType) ||
allocationType == AllocationType::BUFFER ||
allocationType == AllocationType::BUFFER_HOST_MEMORY ||
allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER;
}
static bool isIsaAllocationType(GraphicsAllocation::AllocationType type) {
return type == GraphicsAllocation::AllocationType::KERNEL_ISA ||