Make small buffer allocations lockable

Allocations of buffers <= 64KB will be lockable, to
allow copying through locked pointer.

Related-To: NEO-7332

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2022-11-18 14:29:50 +00:00
committed by Compute-Runtime-Automation
parent 3b97ca8709
commit 9b9b0f10ef
6 changed files with 39 additions and 9 deletions

View File

@@ -57,6 +57,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
GPU
};
static constexpr auto largestLockableBufferSize = 64 * KB;
~GraphicsAllocation() override;
GraphicsAllocation &operator=(const GraphicsAllocation &) = delete;
GraphicsAllocation(const GraphicsAllocation &) = delete;
@@ -212,6 +214,10 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
type == AllocationType::DEBUG_MODULE_AREA;
}
static bool isSmallBuffer(AllocationType type, size_t size) {
return type == AllocationType::BUFFER && size <= largestLockableBufferSize;
}
static bool isDebugSurfaceAllocationType(AllocationType type) {
return type == AllocationType::DEBUG_CONTEXT_SAVE_AREA ||
type == AllocationType::DEBUG_SBA_TRACKING_BUFFER;