Add a method to check drm support

Related-To: NEO-6999
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-05-19 17:22:41 +00:00
committed by Compute-Runtime-Automation
parent fb40e8d1a6
commit 3ac5853e8d
9 changed files with 55 additions and 7 deletions

View File

@@ -44,6 +44,7 @@ uint32_t pwriteFuncCalled = 0u;
uint32_t mmapFuncCalled = 0u;
uint32_t munmapFuncCalled = 0u;
bool isInvalidAILTest = false;
const char *drmVersion = "i915";
int (*sysCallsOpen)(const char *pathname, int flags) = nullptr;
ssize_t (*sysCallsPread)(int fd, void *buf, size_t count, off_t offset) = nullptr;
@@ -89,7 +90,7 @@ int ioctl(int fileDescriptor, unsigned long int request, void *arg) {
if (fileDescriptor == fakeFileDescriptor) {
if (request == DRM_IOCTL_VERSION) {
auto pVersion = static_cast<drm_version_t *>(arg);
snprintf(pVersion->name, pVersion->name_len, "i915");
memcpy_s(pVersion->name, pVersion->name_len, drmVersion, strlen(drmVersion) + 1);
}
}
if (request == DRM_IOCTL_I915_GEM_VM_CREATE) {

View File

@@ -20,5 +20,6 @@ extern int (*sysCallsIoctl)(int fileDescriptor, unsigned long int request, void
extern int (*sysCallsPoll)(struct pollfd *pollFd, unsigned long int numberOfFds, int timeout);
extern ssize_t (*sysCallsRead)(int fd, void *buf, size_t count);
extern const char *drmVersion;
} // namespace SysCalls
} // namespace NEO