mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add debug flag for BO mmap creation
Change-Id: I1b0dc8b9328bf3aab64ceeaf9f1c5aeb4199eb08 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
9e463ab45f
commit
99f0d2b1db
@ -244,6 +244,9 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenDrmMemoryManagerWhenCreateBufferObj
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerLocalMemoryTest, givenMemoryInfoWhenAllocateWithAlignmentThenGemCreateExtIsUsed) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableBOMmapCreate.set(-1);
|
||||
|
||||
drm_i915_memory_region_info regionInfo[2] = {};
|
||||
regionInfo[0].region = {I915_MEMORY_CLASS_SYSTEM, 0};
|
||||
regionInfo[1].region = {I915_MEMORY_CLASS_DEVICE, 0};
|
||||
@ -263,6 +266,9 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenMemoryInfoWhenAllocateWithAlignment
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerLocalMemoryTest, givenMemoryInfoAndFailedMmapOffsetWhenAllocateWithAlignmentThenNullptr) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableBOMmapCreate.set(-1);
|
||||
|
||||
drm_i915_memory_region_info regionInfo[2] = {};
|
||||
regionInfo[0].region = {I915_MEMORY_CLASS_SYSTEM, 0};
|
||||
regionInfo[1].region = {I915_MEMORY_CLASS_DEVICE, 0};
|
||||
@ -279,7 +285,32 @@ TEST_F(DrmMemoryManagerLocalMemoryTest, givenMemoryInfoAndFailedMmapOffsetWhenAl
|
||||
mock->mmapOffsetRetVal = 0;
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerLocalMemoryTest, givenMemoryInfoAndDisabledMmapBOCreationtWhenAllocateWithAlignmentThenUserptrIsUsed) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableBOMmapCreate.set(0);
|
||||
|
||||
drm_i915_memory_region_info regionInfo[2] = {};
|
||||
regionInfo[0].region = {I915_MEMORY_CLASS_SYSTEM, 0};
|
||||
regionInfo[1].region = {I915_MEMORY_CLASS_DEVICE, 0};
|
||||
|
||||
mock->memoryInfo.reset(new MemoryInfoImpl(regionInfo, 2));
|
||||
mock->mmapOffsetRetVal = -1;
|
||||
|
||||
AllocationData allocationData;
|
||||
allocationData.size = MemoryConstants::pageSize64k;
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithAlignment(allocationData);
|
||||
|
||||
EXPECT_NE(allocation, nullptr);
|
||||
EXPECT_EQ(static_cast<int>(mock->returnHandle), allocation->getBO()->peekHandle() + 1);
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerLocalMemoryTest, givenMemoryInfoAndFailedGemCreateExtWhenAllocateWithAlignmentThenNullptr) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableBOMmapCreate.set(-1);
|
||||
|
||||
drm_i915_memory_region_info regionInfo[2] = {};
|
||||
regionInfo[0].region = {I915_MEMORY_CLASS_SYSTEM, 0};
|
||||
regionInfo[1].region = {I915_MEMORY_CLASS_DEVICE, 0};
|
||||
|
@ -101,6 +101,7 @@ UseNoRingFlushesKmdMode = 1
|
||||
DisableZeroCopyForUseHostPtr = 0
|
||||
DisableZeroCopyForBuffers = 0
|
||||
DisableDcFlushInEpilogue = 0
|
||||
EnableBOMmapCreate = 0
|
||||
EnableHostPtrTracking = -1
|
||||
EnableNV12 = 1
|
||||
EnablePackedYuv = 1
|
||||
|
Reference in New Issue
Block a user