feature: support explicit memory locking

Added lockMemory in context to explicitly locking memory,
Added a boolean flag in graphics_allocation to indicate the allocation
is locked, and modified memory_operations_handler to add lock().
Change the logic to work correctly with makeResident() when lock() is
called previously for the same memory region

Related-To: NEO-8277
Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
This commit is contained in:
Young Jin Yoon
2024-03-22 06:51:12 +00:00
committed by Compute-Runtime-Automation
parent d41f508e43
commit 27a3307bb0
48 changed files with 644 additions and 129 deletions

View File

@@ -124,6 +124,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
bool peekEvictable() const { return allocationInfo.flags.evictable; }
bool isFlushL3Required() const { return allocationInfo.flags.flushL3Required; }
void setFlushL3Required(bool flushL3Required) { allocationInfo.flags.flushL3Required = flushL3Required; }
bool isLockedMemory() const { return allocationInfo.flags.lockedMemory; }
void setLockedMemory(bool locked) { allocationInfo.flags.lockedMemory = locked; }
bool isUncacheable() const { return allocationInfo.flags.uncacheable; }
void setUncacheable(bool uncacheable) { allocationInfo.flags.uncacheable = uncacheable; }
@@ -345,7 +347,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
uint32_t flushL3Required : 1;
uint32_t uncacheable : 1;
uint32_t is32BitAllocation : 1;
uint32_t reserved : 27;
uint32_t lockedMemory : 1;
uint32_t reserved : 26;
} flags;
uint32_t allFlags = 0u;
};
@@ -355,6 +358,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
flags.evictable = true;
flags.flushL3Required = true;
flags.is32BitAllocation = false;
flags.lockedMemory = false;
}
};