2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2020-01-25 00:19:06 +08:00
|
|
|
* Copyright (C) 2018-2020 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/preemption_mode.h"
|
|
|
|
#include "shared/source/direct_submission/direct_submission_properties.h"
|
|
|
|
#include "shared/source/helpers/kmd_notify_properties.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2018-10-28 05:46:29 +08:00
|
|
|
#include "engine_node.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "gtsysinfo.h"
|
2018-07-18 20:11:05 +08:00
|
|
|
#include "igfxfmid.h"
|
2018-01-09 21:08:34 +08:00
|
|
|
#include "sku_info.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-02-19 16:50:17 +08:00
|
|
|
#include <cstddef>
|
2018-10-04 18:44:49 +08:00
|
|
|
#include <string>
|
2017-11-14 18:15:09 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
struct RuntimeCapabilityTable {
|
2020-01-16 00:02:47 +08:00
|
|
|
DirectSubmissionProperyEngines directSubmissionEngines;
|
2018-12-06 22:33:02 +08:00
|
|
|
KmdNotifyProperties kmdNotifyProperties;
|
|
|
|
uint64_t gpuAddressSpace;
|
2017-12-21 07:45:38 +08:00
|
|
|
double defaultProfilingTimerResolution;
|
2018-12-06 22:33:02 +08:00
|
|
|
size_t requiredPreemptionSurfaceSize;
|
|
|
|
bool (*isSimulation)(unsigned short);
|
|
|
|
PreemptionMode defaultPreemptionMode;
|
2019-03-27 17:06:29 +08:00
|
|
|
aub_stream::EngineType defaultEngineType;
|
2018-12-06 22:33:02 +08:00
|
|
|
uint32_t maxRenderFrequency;
|
2017-12-21 07:45:38 +08:00
|
|
|
unsigned int clVersionSupport;
|
2018-12-06 22:33:02 +08:00
|
|
|
uint32_t aubDeviceId;
|
|
|
|
uint32_t extraQuantityThreadsPerEU;
|
|
|
|
uint32_t slmSize;
|
2019-12-17 15:55:09 +08:00
|
|
|
uint32_t grfSize;
|
2020-09-30 14:00:00 +08:00
|
|
|
uint32_t timestampValidBits;
|
|
|
|
uint32_t kernelTimestampValidBits;
|
2019-04-16 15:06:37 +08:00
|
|
|
bool blitterOperationsSupported;
|
2019-08-20 21:17:10 +08:00
|
|
|
bool ftrSupportsInteger64BitAtomics;
|
2017-12-21 07:45:38 +08:00
|
|
|
bool ftrSupportsFP64;
|
|
|
|
bool ftrSupports64BitMath;
|
|
|
|
bool ftrSvm;
|
|
|
|
bool ftrSupportsCoherency;
|
|
|
|
bool ftrSupportsVmeAvcTextureSampler;
|
|
|
|
bool ftrSupportsVmeAvcPreemption;
|
2018-07-18 20:11:05 +08:00
|
|
|
bool ftrRenderCompressedBuffers;
|
|
|
|
bool ftrRenderCompressedImages;
|
2018-12-06 22:33:02 +08:00
|
|
|
bool ftr64KBpages;
|
2017-12-21 07:45:38 +08:00
|
|
|
bool instrumentationEnabled;
|
|
|
|
bool forceStatelessCompilationFor32Bit;
|
2019-07-24 17:43:29 +08:00
|
|
|
const char *platformType;
|
2020-02-10 22:57:49 +08:00
|
|
|
bool debuggerSupported;
|
2018-10-24 21:59:36 +08:00
|
|
|
bool supportsVme;
|
2018-12-06 22:33:02 +08:00
|
|
|
bool supportCacheFlushAfterWalker;
|
2019-07-01 17:29:15 +08:00
|
|
|
bool supportsImages;
|
2019-07-15 21:08:42 +08:00
|
|
|
bool supportsDeviceEnqueue;
|
2020-04-29 20:51:40 +08:00
|
|
|
bool supportsPipes;
|
2020-04-30 21:47:43 +08:00
|
|
|
bool supportsOcl21Features;
|
2020-06-05 16:32:00 +08:00
|
|
|
bool supportsOnDemandPageFaults;
|
2020-06-18 21:07:58 +08:00
|
|
|
bool supportsIndependentForwardProgress;
|
2019-12-04 20:42:41 +08:00
|
|
|
bool hostPtrTrackingEnabled;
|
2020-04-12 07:07:22 +08:00
|
|
|
bool levelZeroSupported;
|
2020-08-11 13:33:58 +08:00
|
|
|
bool isIntegratedDevice;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
2018-02-19 16:50:17 +08:00
|
|
|
struct HardwareCapabilities {
|
|
|
|
size_t image3DMaxWidth;
|
|
|
|
size_t image3DMaxHeight;
|
2018-06-08 22:42:29 +08:00
|
|
|
uint64_t maxMemAllocSize;
|
2018-07-10 19:22:11 +08:00
|
|
|
bool isStatelesToStatefullWithOffsetSupported;
|
2018-02-19 16:50:17 +08:00
|
|
|
};
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
struct HardwareInfo {
|
2018-06-12 15:42:47 +08:00
|
|
|
HardwareInfo() = default;
|
2019-05-08 22:00:24 +08:00
|
|
|
HardwareInfo(const PLATFORM *platform, const FeatureTable *featureTable, const WorkaroundTable *workaroundTable,
|
|
|
|
const GT_SYSTEM_INFO *gtSystemInfo, const RuntimeCapabilityTable &capabilityTable);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-05-08 22:00:24 +08:00
|
|
|
PLATFORM platform = {};
|
|
|
|
FeatureTable featureTable = {};
|
|
|
|
WorkaroundTable workaroundTable = {};
|
2019-07-08 22:15:59 +08:00
|
|
|
alignas(4) GT_SYSTEM_INFO gtSystemInfo = {};
|
2018-06-12 15:42:47 +08:00
|
|
|
|
|
|
|
RuntimeCapabilityTable capabilityTable = {};
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY product>
|
|
|
|
struct HwMapper {};
|
|
|
|
|
|
|
|
template <GFXCORE_FAMILY gfxFamily>
|
|
|
|
struct GfxFamilyMapper {};
|
|
|
|
|
|
|
|
// Global table of hardware prefixes
|
|
|
|
extern bool familyEnabled[IGFX_MAX_CORE];
|
|
|
|
extern const char *familyName[IGFX_MAX_CORE];
|
2019-10-18 16:15:09 +08:00
|
|
|
extern const char *hardwarePrefix[IGFX_MAX_PRODUCT];
|
2020-01-25 00:19:06 +08:00
|
|
|
extern uint64_t defaultHardwareInfoConfigTable[IGFX_MAX_PRODUCT];
|
2017-12-21 07:45:38 +08:00
|
|
|
extern const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT];
|
2020-01-25 00:19:06 +08:00
|
|
|
extern void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
template <GFXCORE_FAMILY gfxFamily>
|
|
|
|
struct EnableGfxFamilyHw {
|
|
|
|
EnableGfxFamilyHw() {
|
|
|
|
familyEnabled[gfxFamily] = true;
|
|
|
|
familyName[gfxFamily] = GfxFamilyMapper<gfxFamily>::name;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-07-18 17:58:30 +08:00
|
|
|
bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwInfoIn);
|
2020-01-25 00:19:06 +08:00
|
|
|
void setHwInfoValuesFromConfig(const uint64_t hwInfoConfig, HardwareInfo &hwInfoIn);
|
|
|
|
bool parseHwInfoConfigString(const std::string &hwInfoConfigStr, uint64_t &hwInfoConfig);
|
2019-03-27 17:06:29 +08:00
|
|
|
aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo);
|
2019-08-26 21:36:24 +08:00
|
|
|
const std::string getFamilyNameWithType(const HardwareInfo &hwInfo);
|
2019-11-28 22:39:30 +08:00
|
|
|
|
|
|
|
// Utility conversion
|
|
|
|
template <PRODUCT_FAMILY productFamily>
|
|
|
|
struct ToGfxCoreFamily {
|
|
|
|
static const GFXCORE_FAMILY gfxCoreFamily =
|
|
|
|
static_cast<GFXCORE_FAMILY>(NEO::HwMapper<productFamily>::gfxFamily);
|
|
|
|
static constexpr GFXCORE_FAMILY get() { return gfxCoreFamily; }
|
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|