mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
Revert "fix: Crash on over memory allocation"
This reverts commit 212ccb8bd4.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fcb584299f
commit
83af0b77ff
@@ -15,7 +15,6 @@
|
||||
#include "shared/source/indirect_heap/indirect_heap.h"
|
||||
#include "shared/source/memory_manager/memory_banks.h"
|
||||
#include "shared/source/os_interface/linux/drm_memory_operations_handler.h"
|
||||
#include "shared/source/os_interface/linux/drm_memory_operations_handler_bind.h"
|
||||
#include "shared/source/os_interface/linux/i915.h"
|
||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
@@ -2571,32 +2570,6 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledThenRetu
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerAndResidentNeededbeforeLockWhenLockIsCalledThenverifyAllocationIsResident) {
|
||||
mock->ioctlExpected.gemWait = 1;
|
||||
mock->ioctlExpected.gemClose = 1;
|
||||
mock->ioctlExpected.gemMmapOffset = 1;
|
||||
mock->ioctlExpected.gemCreateExt = 1;
|
||||
|
||||
auto mockIoctlHelper = new MockIoctlHelper(*mock);
|
||||
mockIoctlHelper->makeResidentBeforeLockNeededResult = true;
|
||||
|
||||
auto &drm = static_cast<DrmMockCustom &>(memoryManager->getDrm(rootDeviceIndex));
|
||||
drm.ioctlHelper.reset(mockIoctlHelper);
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.reset(new DrmMemoryOperationsHandlerBind(*executionEnvironment->rootDeviceEnvironments[rootDeviceIndex].get(), 0));
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize, AllocationType::buffer});
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
|
||||
auto ptr = memoryManager->lockResource(allocation);
|
||||
EXPECT_NE(nullptr, ptr);
|
||||
|
||||
auto osContext = device->getDefaultEngine().osContext;
|
||||
EXPECT_TRUE(allocation->isAlwaysResident(osContext->getContextId()));
|
||||
|
||||
memoryManager->unlockResource(allocation);
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationWithCpuPtrThenReturnCpuPtrAndSetCpuDomain) {
|
||||
mock->ioctlExpected.gemUserptr = 1;
|
||||
mock->ioctlExpected.gemSetDomain = 1;
|
||||
|
||||
@@ -140,7 +140,7 @@ TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateAndNoLocalMemoryThe
|
||||
EXPECT_TRUE(xeIoctlHelper->bindInfo.empty());
|
||||
|
||||
EXPECT_EQ(size, drm->createParamsSize);
|
||||
EXPECT_EQ(static_cast<uint32_t>(DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING), (drm->createParamsFlags & DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING));
|
||||
EXPECT_EQ(0u, drm->createParamsFlags);
|
||||
EXPECT_EQ(DRM_XE_GEM_CPU_CACHING_WC, drm->createParamsCpuCaching);
|
||||
EXPECT_EQ(1u, drm->createParamsPlacement);
|
||||
|
||||
@@ -171,7 +171,7 @@ TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateWhenMemoryBanksZero
|
||||
|
||||
EXPECT_EQ(size, drm->createParamsSize);
|
||||
EXPECT_EQ(DRM_XE_GEM_CPU_CACHING_WC, drm->createParamsCpuCaching);
|
||||
EXPECT_EQ(static_cast<uint32_t>(DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING), (drm->createParamsFlags & DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING));
|
||||
EXPECT_EQ(0u, drm->createParamsFlags);
|
||||
EXPECT_EQ(1u, drm->createParamsPlacement);
|
||||
|
||||
// dummy mock handle
|
||||
@@ -201,7 +201,7 @@ TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateAndLocalMemoryThenP
|
||||
|
||||
EXPECT_EQ(size, drm->createParamsSize);
|
||||
EXPECT_EQ(DRM_XE_GEM_CPU_CACHING_WC, drm->createParamsCpuCaching);
|
||||
EXPECT_EQ(static_cast<uint32_t>(DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING), (drm->createParamsFlags & DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING));
|
||||
EXPECT_EQ(0u, drm->createParamsFlags);
|
||||
EXPECT_EQ(6u, drm->createParamsPlacement);
|
||||
|
||||
// dummy mock handle
|
||||
@@ -2515,13 +2515,6 @@ TEST_F(IoctlHelperXeTest, givenXeIoctlHelperWhenIsTimestampsRefreshEnabledCalled
|
||||
EXPECT_TRUE(xeIoctlHelper->isTimestampsRefreshEnabled());
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperXeTest, givenXeIoctlHelperWhenMakeResidentBeforeLockNeededIsCalledThenVerifyTrueIsReturned) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
|
||||
auto xeIoctlHelper = std::make_unique<IoctlHelperXe>(drm);
|
||||
EXPECT_TRUE(xeIoctlHelper->makeResidentBeforeLockNeeded());
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperXeTest, whenIoctlFailsOnQueryConfigSizeThenQueryDeviceIdAndRevisionFails) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
|
||||
|
||||
Reference in New Issue
Block a user