mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 08:07:19 +08:00
xe: Add IOCTL support for GemCreate
This is needed to execute some workloads with iGPUs. Signed-off-by: Francois Dugast <francois.dugast@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7b5897d585
commit
e2a4cd0d48
@@ -219,6 +219,7 @@ TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingAnyMethodThenDummyValueIsRe
|
||||
verifyIoctlString(DrmIoctl::SyncobjWait, "DRM_IOCTL_SYNCOBJ_WAIT");
|
||||
verifyIoctlString(DrmIoctl::SyncobjDestroy, "DRM_IOCTL_SYNCOBJ_DESTROY");
|
||||
verifyIoctlString(DrmIoctl::GemClose, "DRM_IOCTL_GEM_CLOSE");
|
||||
verifyIoctlString(DrmIoctl::GemCreate, "DRM_IOCTL_XE_GEM_CREATE");
|
||||
verifyIoctlString(DrmIoctl::GemVmCreate, "DRM_IOCTL_XE_VM_CREATE");
|
||||
verifyIoctlString(DrmIoctl::GemVmDestroy, "DRM_IOCTL_XE_VM_DESTROY");
|
||||
verifyIoctlString(DrmIoctl::GemMmapOffset, "DRM_IOCTL_XE_GEM_MMAP_OFFSET");
|
||||
@@ -436,6 +437,7 @@ TEST(IoctlHelperXeTest, whenGettingFileNamesForFrequencyThenProperStringIsReturn
|
||||
inline constexpr int testValueVmId = 0x5764;
|
||||
inline constexpr int testValueMapOff = 0x7788;
|
||||
inline constexpr int testValuePrime = 0x4321;
|
||||
inline constexpr int testValueGemCreate = 0x8273;
|
||||
|
||||
class DrmMockXe : public DrmMockCustom {
|
||||
public:
|
||||
@@ -491,6 +493,12 @@ class DrmMockXe : public DrmMockCustom {
|
||||
ret = 0;
|
||||
}
|
||||
} break;
|
||||
case DrmIoctl::GemCreate: {
|
||||
GemCreate *v = static_cast<GemCreate *>(arg);
|
||||
if (v->handle == testValueGemCreate) {
|
||||
ret = 0;
|
||||
}
|
||||
} break;
|
||||
case DrmIoctl::Getparam:
|
||||
case DrmIoctl::GetResetStats:
|
||||
ret = -2;
|
||||
@@ -580,6 +588,12 @@ TEST(IoctlHelperXeTest, whenCallingIoctlThenProperValueIsReturned) {
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ(static_cast<int>(test.fileDescriptor), testValuePrime);
|
||||
}
|
||||
{
|
||||
GemCreate test = {};
|
||||
test.handle = testValueGemCreate;
|
||||
ret = mockXeIoctlHelper->ioctl(DrmIoctl::GemCreate, &test);
|
||||
EXPECT_EQ(0, ret);
|
||||
}
|
||||
{
|
||||
ResetStats test = {};
|
||||
ret = mockXeIoctlHelper->ioctl(DrmIoctl::GetResetStats, &test);
|
||||
|
||||
Reference in New Issue
Block a user