mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
Compute-Runtime-Automation

parent
1bca3b2ab5
commit
b50a6bec82
@ -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;
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user