Create wrappers for different version of i915 headers

Related-To: NEO-6852
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-07-15 13:12:14 +02:00
committed by Compute-Runtime-Automation
parent 56a264a33d
commit 78c96db2fa
39 changed files with 120 additions and 85 deletions

View File

@@ -11,12 +11,11 @@
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/string.h"
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/linux/i915.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/mocks/linux/mock_drm_wrappers.h"
#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h"
#include "drm/i915_drm.h"
#include <cstdio>
#include <fstream>
#include <limits.h>
@@ -56,25 +55,10 @@ class DrmMock : public Drm {
using Drm::translateTopologyInfo;
using Drm::virtualMemoryIds;
DrmMock(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, ""), rootDeviceEnvironment) {
sliceCountChangeSupported = true;
if (rootDeviceEnvironment.executionEnvironment.isDebuggingEnabled()) {
setPerContextVMRequired(true);
}
setupIoctlHelper(rootDeviceEnvironment.getHardwareInfo()->platform.eProductFamily);
if (!isPerContextVMRequired()) {
createVirtualMemoryAddressSpace(HwHelper::getSubDevicesCount(rootDeviceEnvironment.getHardwareInfo()));
}
}
DrmMock(int fd, RootDeviceEnvironment &rootDeviceEnvironment);
DrmMock(RootDeviceEnvironment &rootDeviceEnvironment) : DrmMock(mockFd, rootDeviceEnvironment) {}
~DrmMock() override {
if (expectIoctlCallsOnDestruction) {
EXPECT_EQ(expectedIoctlCallsOnDestruction, ioctlCallsCount);
}
}
~DrmMock() override;
int ioctl(DrmIoctl request, void *arg) override;
int getErrno() override {
@@ -181,10 +165,7 @@ class DrmMock : public Drm {
int storedRetValForMinEUinPool = 0;
int storedRetValForPersistant = 0;
int storedRetValForVmCreate = 0;
int storedPreemptionSupport =
I915_SCHEDULER_CAP_ENABLED |
I915_SCHEDULER_CAP_PRIORITY |
I915_SCHEDULER_CAP_PREEMPTION;
int storedPreemptionSupport = 0;
int storedExecSoftPin = 0;
int storedRetValForVmId = 1;
int storedCsTimestampFrequency = 1000;