Drm: call ioctl using ioctl helper if possible

Related-To: NEO-6999
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-06-28 17:56:14 +00:00
committed by Compute-Runtime-Automation
parent a8e2bd3f98
commit b72fcad1be
6 changed files with 64 additions and 43 deletions

View File

@@ -61,14 +61,18 @@ class Ioctls {
class DrmMockSuccess : public Drm {
public:
using Drm::setupIoctlHelper;
DrmMockSuccess(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, mockPciPath), rootDeviceEnvironment) {}
DrmMockSuccess(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, mockPciPath), rootDeviceEnvironment) {
setupIoctlHelper(NEO::defaultHwInfo->platform.eProductFamily);
}
int ioctl(DrmIoctl request, void *arg) override { return 0; };
};
class DrmMockFail : public Drm {
public:
DrmMockFail(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), rootDeviceEnvironment) {}
DrmMockFail(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), rootDeviceEnvironment) {
setupIoctlHelper(NEO::defaultHwInfo->platform.eProductFamily);
}
int ioctl(DrmIoctl request, void *arg) override { return -1; };
};