2022-02-03 19:13:44 +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/helpers/hw_info.h"
|
|
|
|
#include "shared/source/os_interface/linux/cache_info.h"
|
|
|
|
|
2022-02-28 21:56:41 +08:00
|
|
|
#include <optional>
|
2022-02-24 23:17:31 +08:00
|
|
|
#include <vector>
|
2022-02-28 21:56:41 +08:00
|
|
|
|
2022-02-03 19:13:44 +08:00
|
|
|
using namespace NEO;
|
|
|
|
|
2022-02-28 21:56:41 +08:00
|
|
|
struct UuidControl {
|
|
|
|
char uuid[36]{};
|
|
|
|
uint32_t uuidClass{0};
|
|
|
|
void *ptr{nullptr};
|
|
|
|
uint64_t size{0};
|
|
|
|
uint32_t handle{0};
|
|
|
|
uint32_t flags{0};
|
|
|
|
uint64_t extensions{0};
|
|
|
|
};
|
|
|
|
|
2022-02-24 23:17:31 +08:00
|
|
|
struct CreateGemExt {
|
|
|
|
uint64_t size{0};
|
|
|
|
uint32_t handle{0};
|
|
|
|
|
|
|
|
struct MemoryClassInstance {
|
|
|
|
uint16_t memoryClass{0};
|
|
|
|
uint16_t memoryInstance{0};
|
|
|
|
};
|
|
|
|
std::vector<MemoryClassInstance> memoryRegions{};
|
|
|
|
};
|
|
|
|
|
2022-02-03 19:13:44 +08:00
|
|
|
struct DrmMockPrelimContext {
|
|
|
|
const HardwareInfo *hwInfo;
|
|
|
|
const RootDeviceEnvironment &rootDeviceEnvironment;
|
|
|
|
const CacheInfo *cacheInfo;
|
|
|
|
const bool &failRetTopology;
|
2022-02-15 20:56:31 +08:00
|
|
|
const BcsInfoMask &supportedCopyEnginesMask;
|
2022-02-28 21:56:41 +08:00
|
|
|
const bool &contextDebugSupported;
|
2022-02-15 20:56:31 +08:00
|
|
|
|
2022-02-03 19:13:44 +08:00
|
|
|
uint16_t closIndex{0};
|
|
|
|
uint16_t maxNumWays{32};
|
|
|
|
uint32_t allocNumWays{0};
|
|
|
|
|
2022-02-15 17:33:27 +08:00
|
|
|
size_t vmBindQueryCalled{0};
|
|
|
|
int vmBindQueryValue{0};
|
|
|
|
int vmBindQueryReturn{0};
|
|
|
|
|
2022-02-15 22:54:16 +08:00
|
|
|
size_t vmBindCalled{0};
|
|
|
|
int vmBindReturn{0};
|
|
|
|
|
|
|
|
size_t vmUnbindCalled{0};
|
|
|
|
int vmUnbindReturn{0};
|
|
|
|
|
2022-02-11 00:16:37 +08:00
|
|
|
int hasPageFaultQueryValue{0};
|
|
|
|
int hasPageFaultQueryReturn{0};
|
|
|
|
|
2022-02-24 23:17:31 +08:00
|
|
|
uint32_t queryMemoryRegionInfoSuccessCount{std::numeric_limits<uint32_t>::max()};
|
|
|
|
|
2022-02-28 21:56:41 +08:00
|
|
|
uint32_t uuidHandle{1};
|
|
|
|
std::optional<UuidControl> receivedRegisterUuid{};
|
|
|
|
std::optional<UuidControl> receivedUnregisterUuid{};
|
|
|
|
|
|
|
|
int uuidControlReturn{0};
|
|
|
|
|
2022-02-24 23:17:31 +08:00
|
|
|
std::optional<CreateGemExt> receivedCreateGemExt{};
|
|
|
|
|
2022-02-15 20:56:31 +08:00
|
|
|
bool failDistanceInfoQuery{false};
|
|
|
|
bool disableCcsSupport{false};
|
|
|
|
|
2022-02-03 19:13:44 +08:00
|
|
|
int handlePrelimRequest(unsigned long request, void *arg);
|
|
|
|
bool handlePrelimQueryItem(void *arg);
|
|
|
|
};
|
|
|
|
|
2022-02-15 20:56:31 +08:00
|
|
|
namespace DrmPrelimHelper {
|
2022-02-03 19:13:44 +08:00
|
|
|
uint32_t getQueryComputeSlicesIoctl();
|
2022-02-15 20:56:31 +08:00
|
|
|
uint32_t getDistanceInfoQueryId();
|
|
|
|
uint32_t getComputeEngineClass();
|
2022-02-28 21:56:41 +08:00
|
|
|
uint32_t getStringUuidClass();
|
2022-02-15 20:56:31 +08:00
|
|
|
}; // namespace DrmPrelimHelper
|