2022-01-29 05:00:05 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2022 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
|
|
|
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
|
|
|
#include "shared/test/common/libult/linux/drm_mock.h"
|
2022-02-03 19:13:44 +08:00
|
|
|
#include "shared/test/common/libult/linux/drm_mock_prelim_context.h"
|
2022-01-29 05:00:05 +08:00
|
|
|
|
2022-02-15 20:56:31 +08:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
2022-01-29 05:00:05 +08:00
|
|
|
using namespace NEO;
|
|
|
|
|
|
|
|
class DrmQueryMock : public DrmMock {
|
|
|
|
public:
|
2022-02-15 20:56:31 +08:00
|
|
|
using Drm::rootDeviceEnvironment;
|
|
|
|
|
2022-01-29 05:00:05 +08:00
|
|
|
DrmQueryMock(RootDeviceEnvironment &rootDeviceEnvironment) : DrmQueryMock(rootDeviceEnvironment, defaultHwInfo.get()) {}
|
|
|
|
DrmQueryMock(RootDeviceEnvironment &rootDeviceEnvironment, const HardwareInfo *inputHwInfo) : DrmMock(rootDeviceEnvironment) {
|
|
|
|
rootDeviceEnvironment.setHwInfo(inputHwInfo);
|
|
|
|
context.hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
2022-04-22 00:59:48 +08:00
|
|
|
callBaseIsVmBindAvailable = true;
|
2022-01-29 05:00:05 +08:00
|
|
|
|
|
|
|
setupIoctlHelper(IGFX_UNKNOWN);
|
2022-02-15 20:56:31 +08:00
|
|
|
|
|
|
|
EXPECT_TRUE(queryMemoryInfo());
|
|
|
|
EXPECT_EQ(2u, ioctlCallsCount);
|
|
|
|
ioctlCallsCount = 0;
|
2022-01-29 05:00:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void getPrelimVersion(std::string &prelimVersion) override {
|
|
|
|
prelimVersion = "2.0";
|
|
|
|
}
|
|
|
|
|
2022-02-03 19:13:44 +08:00
|
|
|
DrmMockPrelimContext context{
|
2022-02-23 21:16:26 +08:00
|
|
|
nullptr,
|
|
|
|
rootDeviceEnvironment,
|
|
|
|
getCacheInfo(),
|
|
|
|
failRetTopology,
|
|
|
|
supportedCopyEnginesMask,
|
2022-02-28 21:56:41 +08:00
|
|
|
contextDebugSupported,
|
2022-01-29 05:00:05 +08:00
|
|
|
};
|
|
|
|
|
2022-02-15 20:56:31 +08:00
|
|
|
static constexpr uint32_t maxEngineCount{9};
|
|
|
|
I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(receivedContextEnginesLoadBalance, maxEngineCount){};
|
|
|
|
I915_DEFINE_CONTEXT_PARAM_ENGINES(receivedContextParamEngines, 1 + maxEngineCount){};
|
|
|
|
|
|
|
|
BcsInfoMask supportedCopyEnginesMask = 1;
|
|
|
|
uint32_t i915QuerySuccessCount = std::numeric_limits<uint32_t>::max();
|
|
|
|
int storedRetValForSetParamEngines{0};
|
|
|
|
|
2022-01-29 05:00:05 +08:00
|
|
|
int handleRemainingRequests(unsigned long request, void *arg) override;
|
|
|
|
virtual bool handleQueryItem(void *queryItem);
|
|
|
|
};
|