mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
feature: Introduce ULLS light
Add core implementation of ULLS without VM_BIND interface aka ULLS light. Related-To: NEO-13922 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
488ac4bb6a
commit
bc2b49b958
@@ -13,6 +13,7 @@
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/helpers/flush_stamp.h"
|
||||
#include "shared/source/os_interface/linux/drm_gem_close_worker.h"
|
||||
#include "shared/source/os_interface/linux/drm_memory_operations_handler.h"
|
||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
#include "shared/source/utilities/wait_util.h"
|
||||
@@ -117,7 +118,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenDrmDirectSubmissionWhenCallingLinuxImplem
|
||||
|
||||
uint64_t gpuAddress = 0x1000;
|
||||
size_t size = 0x1000;
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size));
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size, nullptr));
|
||||
|
||||
EXPECT_TRUE(drmDirectSubmission.handleResidency());
|
||||
|
||||
@@ -463,7 +464,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenNoCompletionFenceSupportWhenSubmittingThe
|
||||
|
||||
for (auto i = 0; i < 2; i++) {
|
||||
mockBO.passedExecParams.clear();
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size));
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size, nullptr));
|
||||
|
||||
ASSERT_EQ(1u, mockBO.passedExecParams.size());
|
||||
EXPECT_EQ(0u, mockBO.passedExecParams[0].completionGpuAddress);
|
||||
@@ -489,7 +490,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenNoCompletionFenceSupportAndExecFailureWhe
|
||||
ringBuffer->getBufferObjectToModify(0) = &mockBO;
|
||||
|
||||
mockBO.execReturnValue = ENXIO;
|
||||
EXPECT_FALSE(drmDirectSubmission.submit(gpuAddress, size));
|
||||
EXPECT_FALSE(drmDirectSubmission.submit(gpuAddress, size, nullptr));
|
||||
EXPECT_EQ((uint32_t)ENXIO, drmDirectSubmission.getDispatchErrorCode());
|
||||
|
||||
ringBuffer->getBufferObjectToModify(0) = initialBO;
|
||||
@@ -515,7 +516,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenCompletionFenceSupportAndExecFailureWhenS
|
||||
|
||||
mockBO.execReturnValue = 1;
|
||||
drmDirectSubmission.completionFenceValue = 1u;
|
||||
EXPECT_FALSE(drmDirectSubmission.submit(gpuAddress, size));
|
||||
EXPECT_FALSE(drmDirectSubmission.submit(gpuAddress, size, nullptr));
|
||||
EXPECT_EQ(1u, drmDirectSubmission.completionFenceValue);
|
||||
|
||||
ringBuffer->getBufferObjectToModify(0) = initialBO;
|
||||
@@ -551,7 +552,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenTile0AndCompletionFenceSupportWhenSubmitt
|
||||
|
||||
for (auto i = 0u; i < 2; i++) {
|
||||
mockBO.passedExecParams.clear();
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size));
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size, nullptr));
|
||||
|
||||
ASSERT_EQ(1u, mockBO.passedExecParams.size());
|
||||
EXPECT_EQ(completionFenceBaseGpuAddress, mockBO.passedExecParams[0].completionGpuAddress);
|
||||
@@ -595,7 +596,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenTile1AndCompletionFenceSupportWhenSubmitt
|
||||
|
||||
for (auto i = 0u; i < 2; i++) {
|
||||
mockBO.passedExecParams.clear();
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size));
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size, nullptr));
|
||||
|
||||
ASSERT_EQ(1u, mockBO.passedExecParams.size());
|
||||
EXPECT_EQ(completionFenceBaseGpuAddress, mockBO.passedExecParams[0].completionGpuAddress);
|
||||
@@ -644,7 +645,7 @@ HWTEST_F(DrmDirectSubmissionTest, givenTwoTilesAndCompletionFenceSupportWhenSubm
|
||||
|
||||
for (auto i = 0u; i < 2; i++) {
|
||||
mockBO.passedExecParams.clear();
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size));
|
||||
EXPECT_TRUE(drmDirectSubmission.submit(gpuAddress, size, nullptr));
|
||||
|
||||
ASSERT_EQ(2u, mockBO.passedExecParams.size());
|
||||
EXPECT_EQ(completionFenceBaseGpuAddress, mockBO.passedExecParams[0].completionGpuAddress);
|
||||
@@ -740,6 +741,101 @@ HWTEST_F(DrmDirectSubmissionTest, givenDirectSubmissionNewResourceTlbFlushWhenDi
|
||||
EXPECT_EQ(directSubmission.getSizeNewResourceHandler(), sizeof(PIPE_CONTROL));
|
||||
}
|
||||
|
||||
HWTEST_F(DrmDirectSubmissionTest, givenDirectSubmissionLightWhenRegisterResourcesThenRestart) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
|
||||
MockDrmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> drmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_TRUE(drmDirectSubmission.initialize(false));
|
||||
|
||||
FlushStampTracker flushStamp(true);
|
||||
BatchBuffer batchBuffer = {};
|
||||
GraphicsAllocation *commandBuffer = nullptr;
|
||||
LinearStream stream;
|
||||
|
||||
const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000,
|
||||
AllocationType::commandBuffer, device->getDeviceBitfield()};
|
||||
commandBuffer = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties);
|
||||
|
||||
stream.replaceGraphicsAllocation(commandBuffer);
|
||||
stream.replaceBuffer(commandBuffer->getUnderlyingBuffer(), commandBuffer->getUnderlyingBufferSize());
|
||||
stream.getSpace(0x20);
|
||||
|
||||
memset(stream.getCpuBase(), 0, 0x20);
|
||||
|
||||
batchBuffer.endCmdPtr = ptrOffset(stream.getCpuBase(), 0x20);
|
||||
batchBuffer.commandBufferAllocation = commandBuffer;
|
||||
batchBuffer.usedSize = 0x40;
|
||||
batchBuffer.taskStartAddress = 0x881112340000;
|
||||
batchBuffer.stream = &stream;
|
||||
batchBuffer.hasStallingCmds = true;
|
||||
|
||||
ResidencyContainer residencyContainer{};
|
||||
batchBuffer.allocationsForResidency = &residencyContainer;
|
||||
drmDirectSubmission.ringStart = true;
|
||||
|
||||
EXPECT_TRUE(drmDirectSubmission.dispatchCommandBuffer(batchBuffer, flushStamp));
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parsePipeControl = true;
|
||||
hwParse.parseCommands<FamilyType>(drmDirectSubmission.ringCommandStream, 0);
|
||||
hwParse.findHardwareCommands<FamilyType>();
|
||||
auto *pipeControl = hwParse.getCommand<PIPE_CONTROL>();
|
||||
EXPECT_NE(pipeControl, nullptr);
|
||||
auto *bbe = hwParse.getCommand<BATCH_BUFFER_END>();
|
||||
EXPECT_NE(bbe, nullptr);
|
||||
|
||||
drmDirectSubmission.ringStart = false;
|
||||
executionEnvironment.memoryManager->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
|
||||
HWTEST_F(DrmDirectSubmissionTest, givenDirectSubmissionLightWhenNoRegisteredResourcesThenNoRestart) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
|
||||
MockDrmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> drmDirectSubmission(*device->getDefaultEngine().commandStreamReceiver);
|
||||
EXPECT_TRUE(drmDirectSubmission.initialize(false));
|
||||
|
||||
FlushStampTracker flushStamp(true);
|
||||
BatchBuffer batchBuffer = {};
|
||||
GraphicsAllocation *commandBuffer = nullptr;
|
||||
LinearStream stream;
|
||||
|
||||
const AllocationProperties commandBufferProperties{device->getRootDeviceIndex(), 0x1000,
|
||||
AllocationType::commandBuffer, device->getDeviceBitfield()};
|
||||
commandBuffer = executionEnvironment.memoryManager->allocateGraphicsMemoryWithProperties(commandBufferProperties);
|
||||
|
||||
stream.replaceGraphicsAllocation(commandBuffer);
|
||||
stream.replaceBuffer(commandBuffer->getUnderlyingBuffer(), commandBuffer->getUnderlyingBufferSize());
|
||||
stream.getSpace(0x20);
|
||||
|
||||
memset(stream.getCpuBase(), 0, 0x20);
|
||||
|
||||
batchBuffer.endCmdPtr = ptrOffset(stream.getCpuBase(), 0x20);
|
||||
batchBuffer.commandBufferAllocation = commandBuffer;
|
||||
batchBuffer.usedSize = 0x40;
|
||||
batchBuffer.taskStartAddress = 0x881112340000;
|
||||
batchBuffer.stream = &stream;
|
||||
batchBuffer.hasStallingCmds = true;
|
||||
|
||||
ResidencyContainer residencyContainer{};
|
||||
batchBuffer.allocationsForResidency = &residencyContainer;
|
||||
drmDirectSubmission.ringStart = true;
|
||||
static_cast<DrmMemoryOperationsHandler *>(executionEnvironment.rootDeviceEnvironments[device->getRootDeviceIndex()]->memoryOperationsInterface.get())->obtainAndResetNewResourcesSinceLastRingSubmit();
|
||||
|
||||
EXPECT_TRUE(drmDirectSubmission.dispatchCommandBuffer(batchBuffer, flushStamp));
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parsePipeControl = true;
|
||||
hwParse.parseCommands<FamilyType>(drmDirectSubmission.ringCommandStream, 0);
|
||||
hwParse.findHardwareCommands<FamilyType>();
|
||||
auto *pipeControl = hwParse.getCommand<PIPE_CONTROL>();
|
||||
EXPECT_EQ(pipeControl, nullptr);
|
||||
auto *bbe = hwParse.getCommand<BATCH_BUFFER_END>();
|
||||
EXPECT_EQ(bbe, nullptr);
|
||||
|
||||
drmDirectSubmission.ringStart = false;
|
||||
executionEnvironment.memoryManager->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
|
||||
HWTEST_F(DrmDirectSubmissionTest, givenNewResourceBoundWhenDispatchCommandBufferThenTlbIsFlushed) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using Dispatcher = RenderDispatcher<FamilyType>;
|
||||
|
||||
@@ -187,7 +187,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmWhenSubmitingCmdBufferThenExpectPass
|
||||
|
||||
uint64_t gpuAddress = 0xFF00FF000;
|
||||
size_t size = 0xF0;
|
||||
ret = wddmDirectSubmission.submit(gpuAddress, size);
|
||||
ret = wddmDirectSubmission.submit(gpuAddress, size, nullptr);
|
||||
EXPECT_TRUE(ret);
|
||||
EXPECT_EQ(1u, wddm->submitResult.called);
|
||||
EXPECT_EQ(gpuAddress, wddm->submitResult.commandBufferSubmitted);
|
||||
@@ -718,7 +718,7 @@ HWTEST_F(WddmDirectSubmissionTest, givenWddmResidencyEnabledWhenSubmitToGpuThenS
|
||||
uint64_t gpuAddress = 0xF000;
|
||||
size_t size = 0xFF000;
|
||||
|
||||
bool ret = wddmDirectSubmission.submit(gpuAddress, size);
|
||||
bool ret = wddmDirectSubmission.submit(gpuAddress, size, nullptr);
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
EXPECT_EQ(1u, NEO::IoFunctions::mockFopenCalled);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/os_interface/linux/drm_buffer_object.h"
|
||||
#include "shared/source/os_interface/linux/drm_command_stream.h"
|
||||
#include "shared/source/os_interface/linux/drm_memory_operations_handler_default.h"
|
||||
#include "shared/source/os_interface/linux/i915.h"
|
||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
@@ -822,10 +823,19 @@ struct MockDrmDirectSubmissionToTestDtor : public DrmDirectSubmission<GfxFamily,
|
||||
};
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenEnabledDirectSubmissionWhenCheckingIsKmdWaitOnTaskCountAllowedThenTrueIsReturned) {
|
||||
mock->isVmBindAvailableCall.callParent = false;
|
||||
mock->isVmBindAvailableCall.returnValue = true;
|
||||
EXPECT_TRUE(csr->isDirectSubmissionEnabled());
|
||||
EXPECT_TRUE(csr->isKmdWaitOnTaskCountAllowed());
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenEnabledDirectSubmissionAndDisabledBindWhenCheckingIsKmdWaitOnTaskCountAllowedThenFalseIsReturned) {
|
||||
mock->isVmBindAvailableCall.callParent = false;
|
||||
mock->isVmBindAvailableCall.returnValue = false;
|
||||
EXPECT_TRUE(csr->isDirectSubmissionEnabled());
|
||||
EXPECT_FALSE(csr->isKmdWaitOnTaskCountAllowed());
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenEnabledDirectSubmissionWhenDtorIsCalledButRingIsNotStartedThenDontCallStopRingBufferNorWaitForTagValue) {
|
||||
DrmDirectSubmissionFunctionsCalled functionsCalled{};
|
||||
auto directSubmission = std::make_unique<MockDrmDirectSubmissionToTestDtor<FamilyType>>(*device->getDefaultEngine().commandStreamReceiver, functionsCalled);
|
||||
@@ -926,6 +936,32 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBlitterDirectSubmissionTest, givenBlitterDire
|
||||
EXPECT_NE(NEO::SubmissionStatus::success, res);
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenDirectSubmissionLightWhenNewResourcesAddedThenAddToResidencyContainer) {
|
||||
auto testedCsr = static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr);
|
||||
testedCsr->completionFenceValuePointer = nullptr;
|
||||
testedCsr->directSubmission = std::make_unique<MockDrmDirectSubmissionDispatchCommandBuffer<FamilyType>>(*device->getDefaultEngine().commandStreamReceiver);
|
||||
auto oldMemoryOperationsInterface = executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.release();
|
||||
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface = std::make_unique<DrmMemoryOperationsHandlerDefault>(device->getRootDeviceIndex());
|
||||
|
||||
EXPECT_EQ(csr->getResidencyAllocations().size(), 0u);
|
||||
EXPECT_FALSE(static_cast<DrmMemoryOperationsHandlerDefault *>(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.get())->obtainAndResetNewResourcesSinceLastRingSubmit());
|
||||
|
||||
auto &cs = csr->getCS();
|
||||
CommandStreamReceiverHw<FamilyType>::addBatchBufferEnd(cs, nullptr);
|
||||
EncodeNoop<FamilyType>::alignToCacheLine(cs);
|
||||
BatchBuffer batchBuffer = BatchBufferHelper::createDefaultBatchBuffer(cs.getGraphicsAllocation(), &cs, cs.getUsed());
|
||||
batchBuffer.startOffset = 4;
|
||||
uint8_t bbStart[64];
|
||||
batchBuffer.endCmdPtr = &bbStart[0];
|
||||
|
||||
csr->flush(batchBuffer, csr->getResidencyAllocations());
|
||||
|
||||
EXPECT_NE(csr->getResidencyAllocations().size(), 0u);
|
||||
EXPECT_TRUE(static_cast<DrmMemoryOperationsHandlerDefault *>(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.get())->obtainAndResetNewResourcesSinceLastRingSubmit());
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.reset(oldMemoryOperationsInterface);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct MockDrmDirectSubmission : public DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>> {
|
||||
using DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>::currentTagData;
|
||||
|
||||
@@ -75,7 +75,7 @@ TEST_F(DrmMemoryOperationsHandlerBaseTest, whenMakingAllocationResidentThenAlloc
|
||||
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->makeResident(nullptr, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1), false, false), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandler->residency.find(allocationPtr) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandler->residency.begin(), drmMemoryOperationsHandler->residency.end(), drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->isResident(nullptr, *allocationPtr), MemoryOperationsStatus::success);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_F(DrmMemoryOperationsHandlerBaseTest, whenEvictingResidentAllocationThenAll
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->makeResident(nullptr, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1), false, false), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->isResident(nullptr, *allocationPtr), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandler->residency.find(allocationPtr) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandler->residency.begin(), drmMemoryOperationsHandler->residency.end(), drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->evict(nullptr, *allocationPtr), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->isResident(nullptr, *allocationPtr), MemoryOperationsStatus::memoryNotFound);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->residency.size(), 0u);
|
||||
@@ -99,7 +99,7 @@ TEST_F(DrmMemoryOperationsHandlerBaseTest, whenLockingAllocationThenAllocationIs
|
||||
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->lock(nullptr, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1)), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandler->residency.find(drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandler->residency.begin(), drmMemoryOperationsHandler->residency.end(), drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->isResident(nullptr, *drmAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_TRUE(drmAllocation->isLockedMemory());
|
||||
EXPECT_TRUE(mockBos[0]->isExplicitLockedMemoryRequired());
|
||||
@@ -114,7 +114,7 @@ TEST_F(DrmMemoryOperationsHandlerBaseTest, whenEvictingLockedAllocationThenAlloc
|
||||
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->lock(nullptr, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1)), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->isResident(nullptr, *drmAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandler->residency.find(drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandler->residency.begin(), drmMemoryOperationsHandler->residency.end(), drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmAllocation->isLockedMemory());
|
||||
EXPECT_TRUE(mockBos[0]->isExplicitLockedMemoryRequired());
|
||||
@@ -134,7 +134,7 @@ TEST_F(DrmMemoryOperationsHandlerBaseTest, whenEvictingLockedAllocationWithMulti
|
||||
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->lock(nullptr, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1)), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->isResident(nullptr, *drmAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandler->residency.find(drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandler->residency.begin(), drmMemoryOperationsHandler->residency.end(), drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmAllocation->isLockedMemory());
|
||||
EXPECT_TRUE(mockBos[0]->isExplicitLockedMemoryRequired());
|
||||
@@ -157,7 +157,7 @@ TEST_F(DrmMemoryOperationsHandlerBaseTest, whenEvictingLockedAllocationWithChunk
|
||||
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->lock(nullptr, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1)), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->isResident(nullptr, *drmAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandler->residency.find(drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandler->residency.begin(), drmMemoryOperationsHandler->residency.end(), drmAllocation) != drmMemoryOperationsHandler->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandler->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmAllocation->isLockedMemory());
|
||||
EXPECT_TRUE(mockBos[0]->isExplicitLockedMemoryRequired());
|
||||
|
||||
@@ -55,7 +55,7 @@ struct DrmMemoryOperationsHandlerWithAubDumpTest : public ::testing::Test {
|
||||
TEST_F(DrmMemoryOperationsHandlerWithAubDumpTest, whenMakingAllocationResidentThenAllocationIsResident) {
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->makeResident(nullptr, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1), false, false), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandlerWithAubDumpMock->residency.find(allocationPtr) != drmMemoryOperationsHandlerWithAubDumpMock->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandlerWithAubDumpMock->residency.begin(), drmMemoryOperationsHandlerWithAubDumpMock->residency.end(), allocationPtr) != drmMemoryOperationsHandlerWithAubDumpMock->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->isResident(nullptr, graphicsAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_TRUE(mockAubMemoryOperationsHandler->makeResidentCalled);
|
||||
EXPECT_TRUE(mockAubMemoryOperationsHandler->isResidentCalled);
|
||||
@@ -68,7 +68,7 @@ TEST_F(DrmMemoryOperationsHandlerWithAubDumpTest, givenRegularAllocationWhenFree
|
||||
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->makeResident(device.get(), ArrayRef<GraphicsAllocation *>(&allocationPtr, 1), false, false), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandlerWithAubDumpMock->residency.find(allocationPtr) != drmMemoryOperationsHandlerWithAubDumpMock->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandlerWithAubDumpMock->residency.begin(), drmMemoryOperationsHandlerWithAubDumpMock->residency.end(), allocationPtr) != drmMemoryOperationsHandlerWithAubDumpMock->residency.end());
|
||||
EXPECT_EQ(1u, mockAubMemoryOperationsHandler->residentAllocations.size());
|
||||
|
||||
drmMemoryOperationsHandlerWithAubDumpMock->free(device.get(), *allocationPtr);
|
||||
@@ -93,7 +93,7 @@ TEST_F(DrmMemoryOperationsHandlerWithAubDumpTest, whenEvictingResidentAllocation
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->makeResident(nullptr, ArrayRef<GraphicsAllocation *>(&mockDrmAllocation, 1), false, false), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->isResident(nullptr, *mockDrmAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandlerWithAubDumpMock->residency.find(mockDrmAllocation) != drmMemoryOperationsHandlerWithAubDumpMock->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandlerWithAubDumpMock->residency.begin(), drmMemoryOperationsHandlerWithAubDumpMock->residency.end(), mockDrmAllocation) != drmMemoryOperationsHandlerWithAubDumpMock->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->evict(nullptr, *mockDrmAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->isResident(nullptr, *mockDrmAllocation), MemoryOperationsStatus::memoryNotFound);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->residency.size(), 0u);
|
||||
@@ -119,7 +119,7 @@ TEST_F(DrmMemoryOperationsHandlerWithAubDumpTest, whenEvictingLockedAllocationTh
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->lock(nullptr, ArrayRef<GraphicsAllocation *>(&mockDrmAllocation, 1)), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->isResident(nullptr, *mockDrmAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->residency.size(), 1u);
|
||||
EXPECT_TRUE(drmMemoryOperationsHandlerWithAubDumpMock->residency.find(mockDrmAllocation) != drmMemoryOperationsHandlerWithAubDumpMock->residency.end());
|
||||
EXPECT_TRUE(std::find(drmMemoryOperationsHandlerWithAubDumpMock->residency.begin(), drmMemoryOperationsHandlerWithAubDumpMock->residency.end(), mockDrmAllocation) != drmMemoryOperationsHandlerWithAubDumpMock->residency.end());
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->evict(nullptr, *mockDrmAllocation), MemoryOperationsStatus::success);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->isResident(nullptr, *mockDrmAllocation), MemoryOperationsStatus::memoryNotFound);
|
||||
EXPECT_EQ(drmMemoryOperationsHandlerWithAubDumpMock->residency.size(), 0u);
|
||||
|
||||
Reference in New Issue
Block a user