Correct isBlitCopyRequiredForLocalMemory

detect not lockable allocation based on gmm flag
Related-To: NEO-5733

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-05-19 11:20:56 +00:00
committed by Compute-Runtime-Automation
parent 1bca3b2ab5
commit b50a6bec82
5 changed files with 17 additions and 2 deletions

View File

@ -58,7 +58,7 @@ bool CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getParametersForWriteMem
if (size == 0)
return false;
if (cpuAddress == nullptr && !gmm->resourceParams.Flags.Info.NotLockable) {
if (cpuAddress == nullptr && graphicsAllocation.isAllocationLockable()) {
cpuAddress = this->getMemoryManager()->lockResource(&graphicsAllocation);
}
return true;

View File

@ -27,6 +27,7 @@
#include "opencl/source/mem_obj/image.h"
#include "opencl/test/unit_test/mocks/mock_buffer.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
#include "opencl/test/unit_test/mocks/mock_gmm.h"
#include "pipe_control_args.h"
@ -986,6 +987,10 @@ HWTEST_F(HwHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredFo
EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType()));
graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory);
MockGmm mockGmm(pDevice->getGmmClientContext(), nullptr, 100, 100, false, false, false, {});
mockGmm.resourceParams.Flags.Info.NotLockable = true;
graphicsAllocation.setDefaultGmm(&mockGmm);
EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation));
DebugManager.flags.ForceLocalMemoryAccessMode.set(0);