Skip to content

Commit ca4ecdf

Browse files
L0Debug - map VM to tile based on context engines
- make ISAallocation aware of tileInstanced allocation Related-To: NEO-5784 Signed-off-by: Mateusz Hoppe <[email protected]>
1 parent 7ccde3f commit ca4ecdf

File tree

5 files changed

+198
-12
lines changed

5 files changed

+198
-12
lines changed

level_zero/tools/source/debug/linux/prelim/debug_session.cpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ void DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v
714714
auto vmHandle = vmBind->vm_handle;
715715
uint32_t index = 0;
716716
auto connection = clientHandleToConnection[vmBind->client_handle].get();
717-
auto uuid = vmBind->uuids[index];
717+
const auto uuid = vmBind->uuids[index];
718718

719719
if (connection->uuidMap.find(uuid) == connection->uuidMap.end()) {
720720
PRINT_DEBUGGER_ERROR_LOG("Unknown UUID handle = %llu\n", (uint64_t)uuid);
@@ -747,18 +747,24 @@ void DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v
747747
if (connection->uuidMap[uuid].classIndex == NEO::DrmResourceClass::Isa) {
748748
PRINT_DEBUGGER_INFO_LOG("ISA vm_handle = %llu", (uint64_t)vmHandle);
749749

750+
const auto isaUuidHandle = connection->uuidMap[uuid].handle;
750751
bool perKernelModules = true;
751752
int moduleUUIDindex = -1;
753+
bool tileInstanced = false;
752754

753755
for (uint32_t uuidIter = 1; uuidIter < vmBind->num_uuids; uuidIter++) {
754756
if (connection->uuidMap[vmBind->uuids[uuidIter]].classIndex == NEO::DrmResourceClass::L0ZebinModule) {
755757
perKernelModules = false;
756758
moduleUUIDindex = static_cast<int>(uuidIter);
757759
}
760+
761+
if (connection->uuidMap[vmBind->uuids[uuidIter]].classHandle == isaUuidHandle) {
762+
tileInstanced = true;
763+
}
758764
}
759765

760766
if (connection->isaMap.find(vmBind->va_start) == connection->isaMap.end() && createEvent) {
761-
auto isaUuidHandle = connection->uuidMap[vmBind->uuids[index]].handle;
767+
762768
auto &isaMap = connection->isaMap;
763769
auto &elfMap = connection->elfMap;
764770

@@ -768,6 +774,7 @@ void DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v
768774
isa->elfUuidHandle = invalidHandle;
769775
isa->moduleBegin = 0;
770776
isa->moduleEnd = 0;
777+
isa->tileInstanced = tileInstanced;
771778

772779
for (index = 1; index < vmBind->num_uuids; index++) {
773780
if (connection->uuidMap[vmBind->uuids[index]].classIndex == NEO::DrmResourceClass::Elf) {
@@ -780,10 +787,6 @@ void DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v
780787
module.elfUuidHandle = vmBind->uuids[index];
781788
}
782789
}
783-
784-
if (connection->uuidMap[vmBind->uuids[index]].classHandle == isaUuidHandle) {
785-
isa->cookies.emplace(static_cast<uint64_t>(vmBind->uuids[index]));
786-
}
787790
}
788791

789792
if (isa->elfUuidHandle != invalidHandle) {
@@ -938,7 +941,7 @@ void DebugSessionLinux::handleContextParamEvent(prelim_drm_i915_debug_event_cont
938941
clientHandleToConnection[contextParam->client_handle]->contextsCreated[contextParam->ctx_handle].vm = contextParam->param.value;
939942
break;
940943
case I915_CONTEXT_PARAM_ENGINES: {
941-
PRINT_DEBUGGER_INFO_LOG("I915_CONTEXT_PARAM_ENGINES ctx_id = %lu param = %llu value = %llu size = %lu \n",
944+
PRINT_DEBUGGER_INFO_LOG("I915_CONTEXT_PARAM_ENGINES ctx_id = %lu param = %llu value = %llu size = %lu",
942945
(uint32_t)contextParam->param.ctx_id,
943946
(uint64_t)contextParam->param.param,
944947
(uint64_t)contextParam->param.value, (uint32_t)contextParam->param.size);
@@ -951,6 +954,16 @@ void DebugSessionLinux::handleContextParamEvent(prelim_drm_i915_debug_event_cont
951954
for (uint32_t i = 0; i < numEngines; i++) {
952955
clientHandleToConnection[contextParam->client_handle]->contextsCreated[contextParam->ctx_handle].engines.push_back(engines->engines[i]);
953956
}
957+
958+
auto vm = clientHandleToConnection[contextParam->client_handle]->contextsCreated[contextParam->ctx_handle].vm;
959+
if (numEngines && vm != invalidHandle) {
960+
NEO::EngineClassInstance engineClassInstance = {engines->engines[0].engine_class, engines->engines[0].engine_instance};
961+
auto tileIndex = DrmHelper::getEngineTileIndex(connectedDevice, engineClassInstance);
962+
clientHandleToConnection[contextParam->client_handle]->vmToTile[vm] = tileIndex;
963+
964+
PRINT_DEBUGGER_INFO_LOG("VM = %llu mapped to TILE = %lu\n", vm, tileIndex);
965+
}
966+
954967
break;
955968
}
956969
default:

level_zero/tools/source/debug/linux/prelim/debug_session.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ struct DebugSessionLinux : DebugSessionImp {
106106
BindInfo bindInfo;
107107
uint64_t elfUuidHandle;
108108
uint64_t vmHandle;
109+
bool tileInstanced = false;
109110

110111
uint64_t moduleBegin;
111112
uint64_t moduleEnd;
@@ -138,6 +139,7 @@ struct DebugSessionLinux : DebugSessionImp {
138139
std::unordered_map<uint64_t, BindInfo> vmToModuleDebugAreaBindInfo;
139140
std::unordered_map<uint64_t, BindInfo> vmToContextStateSaveAreaBindInfo;
140141
std::unordered_map<uint64_t, BindInfo> vmToStateBaseAreaBindInfo;
142+
std::unordered_map<uint64_t, uint32_t> vmToTile;
141143

142144
std::unordered_map<uint64_t, std::unique_ptr<IsaAllocation>> isaMap;
143145
std::unordered_map<uint64_t, uint64_t> elfMap;

level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp

Lines changed: 151 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3992,8 +3992,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithAckNeededForIsaWhenHandlingE
39923992
EXPECT_EQ(isaSize, isaAllocation->bindInfo.size);
39933993
EXPECT_EQ(elfUUID, isaAllocation->elfUuidHandle);
39943994
EXPECT_EQ(3u, isaAllocation->vmHandle);
3995-
EXPECT_EQ(1u, isaAllocation->cookies.size());
3996-
EXPECT_EQ(cookieUUID, *isaAllocation->cookies.begin());
3995+
EXPECT_TRUE(isaAllocation->tileInstanced);
39973996

39983997
ASSERT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->eventsToAck.size());
39993998
auto eventToAck = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->eventsToAck[0].second;
@@ -4002,6 +4001,82 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithAckNeededForIsaWhenHandlingE
40024001
EXPECT_EQ(0u, handler->debugEventAcked.seqno);
40034002
}
40044003

4004+
TEST_F(DebugApiLinuxVmBindTest, GivenCookieWhenHandlingVmBindForIsaThenIsaAllocationIsTileInstanced) {
4005+
uint64_t isaGpuVa = 0x345000;
4006+
uint64_t isaSize = 0x2000;
4007+
uint64_t vmBindIsaData[sizeof(prelim_drm_i915_debug_event_vm_bind) / sizeof(uint64_t) + 3 * sizeof(typeOfUUID)];
4008+
prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast<prelim_drm_i915_debug_event_vm_bind *>(&vmBindIsaData);
4009+
4010+
vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND;
4011+
vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK;
4012+
vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID);
4013+
vmBindIsa->base.seqno = 3;
4014+
vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle;
4015+
vmBindIsa->va_start = isaGpuVa;
4016+
vmBindIsa->va_length = isaSize;
4017+
vmBindIsa->vm_handle = vmHandleForVmBind;
4018+
vmBindIsa->num_uuids = 3;
4019+
4020+
auto *uuids = reinterpret_cast<typeOfUUID *>(ptrOffset(vmBindIsaData, sizeof(prelim_drm_i915_debug_event_vm_bind)));
4021+
typeOfUUID uuidsTemp[3];
4022+
uuidsTemp[0] = static_cast<typeOfUUID>(isaUUID);
4023+
uuidsTemp[1] = static_cast<typeOfUUID>(cookieUUID);
4024+
uuidsTemp[2] = static_cast<typeOfUUID>(elfUUID);
4025+
memcpy(uuids, uuidsTemp, sizeof(uuidsTemp));
4026+
4027+
session->handleEvent(&vmBindIsa->base);
4028+
4029+
auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap;
4030+
4031+
EXPECT_EQ(1u, isaMap.size());
4032+
EXPECT_NE(isaMap.end(), isaMap.find(isaGpuVa));
4033+
4034+
auto isaAllocation = isaMap[isaGpuVa].get();
4035+
EXPECT_EQ(isaGpuVa, isaAllocation->bindInfo.gpuVa);
4036+
EXPECT_EQ(isaSize, isaAllocation->bindInfo.size);
4037+
EXPECT_EQ(elfUUID, isaAllocation->elfUuidHandle);
4038+
EXPECT_EQ(3u, isaAllocation->vmHandle);
4039+
EXPECT_TRUE(isaAllocation->tileInstanced);
4040+
}
4041+
4042+
TEST_F(DebugApiLinuxVmBindTest, GivenNoCookieWhenHandlingVmBindForIsaThenIsaAllocationIsNotTileInstanced) {
4043+
uint64_t isaGpuVa = 0x345000;
4044+
uint64_t isaSize = 0x2000;
4045+
uint64_t vmBindIsaData[sizeof(prelim_drm_i915_debug_event_vm_bind) / sizeof(uint64_t) + 3 * sizeof(typeOfUUID)];
4046+
prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast<prelim_drm_i915_debug_event_vm_bind *>(&vmBindIsaData);
4047+
4048+
vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND;
4049+
vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK;
4050+
vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID);
4051+
vmBindIsa->base.seqno = 3;
4052+
vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle;
4053+
vmBindIsa->va_start = isaGpuVa;
4054+
vmBindIsa->va_length = isaSize;
4055+
vmBindIsa->vm_handle = vmHandleForVmBind;
4056+
vmBindIsa->num_uuids = 2;
4057+
4058+
auto *uuids = reinterpret_cast<typeOfUUID *>(ptrOffset(vmBindIsaData, sizeof(prelim_drm_i915_debug_event_vm_bind)));
4059+
4060+
typeOfUUID uuidsTemp[2];
4061+
uuidsTemp[0] = static_cast<typeOfUUID>(isaUUID);
4062+
uuidsTemp[1] = static_cast<typeOfUUID>(elfUUID);
4063+
memcpy(uuids, uuidsTemp, sizeof(uuidsTemp));
4064+
4065+
session->handleEvent(&vmBindIsa->base);
4066+
4067+
auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap;
4068+
4069+
EXPECT_EQ(1u, isaMap.size());
4070+
EXPECT_NE(isaMap.end(), isaMap.find(isaGpuVa));
4071+
4072+
auto isaAllocation = isaMap[isaGpuVa].get();
4073+
EXPECT_EQ(isaGpuVa, isaAllocation->bindInfo.gpuVa);
4074+
EXPECT_EQ(isaSize, isaAllocation->bindInfo.size);
4075+
EXPECT_EQ(elfUUID, isaAllocation->elfUuidHandle);
4076+
EXPECT_EQ(3u, isaAllocation->vmHandle);
4077+
EXPECT_FALSE(isaAllocation->tileInstanced);
4078+
}
4079+
40054080
TEST_F(DebugApiLinuxVmBindTest, GivenTwoVmBindEventForTheSameIsaInDifferentVMWhenHandlingEventThenIsaVmHandleIsNotOverriden) {
40064081
uint64_t isaGpuVa = 0x345000;
40074082
uint64_t isaSize = 0x2000;
@@ -4781,6 +4856,7 @@ TEST_F(DebugApiLinuxTest, GivenContextParamEventWhenTypeIsParamEngineThenEventIs
47814856
uint32_t contextHandle = 20;
47824857

47834858
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle;
4859+
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].vm = vmId;
47844860
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.insert(vmId);
47854861

47864862
constexpr auto size = sizeof(prelim_drm_i915_debug_event_context_param) + sizeof(i915_context_param_engines) + sizeof(i915_engine_class_instance);
@@ -4824,10 +4900,83 @@ TEST_F(DebugApiLinuxTest, GivenContextParamEventWhenTypeIsParamEngineThenEventIs
48244900
EXPECT_EQ(static_cast<uint32_t>(I915_ENGINE_CLASS_RENDER), session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_class);
48254901
EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_instance);
48264902

4903+
EXPECT_NE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.end(),
4904+
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.find(vmId));
4905+
EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vmId]);
4906+
48274907
auto infoMessage = ::testing::internal::GetCapturedStdout();
48284908
EXPECT_TRUE(hasSubstr(infoMessage, std::string("I915_CONTEXT_PARAM_ENGINES ctx_id = 20 param = 10 value = 0")));
48294909
}
48304910

4911+
TEST_F(DebugApiLinuxTest, GivenNoVmIdWhenOrZeroEnginesContextParamEventIsHandledThenVmToTileIsNotSet) {
4912+
zet_debug_config_t config = {};
4913+
config.pid = 0x1234;
4914+
4915+
auto session = std::make_unique<MockDebugSessionLinux>(config, device, 10);
4916+
ASSERT_NE(nullptr, session);
4917+
session->clientHandle = DebugSessionLinux::invalidClientHandle;
4918+
4919+
uint64_t vmId = 10;
4920+
uint32_t contextHandle = 20;
4921+
4922+
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle;
4923+
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].vm = MockDebugSessionLinux::invalidHandle;
4924+
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.insert(vmId);
4925+
4926+
constexpr auto size = sizeof(prelim_drm_i915_debug_event_context_param) + sizeof(i915_context_param_engines) + sizeof(i915_engine_class_instance);
4927+
4928+
auto memory = alignedMalloc(size, sizeof(prelim_drm_i915_debug_event_context_param));
4929+
auto *contextParamEvent = static_cast<prelim_drm_i915_debug_event_context_param *>(memory);
4930+
4931+
{
4932+
contextParamEvent->base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM;
4933+
contextParamEvent->base.flags = 0;
4934+
contextParamEvent->base.size = size;
4935+
contextParamEvent->client_handle = MockDebugSessionLinux::mockClientHandle;
4936+
contextParamEvent->ctx_handle = contextHandle;
4937+
}
4938+
4939+
auto offset = offsetof(prelim_drm_i915_debug_event_context_param, param);
4940+
4941+
GemContextParam paramToCopy = {};
4942+
paramToCopy.contextId = contextHandle;
4943+
paramToCopy.size = sizeof(i915_context_param_engines) + sizeof(i915_engine_class_instance);
4944+
paramToCopy.param = I915_CONTEXT_PARAM_ENGINES;
4945+
paramToCopy.value = 0;
4946+
memcpy(ptrOffset(memory, offset), &paramToCopy, sizeof(GemContextParam));
4947+
4948+
auto valueOffset = offsetof(GemContextParam, value);
4949+
auto *engines = ptrOffset(memory, offset + valueOffset);
4950+
i915_context_param_engines enginesParam;
4951+
enginesParam.extensions = 0;
4952+
memcpy(engines, &enginesParam, sizeof(i915_context_param_engines));
4953+
4954+
auto enginesOffset = offsetof(i915_context_param_engines, engines);
4955+
auto *classInstance = ptrOffset(memory, offset + valueOffset + enginesOffset);
4956+
i915_engine_class_instance ci = {I915_ENGINE_CLASS_RENDER, 1};
4957+
memcpy(classInstance, &ci, sizeof(i915_engine_class_instance));
4958+
4959+
session->handleEvent(&contextParamEvent->base);
4960+
4961+
EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines.size());
4962+
EXPECT_EQ(static_cast<uint32_t>(I915_ENGINE_CLASS_RENDER), session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_class);
4963+
EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_instance);
4964+
4965+
EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.end(),
4966+
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.find(MockDebugSessionLinux::invalidHandle));
4967+
4968+
paramToCopy.size = sizeof(i915_context_param_engines);
4969+
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].vm = vmId;
4970+
memcpy(ptrOffset(memory, offset), &paramToCopy, sizeof(GemContextParam));
4971+
4972+
session->handleEvent(&contextParamEvent->base);
4973+
4974+
EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.end(),
4975+
session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.find(vmId));
4976+
4977+
alignedFree(memory);
4978+
}
4979+
48314980
TEST_F(DebugApiLinuxTest, GivenDebuggerErrorLogsWhenContextParamWithInvalidContextIsHandledThenErrorIsPrinted) {
48324981
DebugManagerStateRestore restorer;
48334982
NEO::DebugManager.flags.DebuggerLogBitmask.set(NEO::DebugVariables::DEBUGGER_LOG_BITMASK::LOG_ERROR);

shared/source/os_interface/linux/drm_allocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void DrmAllocation::registerBOBindExtHandle(Drm *drm) {
205205
if (bo) {
206206
bo->addBindExtHandle(handle);
207207
bo->markForCapture();
208-
if (resourceClass == DrmResourceClass::Isa) {
208+
if (resourceClass == DrmResourceClass::Isa && storageInfo.tileInstanced == true) {
209209
auto cookieHandle = drm->registerIsaCookie(handle);
210210
bo->addBindExtHandle(cookieHandle);
211211
registeredBoBindHandles.push_back(cookieHandle);

shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3488,7 +3488,7 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenAllocationIsRegis
34883488
EXPECT_TRUE(bo.isImmediateBindingRequired());
34893489
}
34903490

3491-
TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenIsaIsRegisteredThenCookieIsAddedToBoHandle) {
3491+
TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledAndTileInstancedIsaWhenIsaIsRegisteredThenCookieIsAddedToBoHandle) {
34923492
DrmMockResources drm(*executionEnvironment->rootDeviceEnvironments[0]);
34933493

34943494
for (uint32_t i = 3; i < 3 + static_cast<uint32_t>(DrmResourceClass::MaxSize); i++) {
@@ -3498,7 +3498,8 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenIsaIsRegisteredTh
34983498
drm.registeredClass = DrmResourceClass::MaxSize;
34993499

35003500
MockBufferObject bo(&drm, 3, 0, 0, 1);
3501-
MockDrmAllocation allocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages);
3501+
MockDrmAllocation allocation(AllocationType::KERNEL_ISA, MemoryPool::LocalMemory);
3502+
allocation.storageInfo.tileInstanced = true;
35023503
allocation.bufferObjects[0] = &bo;
35033504
allocation.registerBOBindExtHandle(&drm);
35043505
EXPECT_EQ(2u, bo.bindExtHandles.size());
@@ -3510,6 +3511,27 @@ TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledWhenIsaIsRegisteredTh
35103511
EXPECT_EQ(2u, drm.unregisterCalledCount);
35113512
}
35123513

3514+
TEST_F(DrmAllocationTests, givenResourceRegistrationEnabledAndSingleInstanceIsaWhenIsaIsRegisteredThenCookieIsNotAddedToBoHandle) {
3515+
DrmMockResources drm(*executionEnvironment->rootDeviceEnvironments[0]);
3516+
3517+
for (uint32_t i = 3; i < 3 + static_cast<uint32_t>(DrmResourceClass::MaxSize); i++) {
3518+
drm.classHandles.push_back(i);
3519+
}
3520+
3521+
drm.registeredClass = DrmResourceClass::MaxSize;
3522+
3523+
MockBufferObject bo(&drm, 3, 0, 0, 1);
3524+
MockDrmAllocation allocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages);
3525+
allocation.bufferObjects[0] = &bo;
3526+
allocation.registerBOBindExtHandle(&drm);
3527+
EXPECT_EQ(1u, bo.bindExtHandles.size());
3528+
3529+
EXPECT_EQ(DrmMockResources::registerResourceReturnHandle, bo.bindExtHandles[0]);
3530+
3531+
allocation.freeRegisteredBOBindExtHandles(&drm);
3532+
EXPECT_EQ(1u, drm.unregisterCalledCount);
3533+
}
3534+
35133535
TEST_F(DrmAllocationTests, givenDrmAllocationWhenSetCacheRegionIsCalledForDefaultRegionThenReturnTrue) {
35143536
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
35153537

0 commit comments

Comments
 (0)