mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
feature: initial support for creating media context
Related-To: NEO-11386 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e2cec35f1f
commit
bb21d25ed0
@@ -1726,6 +1726,26 @@ TEST_F(DrmMemoryManagerTest, whenCallingAllocateAndReleaseInterruptThenCallIoctl
|
||||
EXPECT_EQ(123u, mockIoctlHelper->latestReleaseInterruptHandle);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, whenCallingCreateAndReleaseMediaContextThenCallIoctlHelper) {
|
||||
auto mockIoctlHelper = new MockIoctlHelper(*mock);
|
||||
|
||||
auto &drm = static_cast<DrmMockCustom &>(memoryManager->getDrm(rootDeviceIndex));
|
||||
drm.ioctlHelper.reset(mockIoctlHelper);
|
||||
|
||||
uint64_t handle = 0;
|
||||
|
||||
EXPECT_EQ(0u, mockIoctlHelper->createMediaContextCalled);
|
||||
EXPECT_EQ(0u, mockIoctlHelper->releaseMediaContextCalled);
|
||||
|
||||
memoryManager->createMediaContext(rootDeviceIndex, nullptr, 0, nullptr, 0, handle);
|
||||
EXPECT_EQ(1u, mockIoctlHelper->createMediaContextCalled);
|
||||
EXPECT_EQ(0u, mockIoctlHelper->releaseMediaContextCalled);
|
||||
|
||||
memoryManager->releaseMediaContext(rootDeviceIndex, handle);
|
||||
EXPECT_EQ(1u, mockIoctlHelper->createMediaContextCalled);
|
||||
EXPECT_EQ(1u, mockIoctlHelper->releaseMediaContextCalled);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, GivenShareableEnabledWhenAskedToCreateGraphicsAllocationThenValidAllocationIsReturnedAndStandard64KBHeapIsUsed) {
|
||||
mock->ioctlHelper.reset(new MockIoctlHelper(*mock));
|
||||
mock->queryMemoryInfo();
|
||||
|
||||
@@ -302,6 +302,7 @@ class DrmMockXe : public DrmMockCustom {
|
||||
case DrmIoctl::gemContextCreateExt: {
|
||||
auto queueCreate = static_cast<drm_xe_exec_queue_create *>(arg);
|
||||
latestExecQueueCreate = *queueCreate;
|
||||
latestQueueEngineClassInstance = reinterpret_cast<drm_xe_engine_class_instance *>(queueCreate->instances)[0];
|
||||
|
||||
auto extension = queueCreate->extensions;
|
||||
while (extension) {
|
||||
@@ -310,6 +311,7 @@ class DrmMockXe : public DrmMockCustom {
|
||||
auto setProperty = reinterpret_cast<drm_xe_ext_set_property *>(ext);
|
||||
execQueueProperties.push_back(*setProperty);
|
||||
}
|
||||
handleContextCreateExtensions(ext);
|
||||
extension = ext->next_extension;
|
||||
}
|
||||
queueCreate->exec_queue_id = mockExecQueueId;
|
||||
@@ -334,6 +336,7 @@ class DrmMockXe : public DrmMockCustom {
|
||||
}
|
||||
|
||||
virtual void handleUserFenceWaitExtensions(drm_xe_wait_user_fence *userFenceWait) {}
|
||||
virtual void handleContextCreateExtensions(drm_xe_user_extension *extension) {}
|
||||
|
||||
void addMockedQueryTopologyData(uint16_t tileId, uint16_t maskType, uint32_t nBytes, const std::vector<uint8_t> &mask) {
|
||||
|
||||
@@ -382,6 +385,7 @@ class DrmMockXe : public DrmMockCustom {
|
||||
StackVec<drm_xe_sync, 1> syncInputs;
|
||||
StackVec<drm_xe_ext_set_property, 1> execQueueProperties;
|
||||
drm_xe_exec_queue_create latestExecQueueCreate = {};
|
||||
drm_xe_engine_class_instance latestQueueEngineClassInstance = {};
|
||||
|
||||
int waitUserFenceReturn = 0;
|
||||
int execQueueBanPropertyReturn = 0;
|
||||
|
||||
Reference in New Issue
Block a user