mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
fix: set NotLockable flag when resource doesn't need to be lockable
disable compression preference when resource is lockable Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
36d3c65284
commit
7b2af39fd6
@@ -292,6 +292,9 @@ HWTEST2_F(CommandQueuePvcAndLaterTests, whenPrepareHostPtrSurfaceForSplitThenSet
|
|||||||
HostPtrSurface hostPtrSurf(ptr, ptrSize);
|
HostPtrSurface hostPtrSurf(ptr, ptrSize);
|
||||||
queue->getGpgpuCommandStreamReceiver().createAllocationForHostSurface(hostPtrSurf, false);
|
queue->getGpgpuCommandStreamReceiver().createAllocationForHostSurface(hostPtrSurf, false);
|
||||||
|
|
||||||
|
EXPECT_EQ(1u, hostPtrSurf.getAllocation()->hostPtrTaskCountAssignment.load());
|
||||||
|
hostPtrSurf.getAllocation()->hostPtrTaskCountAssignment--;
|
||||||
|
|
||||||
queue->prepareHostPtrSurfaceForSplit(false, *hostPtrSurf.getAllocation());
|
queue->prepareHostPtrSurfaceForSplit(false, *hostPtrSurf.getAllocation());
|
||||||
|
|
||||||
for (auto i = static_cast<uint32_t>(aub_stream::EngineType::ENGINE_BCS1); i <= static_cast<uint32_t>(aub_stream::EngineType::ENGINE_BCS8); i++) {
|
for (auto i = static_cast<uint32_t>(aub_stream::EngineType::ENGINE_BCS1); i <= static_cast<uint32_t>(aub_stream::EngineType::ENGINE_BCS8); i++) {
|
||||||
|
|||||||
@@ -133,4 +133,6 @@ TEST_F(CommandStreamReceiverMultiRootDeviceTest, WhenCreatingCommandStreamGraphi
|
|||||||
EXPECT_TRUE(commandStreamReceiver->createAllocationForHostSurface(surface, false));
|
EXPECT_TRUE(commandStreamReceiver->createAllocationForHostSurface(surface, false));
|
||||||
ASSERT_NE(nullptr, surface.getAllocation());
|
ASSERT_NE(nullptr, surface.getAllocation());
|
||||||
EXPECT_EQ(expectedRootDeviceIndex, surface.getAllocation()->getRootDeviceIndex());
|
EXPECT_EQ(expectedRootDeviceIndex, surface.getAllocation()->getRootDeviceIndex());
|
||||||
|
EXPECT_EQ(1u, surface.getAllocation()->hostPtrTaskCountAssignment.load());
|
||||||
|
surface.getAllocation()->hostPtrTaskCountAssignment--;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1090,10 +1090,14 @@ struct RelaxedOrderingBcsTests : public BcsTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BlitProperties generateBlitProperties(CommandStreamReceiver &csr, Buffer *clBuffer) {
|
BlitProperties generateBlitProperties(CommandStreamReceiver &csr, Buffer *clBuffer) {
|
||||||
return BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer,
|
auto properties = BlitProperties::constructPropertiesForReadWrite(BlitterConstants::BlitDirection::HostPtrToBuffer,
|
||||||
csr, clBuffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()), nullptr, hostPtr,
|
csr, clBuffer->getGraphicsAllocation(pDevice->getRootDeviceIndex()), nullptr, hostPtr,
|
||||||
clBuffer->getGraphicsAllocation(pDevice->getRootDeviceIndex())->getGpuAddress(), 0,
|
clBuffer->getGraphicsAllocation(pDevice->getRootDeviceIndex())->getGpuAddress(), 0,
|
||||||
0, 0, {1, 1, 1}, 0, 0, 0, 0);
|
0, 0, {1, 1, 1}, 0, 0, 0, 0);
|
||||||
|
EXPECT_EQ(1u, properties.srcAllocation->hostPtrTaskCountAssignment.load());
|
||||||
|
properties.srcAllocation->hostPtrTaskCountAssignment--;
|
||||||
|
|
||||||
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<VariableBackup<UltHwConfig>> ultHwConfigBackup;
|
std::unique_ptr<VariableBackup<UltHwConfig>> ultHwConfigBackup;
|
||||||
|
|||||||
@@ -1748,6 +1748,9 @@ HWTEST_F(BcsTests, givenHostPtrToImageWhenConstructPropertiesIsCalledThenValuesA
|
|||||||
EXPECT_EQ(dstRowPitchExpected, blitProperties.dstRowPitch);
|
EXPECT_EQ(dstRowPitchExpected, blitProperties.dstRowPitch);
|
||||||
EXPECT_EQ(srcSlicePitchExpected, blitProperties.srcSlicePitch);
|
EXPECT_EQ(srcSlicePitchExpected, blitProperties.srcSlicePitch);
|
||||||
EXPECT_EQ(dstSlicePitchExpected, blitProperties.dstSlicePitch);
|
EXPECT_EQ(dstSlicePitchExpected, blitProperties.dstSlicePitch);
|
||||||
|
|
||||||
|
EXPECT_EQ(1u, blitProperties.srcAllocation->hostPtrTaskCountAssignment.load());
|
||||||
|
blitProperties.srcAllocation->hostPtrTaskCountAssignment--;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(BcsTests, givenImageToHostPtrWhenConstructPropertiesIsCalledThenValuesAreSetCorrectly) {
|
HWTEST_F(BcsTests, givenImageToHostPtrWhenConstructPropertiesIsCalledThenValuesAreSetCorrectly) {
|
||||||
@@ -1786,6 +1789,9 @@ HWTEST_F(BcsTests, givenImageToHostPtrWhenConstructPropertiesIsCalledThenValuesA
|
|||||||
EXPECT_EQ(dstRowPitchExpected, blitProperties.dstRowPitch);
|
EXPECT_EQ(dstRowPitchExpected, blitProperties.dstRowPitch);
|
||||||
EXPECT_EQ(srcSlicePitchExpected, blitProperties.srcSlicePitch);
|
EXPECT_EQ(srcSlicePitchExpected, blitProperties.srcSlicePitch);
|
||||||
EXPECT_EQ(dstSlicePitchExpected, blitProperties.dstSlicePitch);
|
EXPECT_EQ(dstSlicePitchExpected, blitProperties.dstSlicePitch);
|
||||||
|
|
||||||
|
EXPECT_EQ(1u, blitProperties.dstAllocation->hostPtrTaskCountAssignment.load());
|
||||||
|
blitProperties.dstAllocation->hostPtrTaskCountAssignment--;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(BcsTests, givenHostPtrToImageWithInputRowSlicePitchesWhenConstructPropertiesIsCalledThenValuesAreSetCorrectly) {
|
HWTEST_F(BcsTests, givenHostPtrToImageWithInputRowSlicePitchesWhenConstructPropertiesIsCalledThenValuesAreSetCorrectly) {
|
||||||
@@ -1816,6 +1822,9 @@ HWTEST_F(BcsTests, givenHostPtrToImageWithInputRowSlicePitchesWhenConstructPrope
|
|||||||
EXPECT_EQ(dstRowPitchExpected, blitProperties.dstRowPitch);
|
EXPECT_EQ(dstRowPitchExpected, blitProperties.dstRowPitch);
|
||||||
EXPECT_EQ(inputSlicePitch, blitProperties.srcSlicePitch);
|
EXPECT_EQ(inputSlicePitch, blitProperties.srcSlicePitch);
|
||||||
EXPECT_EQ(dstSlicePitchExpected, blitProperties.dstSlicePitch);
|
EXPECT_EQ(dstSlicePitchExpected, blitProperties.dstSlicePitch);
|
||||||
|
|
||||||
|
EXPECT_EQ(1u, blitProperties.srcAllocation->hostPtrTaskCountAssignment.load());
|
||||||
|
blitProperties.srcAllocation->hostPtrTaskCountAssignment--;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(BcsTests, givenImageToHostPtrWithInputRowSlicePitchesWhenConstructPropertiesIsCalledThenValuesAreSetCorrectly) {
|
HWTEST_F(BcsTests, givenImageToHostPtrWithInputRowSlicePitchesWhenConstructPropertiesIsCalledThenValuesAreSetCorrectly) {
|
||||||
@@ -1847,6 +1856,9 @@ HWTEST_F(BcsTests, givenImageToHostPtrWithInputRowSlicePitchesWhenConstructPrope
|
|||||||
EXPECT_EQ(inputRowPitch, blitProperties.dstRowPitch);
|
EXPECT_EQ(inputRowPitch, blitProperties.dstRowPitch);
|
||||||
EXPECT_EQ(srcSlicePitchExpected, blitProperties.srcSlicePitch);
|
EXPECT_EQ(srcSlicePitchExpected, blitProperties.srcSlicePitch);
|
||||||
EXPECT_EQ(inputSlicePitch, blitProperties.dstSlicePitch);
|
EXPECT_EQ(inputSlicePitch, blitProperties.dstSlicePitch);
|
||||||
|
|
||||||
|
EXPECT_EQ(1u, blitProperties.dstAllocation->hostPtrTaskCountAssignment.load());
|
||||||
|
blitProperties.dstAllocation->hostPtrTaskCountAssignment--;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(BcsTests, givenHostPtrToImageWhenBlitBufferIsCalledThenBlitCmdIsFound) {
|
HWTEST_F(BcsTests, givenHostPtrToImageWhenBlitBufferIsCalledThenBlitCmdIsFound) {
|
||||||
|
|||||||
@@ -1473,7 +1473,7 @@ TEST_F(GmmLocalMemoryTests, givenFtrLocalMemoryWhenUsingLocalMemoryAndAllocation
|
|||||||
EXPECT_EQ(0u, gmm->resourceParams.Flags.Info.NotLockable);
|
EXPECT_EQ(0u, gmm->resourceParams.Flags.Info.NotLockable);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GmmLocalMemoryTests, givenFtrLocalMemoryWhenUsingLocalMemoryFalseAndAllocationIsNotLockableThenNotLockableFlagsIsSetAndLocalAndNonLocalOnlyAreNotSet) {
|
TEST_F(GmmHelperTests, givenNotLockableAllocationWhenCreatingGmmThenNotLockableFlagsIsSetAndLocalAndNonLocalOnlyAreNotSet) {
|
||||||
StorageInfo storageInfo{};
|
StorageInfo storageInfo{};
|
||||||
storageInfo.isLockable = false;
|
storageInfo.isLockable = false;
|
||||||
storageInfo.memoryBanks.set(1);
|
storageInfo.memoryBanks.set(1);
|
||||||
@@ -1530,7 +1530,7 @@ TEST_F(GmmLocalMemoryTests, givenLocalMemoryAndStorageInfoWithoutLocalOnlyRequir
|
|||||||
EXPECT_EQ(0u, gmm->resourceParams.Flags.Info.LocalOnly);
|
EXPECT_EQ(0u, gmm->resourceParams.Flags.Info.LocalOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GmmLocalMemoryTests, givenFtrLocalMemoryAndCompressionEnabledWhenUsingLocalMemoryAndAllocationIsNotLockableThenNotLockableAndLocalOnlyFlagsAreSetAndNonLocalOnlyIsNotSet) {
|
TEST_F(GmmHelperTests, givenCompressionEnabledWhenUsingLocalMemoryAndAllocationIsNotLockableThenNotLockableAndLocalOnlyFlagsAreSetAndNonLocalOnlyIsNotSet) {
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
DebugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
DebugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
||||||
StorageInfo storageInfo{};
|
StorageInfo storageInfo{};
|
||||||
@@ -1541,10 +1541,23 @@ TEST_F(GmmLocalMemoryTests, givenFtrLocalMemoryAndCompressionEnabledWhenUsingLoc
|
|||||||
auto gmm = std::make_unique<Gmm>(getGmmHelper(), nullptr, 1, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, true, storageInfo, true);
|
auto gmm = std::make_unique<Gmm>(getGmmHelper(), nullptr, 1, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, true, storageInfo, true);
|
||||||
EXPECT_TRUE(gmm->isCompressionEnabled);
|
EXPECT_TRUE(gmm->isCompressionEnabled);
|
||||||
EXPECT_EQ(0u, gmm->resourceParams.Flags.Info.NonLocalOnly);
|
EXPECT_EQ(0u, gmm->resourceParams.Flags.Info.NonLocalOnly);
|
||||||
EXPECT_EQ(1u, gmm->resourceParams.Flags.Info.LocalOnly);
|
EXPECT_EQ(defaultHwInfo->featureTable.flags.ftrLocalMemory, gmm->resourceParams.Flags.Info.LocalOnly);
|
||||||
EXPECT_EQ(1u, gmm->resourceParams.Flags.Info.NotLockable);
|
EXPECT_EQ(1u, gmm->resourceParams.Flags.Info.NotLockable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(GmmHelperTests, givenCompressionSupportedWhenAllocationIsLockableThenGmmHasNoCompression) {
|
||||||
|
DebugManagerStateRestore restorer;
|
||||||
|
DebugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
||||||
|
StorageInfo storageInfo{};
|
||||||
|
storageInfo.isLockable = true;
|
||||||
|
storageInfo.systemMemoryPlacement = false;
|
||||||
|
storageInfo.memoryBanks.set(1);
|
||||||
|
|
||||||
|
auto gmm = std::make_unique<Gmm>(getGmmHelper(), nullptr, 1, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, true, storageInfo, true);
|
||||||
|
EXPECT_FALSE(gmm->isCompressionEnabled);
|
||||||
|
EXPECT_EQ(0u, gmm->resourceParams.Flags.Info.NotLockable);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(GmmLocalMemoryTests, givenFtrLocalMemoryWhenUseSystemMemoryIsFalseAndAllocationIsNotLockableThenLocalAndNonLocalOnlyAndNotLockableFlagsAreNotSet) {
|
TEST_F(GmmLocalMemoryTests, givenFtrLocalMemoryWhenUseSystemMemoryIsFalseAndAllocationIsNotLockableThenLocalAndNonLocalOnlyAndNotLockableFlagsAreNotSet) {
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
for (auto csrMode = static_cast<int32_t>(CommandStreamReceiverType::CSR_HW); csrMode < static_cast<int32_t>(CommandStreamReceiverType::CSR_TYPES_NUM); csrMode++) {
|
for (auto csrMode = static_cast<int32_t>(CommandStreamReceiverType::CSR_HW); csrMode < static_cast<int32_t>(CommandStreamReceiverType::CSR_TYPES_NUM); csrMode++) {
|
||||||
|
|||||||
@@ -1973,11 +1973,14 @@ HWTEST_F(BufferCreateTests, givenClMemCopyHostPointerPassedToBufferCreateWhenAll
|
|||||||
DebugManagerStateRestore subTestRestorer;
|
DebugManagerStateRestore subTestRestorer;
|
||||||
DebugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
DebugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
||||||
DebugManager.flags.OverrideBufferSuitableForRenderCompression.set(1);
|
DebugManager.flags.OverrideBufferSuitableForRenderCompression.set(1);
|
||||||
|
|
||||||
cl_int retVal;
|
cl_int retVal;
|
||||||
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR;
|
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR;
|
||||||
auto writeBufferCounter = commandQueue->writeBufferCounter;
|
auto writeBufferCounter = commandQueue->writeBufferCounter;
|
||||||
size_t lockResourceCalled = memoryManager->lockResourceCalled;
|
size_t lockResourceCalled = memoryManager->lockResourceCalled;
|
||||||
|
|
||||||
|
static_cast<MockGfxCoreHelperHwWithSetIsLockable<FamilyType> *>(executionEnvironment->rootDeviceEnvironments[0]->gfxCoreHelper.get())->setIsLockable = false;
|
||||||
|
|
||||||
std::unique_ptr<Buffer> buffer(Buffer::create(&context, flags, sizeof(memory), memory, retVal));
|
std::unique_ptr<Buffer> buffer(Buffer::create(&context, flags, sizeof(memory), memory, retVal));
|
||||||
ASSERT_NE(nullptr, buffer.get());
|
ASSERT_NE(nullptr, buffer.get());
|
||||||
EXPECT_EQ(commandQueue->writeBufferCounter, writeBufferCounter + 1);
|
EXPECT_EQ(commandQueue->writeBufferCounter, writeBufferCounter + 1);
|
||||||
|
|||||||
@@ -184,6 +184,9 @@ HWTEST2_F(MigrationControllerTests, givenMultiGraphicsAllocationUsedInOneCsrWhen
|
|||||||
|
|
||||||
ASSERT_TRUE(pImage->getMultiGraphicsAllocation().requiresMigrations());
|
ASSERT_TRUE(pImage->getMultiGraphicsAllocation().requiresMigrations());
|
||||||
|
|
||||||
|
pImage->getMultiGraphicsAllocation().getGraphicsAllocation(0)->getDefaultGmm()->resourceParams.Flags.Info.NotLockable = false;
|
||||||
|
pImage->getMultiGraphicsAllocation().getGraphicsAllocation(1)->getDefaultGmm()->resourceParams.Flags.Info.NotLockable = false;
|
||||||
|
|
||||||
auto migrationSyncData = static_cast<MockMigrationSyncData *>(pImage->getMultiGraphicsAllocation().getMigrationSyncData());
|
auto migrationSyncData = static_cast<MockMigrationSyncData *>(pImage->getMultiGraphicsAllocation().getMigrationSyncData());
|
||||||
|
|
||||||
EXPECT_EQ(0u, migrationSyncData->waitOnCpuCalled);
|
EXPECT_EQ(0u, migrationSyncData->waitOnCpuCalled);
|
||||||
|
|||||||
@@ -191,6 +191,8 @@ HWTEST_F(PrintfHandlerTests, givenGpuHangOnFlushBcsStreamAndEnabledStatelessComp
|
|||||||
EXPECT_FALSE(printfHandler->printEnqueueOutput());
|
EXPECT_FALSE(printfHandler->printEnqueueOutput());
|
||||||
EXPECT_EQ(1u, bcsCsr->blitBufferCalled);
|
EXPECT_EQ(1u, bcsCsr->blitBufferCalled);
|
||||||
EXPECT_EQ(BlitterConstants::BlitDirection::BufferToHostPtr, bcsCsr->receivedBlitProperties[0].blitDirection);
|
EXPECT_EQ(BlitterConstants::BlitDirection::BufferToHostPtr, bcsCsr->receivedBlitProperties[0].blitDirection);
|
||||||
|
EXPECT_EQ(1u, bcsCsr->receivedBlitProperties[0].dstAllocation->hostPtrTaskCountAssignment.load());
|
||||||
|
bcsCsr->receivedBlitProperties[0].dstAllocation->hostPtrTaskCountAssignment--;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(PrintfHandlerTests, givenDisallowedLocalMemoryCpuAccessWhenPrintEnqueueOutputIsCalledThenBCSEngineIsUsedToCopyPrintfOutput) {
|
HWTEST_F(PrintfHandlerTests, givenDisallowedLocalMemoryCpuAccessWhenPrintEnqueueOutputIsCalledThenBCSEngineIsUsedToCopyPrintfOutput) {
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ Gmm::Gmm(GmmHelper *gmmHelper, const void *alignedPtr, size_t alignedSize, size_
|
|||||||
resourceParams.Flags.Gpu.NoRestriction = 1;
|
resourceParams.Flags.Gpu.NoRestriction = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
preferCompressed &= !storageInfo.isLockable;
|
||||||
|
|
||||||
applyAuxFlagsForBuffer(preferCompressed);
|
applyAuxFlagsForBuffer(preferCompressed);
|
||||||
applyMemoryFlags(storageInfo);
|
applyMemoryFlags(storageInfo);
|
||||||
applyAppResource(storageInfo);
|
applyAppResource(storageInfo);
|
||||||
@@ -73,6 +75,7 @@ Gmm::~Gmm() = default;
|
|||||||
|
|
||||||
Gmm::Gmm(GmmHelper *gmmHelper, ImageInfo &inputOutputImgInfo, const StorageInfo &storageInfo, bool preferCompressed) : gmmHelper(gmmHelper) {
|
Gmm::Gmm(GmmHelper *gmmHelper, ImageInfo &inputOutputImgInfo, const StorageInfo &storageInfo, bool preferCompressed) : gmmHelper(gmmHelper) {
|
||||||
this->resourceParams = {};
|
this->resourceParams = {};
|
||||||
|
preferCompressed &= !storageInfo.isLockable;
|
||||||
setupImageResourceParams(inputOutputImgInfo, preferCompressed);
|
setupImageResourceParams(inputOutputImgInfo, preferCompressed);
|
||||||
applyMemoryFlags(storageInfo);
|
applyMemoryFlags(storageInfo);
|
||||||
applyAppResource(storageInfo);
|
applyAppResource(storageInfo);
|
||||||
@@ -346,13 +349,15 @@ void Gmm::applyMemoryFlags(const StorageInfo &storageInfo) {
|
|||||||
if (extraMemoryFlagsRequired()) {
|
if (extraMemoryFlagsRequired()) {
|
||||||
applyExtraMemoryFlags(storageInfo);
|
applyExtraMemoryFlags(storageInfo);
|
||||||
} else if (!storageInfo.isLockable) {
|
} else if (!storageInfo.isLockable) {
|
||||||
resourceParams.Flags.Info.NotLockable = 1;
|
|
||||||
if (isCompressionEnabled || storageInfo.localOnlyRequired) {
|
if (isCompressionEnabled || storageInfo.localOnlyRequired) {
|
||||||
resourceParams.Flags.Info.LocalOnly = 1;
|
resourceParams.Flags.Info.LocalOnly = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!storageInfo.isLockable) {
|
||||||
|
resourceParams.Flags.Info.NotLockable = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (hardwareInfo->featureTable.flags.ftrMultiTileArch) {
|
if (hardwareInfo->featureTable.flags.ftrMultiTileArch) {
|
||||||
resourceParams.MultiTileArch.Enable = 1;
|
resourceParams.MultiTileArch.Enable = 1;
|
||||||
|
|||||||
@@ -363,10 +363,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
|||||||
bool createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush) override {
|
bool createAllocationForHostSurface(HostPtrSurface &surface, bool requiresL3Flush) override {
|
||||||
createAllocationForHostSurfaceCalled++;
|
createAllocationForHostSurfaceCalled++;
|
||||||
cpuCopyForHostPtrSurfaceAllowed = surface.peekIsPtrCopyAllowed();
|
cpuCopyForHostPtrSurfaceAllowed = surface.peekIsPtrCopyAllowed();
|
||||||
auto status = BaseClass::createAllocationForHostSurface(surface, requiresL3Flush);
|
return BaseClass::createAllocationForHostSurface(surface, requiresL3Flush);
|
||||||
if (status)
|
|
||||||
surface.getAllocation()->hostPtrTaskCountAssignment--;
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ensureCommandBufferAllocation(LinearStream &commandStream, size_t minimumRequiredSize, size_t additionalAllocationSize) override {
|
void ensureCommandBufferAllocation(LinearStream &commandStream, size_t minimumRequiredSize, size_t additionalAllocationSize) override {
|
||||||
|
|||||||
@@ -586,7 +586,7 @@ class OsAgnosticMemoryManagerForImagesWithNoHostPtr : public OsAgnosticMemoryMan
|
|||||||
};
|
};
|
||||||
|
|
||||||
using AubCommandStreamReceiverNoHostPtrTests = ::testing::Test;
|
using AubCommandStreamReceiverNoHostPtrTests = ::testing::Test;
|
||||||
HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWhenWriteMemoryIsCalledOnImageWithNoHostPtrThenResourceShouldBeLockedToGetCpuAddress) {
|
HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWhenWriteMemoryIsCalledOnLockableImageWithNoHostPtrThenResourceShouldBeLockedToGetCpuAddress) {
|
||||||
ExecutionEnvironment *executionEnvironment = new MockExecutionEnvironment();
|
ExecutionEnvironment *executionEnvironment = new MockExecutionEnvironment();
|
||||||
auto memoryManager = new OsAgnosticMemoryManagerForImagesWithNoHostPtr(*executionEnvironment);
|
auto memoryManager = new OsAgnosticMemoryManagerForImagesWithNoHostPtr(*executionEnvironment);
|
||||||
executionEnvironment->memoryManager.reset(memoryManager);
|
executionEnvironment->memoryManager.reset(memoryManager);
|
||||||
@@ -611,6 +611,7 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh
|
|||||||
|
|
||||||
auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr);
|
auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, nullptr);
|
||||||
ASSERT_NE(nullptr, imageAllocation);
|
ASSERT_NE(nullptr, imageAllocation);
|
||||||
|
imageAllocation->getDefaultGmm()->resourceParams.Flags.Info.NotLockable = false;
|
||||||
|
|
||||||
EXPECT_TRUE(aubCsr->writeMemory(*imageAllocation));
|
EXPECT_TRUE(aubCsr->writeMemory(*imageAllocation));
|
||||||
|
|
||||||
|
|||||||
@@ -1799,6 +1799,9 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio
|
|||||||
auto allocation = surface.getAllocation();
|
auto allocation = surface.getAllocation();
|
||||||
ASSERT_NE(nullptr, allocation);
|
ASSERT_NE(nullptr, allocation);
|
||||||
|
|
||||||
|
EXPECT_EQ(1u, allocation->hostPtrTaskCountAssignment.load());
|
||||||
|
allocation->hostPtrTaskCountAssignment--;
|
||||||
|
|
||||||
EXPECT_NE(memory, allocation->getUnderlyingBuffer());
|
EXPECT_NE(memory, allocation->getUnderlyingBuffer());
|
||||||
EXPECT_EQ(0, memcmp(allocation->getUnderlyingBuffer(), memory, size));
|
EXPECT_EQ(0, memcmp(allocation->getUnderlyingBuffer(), memory, size));
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ TEST(BlitCommandsHelperTest, GivenBufferParamsWhenConstructingPropertiesForReadW
|
|||||||
EXPECT_EQ(blitProperties.dstSlicePitch, dstSlicePitch);
|
EXPECT_EQ(blitProperties.dstSlicePitch, dstSlicePitch);
|
||||||
EXPECT_EQ(blitProperties.srcRowPitch, srcRowPitch);
|
EXPECT_EQ(blitProperties.srcRowPitch, srcRowPitch);
|
||||||
EXPECT_EQ(blitProperties.srcSlicePitch, srcSlicePitch);
|
EXPECT_EQ(blitProperties.srcSlicePitch, srcSlicePitch);
|
||||||
|
|
||||||
|
EXPECT_EQ(1u, blitProperties.dstAllocation->hostPtrTaskCountAssignment.load());
|
||||||
|
blitProperties.dstAllocation->hostPtrTaskCountAssignment--;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(BlitCommandsHelperTest, GivenBufferParamsWhenConstructingPropertiesForBufferRegionsThenPropertiesCreatedCorrectly) {
|
TEST(BlitCommandsHelperTest, GivenBufferParamsWhenConstructingPropertiesForBufferRegionsThenPropertiesCreatedCorrectly) {
|
||||||
|
|||||||
Reference in New Issue
Block a user