Require same allocation type when obtaining reusable allocation

Change-Id: I829301b83a6214bcfb4fc9f2692f21ae9a002456
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-02-01 13:49:24 +01:00
committed by sys_ocldev
parent 395d053f02
commit ce4a75e121
11 changed files with 64 additions and 99 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 Intel Corporation
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -209,14 +209,13 @@ LinearStream &CommandQueue::getCS(size_t minRequiredSize) {
auto requiredSize = minRequiredSize + CSRequirements::csOverfetchSize;
GraphicsAllocation *allocation = storageForAllocation->obtainReusableAllocation(requiredSize, false).release();
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
GraphicsAllocation *allocation = storageForAllocation->obtainReusableAllocation(requiredSize, allocationType).release();
if (!allocation) {
allocation = memoryManager->allocateGraphicsMemoryWithProperties({requiredSize, GraphicsAllocation::AllocationType::LINEAR_STREAM});
allocation = memoryManager->allocateGraphicsMemoryWithProperties({requiredSize, allocationType});
}
allocation->setAllocationType(GraphicsAllocation::AllocationType::LINEAR_STREAM);
// Deallocate the old block, if not null
auto oldAllocation = commandStream->getGraphicsAllocation();