Fix SyncBuffer page tables cloning

multiOsContextCapable param was hardcoded to false and page tables were
not cloned to other SubDevices

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-01-17 11:23:53 +00:00
committed by Compute-Runtime-Automation
parent c36c083812
commit 9147d4c203
2 changed files with 13 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -238,3 +238,12 @@ TEST(SyncBufferHandlerDeviceTest, GivenSubDeviceWhenAllocateSyncBufferIsCalledTw
EXPECT_EQ(testUsedBufferSize, syncBufferHandler->usedBufferSize);
}
TEST(SyncBufferHandlerDeviceTest, givenMultipleSubDevicesWhenAllocatingSyncBufferThenClonePageTables) {
UltDeviceFactory ultDeviceFactory{1, 2};
auto rootDevice = ultDeviceFactory.rootDevices[0];
rootDevice->allocateSyncBufferHandler();
auto syncBufferHandler = reinterpret_cast<MockSyncBufferHandler *>(rootDevice->syncBufferHandler.get());
EXPECT_TRUE(syncBufferHandler->graphicsAllocation->storageInfo.cloningOfPageTables);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -29,7 +29,8 @@ void SyncBufferHandler::makeResident(CommandStreamReceiver &csr) {
void SyncBufferHandler::allocateNewBuffer() {
AllocationProperties allocationProperties{device.getRootDeviceIndex(), true, bufferSize,
GraphicsAllocation::AllocationType::LINEAR_STREAM,
false, false, device.getDeviceBitfield()};
(device.getNumGenericSubDevices() > 1u), /* multiOsContextCapable */
false, device.getDeviceBitfield()};
graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties(allocationProperties);
UNRECOVERABLE_IF(graphicsAllocation == nullptr);