mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Fail on blitMemoryToAllocation when blitter is not supported
Related-To: NEO-6325 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
93e3d948f5
commit
515130dbe8
@ -563,12 +563,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ContextCreateTests, givenLocalMemoryAllocationWhenB
|
||||
auto executionEnv = testedDevice->getExecutionEnvironment();
|
||||
executionEnv->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = false;
|
||||
|
||||
const auto &hwInfo = testedDevice->getHardwareInfo();
|
||||
auto isBlitterRequired = HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBlitCopyRequiredForLocalMemory(hwInfo, *memory);
|
||||
|
||||
auto expectedStatus = isBlitterRequired ? BlitOperationResult::Success : BlitOperationResult::Unsupported;
|
||||
|
||||
EXPECT_EQ(expectedStatus, BlitHelper::blitMemoryToAllocation(buffer->getContext()->getDevice(0)->getDevice(), memory, buffer->getOffset(), hostMemory, {1, 1, 1}));
|
||||
EXPECT_EQ(BlitOperationResult::Unsupported, BlitHelper::blitMemoryToAllocation(buffer->getContext()->getDevice(0)->getDevice(), memory, buffer->getOffset(), hostMemory, {1, 1, 1}));
|
||||
|
||||
executionEnv->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
|
||||
EXPECT_EQ(BlitOperationResult::Success, BlitHelper::blitMemoryToAllocation(buffer->getContext()->getDevice(0)->getDevice(), memory, buffer->getOffset(), hostMemory, {1, 1, 1}));
|
||||
|
@ -3017,26 +3017,6 @@ TEST(MemoryTransferHelperTest, givenBlitOperationSupportedWhenBcsEngineNotAvaila
|
||||
EXPECT_EQ(BlitOperationResult::Unsupported, BlitHelperFunctions::blitMemoryToAllocation(*device, &graphicsAllocation, 0, srcData, {dataSize, 1, 1}));
|
||||
}
|
||||
|
||||
TEST(MemoryTransferHelperTest, givenBlitOperationSupportedDisabledWhenBlitMemoryToAllocationThenReturnUnsupported) {
|
||||
DebugManagerStateRestore restorer;
|
||||
constexpr uint32_t dataSize = 16;
|
||||
uint8_t destData[dataSize] = {};
|
||||
uint8_t srcData[dataSize] = {};
|
||||
|
||||
MockGraphicsAllocation graphicsAllocation{destData, sizeof(destData)};
|
||||
graphicsAllocation.storageInfo.memoryBanks = 1;
|
||||
graphicsAllocation.setAllocationType(GraphicsAllocation::AllocationType::BUFFER);
|
||||
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
hwInfo.featureTable.ftrBcsInfo = 1;
|
||||
DebugManager.flags.EnableBlitterOperationsSupport.set(false);
|
||||
|
||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
|
||||
|
||||
EXPECT_EQ(BlitOperationResult::Unsupported, BlitHelperFunctions::blitMemoryToAllocation(*device, &graphicsAllocation, 0, srcData, {dataSize, 1, 1}));
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenMemoryManagerWithLocalMemoryWhenCreatingMultiGraphicsAllocationInSystemMemoryThenForceSystemMemoryPlacement) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
executionEnvironment.initGmm();
|
||||
|
@ -174,11 +174,7 @@ BlitOperationResult BlitHelper::blitMemoryToAllocation(const Device &device, Gra
|
||||
BlitOperationResult BlitHelper::blitMemoryToAllocationBanks(const Device &device, GraphicsAllocation *memory, size_t offset, const void *hostPtr,
|
||||
const Vec3<size_t> &size, DeviceBitfield memoryBanks) {
|
||||
const auto &hwInfo = device.getHardwareInfo();
|
||||
auto isBlitterRequired = HwHelper::get(hwInfo.platform.eRenderCoreFamily).isBlitCopyRequiredForLocalMemory(hwInfo, *memory);
|
||||
if (!hwInfo.capabilityTable.blitterOperationsSupported && !isBlitterRequired) {
|
||||
return BlitOperationResult::Unsupported;
|
||||
}
|
||||
if (0 == DebugManager.flags.EnableBlitterOperationsSupport.get()) {
|
||||
if (!hwInfo.capabilityTable.blitterOperationsSupported) {
|
||||
return BlitOperationResult::Unsupported;
|
||||
}
|
||||
|
||||
|
@ -684,6 +684,9 @@ bool MemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAllocatio
|
||||
for (auto i = 0u; i < graphicsAllocation->storageInfo.getNumBanks(); ++i) {
|
||||
memcpy_s(ptrOffset(static_cast<uint8_t *>(graphicsAllocation->getUnderlyingBuffer()) + i * graphicsAllocation->getUnderlyingBufferSize(), destinationOffset),
|
||||
(graphicsAllocation->getUnderlyingBufferSize() - destinationOffset), memoryToCopy, sizeToCopy);
|
||||
if (graphicsAllocation->getAllocationType() != GraphicsAllocation::AllocationType::DEBUG_CONTEXT_SAVE_AREA) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user