Add ioctl helper function to check vm bind availability

Related-To: NEO-6591
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-02-15 09:33:27 +00:00
committed by Compute-Runtime-Automation
parent 964596e514
commit 12e2670b9a
14 changed files with 75 additions and 7 deletions

View File

@ -33,14 +33,14 @@ class DrmCommandStreamTest : public ::testing::Test {
DebugManager.flags.EnableForcePin.set(false);
mock = new ::testing::NiceMock<DrmMockImpl>(mockFd, *executionEnvironment.rootDeviceEnvironments[0]);
auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo();
mock->setupIoctlHelper(hwInfo->platform.eProductFamily);
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(mock));
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock, 0u);
auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo();
mock->createVirtualMemoryAddressSpace(HwHelper::getSubDevicesCount(hwInfo));
mock->setupIoctlHelper(hwInfo->platform.eProductFamily);
osContext = std::make_unique<OsContextLinux>(*mock, 0u,
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
PreemptionHelper::getDefaultPreemptionMode(*hwInfo)));

View File

@ -34,6 +34,7 @@ using namespace NEO;
class DrmMockForWorker : public Drm {
public:
using Drm::setupIoctlHelper;
std::mutex mutex;
std::atomic<int> gem_close_cnt;
std::atomic<int> gem_close_expected;
@ -68,6 +69,9 @@ class DrmGemCloseWorkerFixture {
void SetUp() {
this->drmMock = new DrmMockForWorker(*executionEnvironment.rootDeviceEnvironments[0]);
auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo();
drmMock->setupIoctlHelper(hwInfo->platform.eProductFamily);
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drmMock));
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drmMock, 0u);