Improve Wddm creation
Pick interface version basing on Ftr flag Change-Id: I09880610922a6d451fc6f414a4fa5857449bc0f4
This commit is contained in:
parent
bcf1449db0
commit
3a369ad500
|
@ -24,6 +24,10 @@
|
||||||
#include "hw_cmds.h"
|
#include "hw_cmds.h"
|
||||||
|
|
||||||
namespace OCLRT {
|
namespace OCLRT {
|
||||||
|
HardwareInfo::HardwareInfo(const PLATFORM *platform, const FeatureTable *skuTable, const WorkaroundTable *waTable,
|
||||||
|
const GT_SYSTEM_INFO *sysInfo, RuntimeCapabilityTable capabilityTable)
|
||||||
|
: pPlatform(platform), pSkuTable(skuTable), pWaTable(waTable), pSysInfo(sysInfo), capabilityTable(capabilityTable) {
|
||||||
|
}
|
||||||
|
|
||||||
const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT] = {};
|
const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT] = {};
|
||||||
void (*hardwareInfoSetupGt[IGFX_MAX_PRODUCT])(GT_SYSTEM_INFO *) = {
|
void (*hardwareInfoSetupGt[IGFX_MAX_PRODUCT])(GT_SYSTEM_INFO *) = {
|
||||||
|
@ -33,27 +37,6 @@ void (*hardwareInfoSetupGt[IGFX_MAX_PRODUCT])(GT_SYSTEM_INFO *) = {
|
||||||
const FeatureTable emptySkuTable = {};
|
const FeatureTable emptySkuTable = {};
|
||||||
const WorkaroundTable emptyWaTable = {};
|
const WorkaroundTable emptyWaTable = {};
|
||||||
|
|
||||||
const PLATFORM unknownPlatform = {
|
|
||||||
IGFX_UNKNOWN,
|
|
||||||
PCH_UNKNOWN,
|
|
||||||
IGFX_UNKNOWN_CORE,
|
|
||||||
IGFX_UNKNOWN_CORE,
|
|
||||||
PLATFORM_NONE, // default init
|
|
||||||
0, // usDeviceID
|
|
||||||
0, // usRevId. 0 sets the stepping to A0
|
|
||||||
0, // usDeviceID_PCH
|
|
||||||
0, // usRevId_PCH
|
|
||||||
GTTYPE_UNDEFINED};
|
|
||||||
|
|
||||||
const GT_SYSTEM_INFO unknownSysInfo = {};
|
|
||||||
|
|
||||||
const HardwareInfo unknownHardware = {
|
|
||||||
&unknownPlatform,
|
|
||||||
&emptySkuTable,
|
|
||||||
&emptyWaTable,
|
|
||||||
&unknownSysInfo,
|
|
||||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, PreemptionMode::Disabled, {false, false}, nullptr}};
|
|
||||||
|
|
||||||
const char *getPlatformType(const HardwareInfo &hwInfo) {
|
const char *getPlatformType(const HardwareInfo &hwInfo) {
|
||||||
if (hwInfo.capabilityTable.isCore) {
|
if (hwInfo.capabilityTable.isCore) {
|
||||||
return "core";
|
return "core";
|
||||||
|
|
|
@ -84,17 +84,20 @@ struct HardwareCapabilities {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HardwareInfo {
|
struct HardwareInfo {
|
||||||
const PLATFORM *pPlatform;
|
HardwareInfo() = default;
|
||||||
const FeatureTable *pSkuTable;
|
HardwareInfo(const PLATFORM *platform, const FeatureTable *skuTable, const WorkaroundTable *waTable,
|
||||||
const WorkaroundTable *pWaTable;
|
const GT_SYSTEM_INFO *sysInfo, RuntimeCapabilityTable capabilityTable);
|
||||||
const GT_SYSTEM_INFO *pSysInfo;
|
|
||||||
|
|
||||||
RuntimeCapabilityTable capabilityTable;
|
const PLATFORM *pPlatform = nullptr;
|
||||||
|
const FeatureTable *pSkuTable = nullptr;
|
||||||
|
const WorkaroundTable *pWaTable = nullptr;
|
||||||
|
const GT_SYSTEM_INFO *pSysInfo = nullptr;
|
||||||
|
|
||||||
|
RuntimeCapabilityTable capabilityTable = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const WorkaroundTable emptyWaTable;
|
extern const WorkaroundTable emptyWaTable;
|
||||||
extern const FeatureTable emptySkuTable;
|
extern const FeatureTable emptySkuTable;
|
||||||
extern const HardwareInfo unknownHardware;
|
|
||||||
|
|
||||||
template <PRODUCT_FAMILY product>
|
template <PRODUCT_FAMILY product>
|
||||||
struct HwMapper {};
|
struct HwMapper {};
|
||||||
|
|
|
@ -92,7 +92,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, ForceOCLVersion, 0, "Force specific OpenCL API v
|
||||||
DECLARE_DEBUG_VARIABLE(int32_t, ForcePreemptionMode, -1, "Keep this variable in sync with PreemptionMode enum. -1 - devices default mode, 1 - disable, 2 - midBatch, 3 - threadGroup, 4 - midThread")
|
DECLARE_DEBUG_VARIABLE(int32_t, ForcePreemptionMode, -1, "Keep this variable in sync with PreemptionMode enum. -1 - devices default mode, 1 - disable, 2 - midBatch, 3 - threadGroup, 4 - midThread")
|
||||||
DECLARE_DEBUG_VARIABLE(int32_t, NodeOrdinal, -1, "-1: default do not override, 0: ENGINE_RCS")
|
DECLARE_DEBUG_VARIABLE(int32_t, NodeOrdinal, -1, "-1: default do not override, 0: ENGINE_RCS")
|
||||||
DECLARE_DEBUG_VARIABLE(int32_t, OverrideThreadArbitrationPolicy, -1, "-1 (dont override) or any valid config (0: Age Based, 1: Round Robin)")
|
DECLARE_DEBUG_VARIABLE(int32_t, OverrideThreadArbitrationPolicy, -1, "-1 (dont override) or any valid config (0: Age Based, 1: Round Robin)")
|
||||||
DECLARE_DEBUG_VARIABLE(bool, HwQueueSupported, false, "Windows only. Pass flag to KMD during Wddm Context creation")
|
|
||||||
DECLARE_DEBUG_VARIABLE(bool, UseMaxSimdSizeToDeduceMaxWorkgroupSize, false, "With this flag on, max workgroup size is deduced using SIMD32 instead of SIMD8, this causes the max wkg size to be 4 times bigger")
|
DECLARE_DEBUG_VARIABLE(bool, UseMaxSimdSizeToDeduceMaxWorkgroupSize, false, "With this flag on, max workgroup size is deduced using SIMD32 instead of SIMD8, this causes the max wkg size to be 4 times bigger")
|
||||||
DECLARE_DEBUG_VARIABLE(int32_t, OverrideAubDeviceId, -1, "-1 dont override, any other: use this value for AUB generation device id")
|
DECLARE_DEBUG_VARIABLE(int32_t, OverrideAubDeviceId, -1, "-1 dont override, any other: use this value for AUB generation device id")
|
||||||
DECLARE_DEBUG_VARIABLE(std::string, ForceCompilerUsePlatform, std::string("unk"), "Specify product for use in compiler interface")
|
DECLARE_DEBUG_VARIABLE(std::string, ForceCompilerUsePlatform, std::string("unk"), "Specify product for use in compiler interface")
|
|
@ -48,7 +48,6 @@ bool DeviceFactory::getDevices(HardwareInfo **pHWInfos, size_t &numDevices) {
|
||||||
const HardwareInfo *pCurrDevice = platformDevices[devNum];
|
const HardwareInfo *pCurrDevice = platformDevices[devNum];
|
||||||
|
|
||||||
HardwareInfo tmpHwInfo;
|
HardwareInfo tmpHwInfo;
|
||||||
memset(&tmpHwInfo, 0, sizeof(tmpHwInfo));
|
|
||||||
|
|
||||||
osInterface.get()->get()->setDrm(drm);
|
osInterface.get()->get()->setDrm(drm);
|
||||||
|
|
||||||
|
|
|
@ -102,13 +102,13 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
|
||||||
int val = 0;
|
int val = 0;
|
||||||
ret = drm->getDeviceID(val);
|
ret = drm->getDeviceID(val);
|
||||||
if (ret != 0 || val == 0) {
|
if (ret != 0 || val == 0) {
|
||||||
memset(outHwInfo, 0, sizeof(HardwareInfo));
|
*outHwInfo = {};
|
||||||
return (ret == 0) ? -1 : ret;
|
return (ret == 0) ? -1 : ret;
|
||||||
}
|
}
|
||||||
pPlatform->usDeviceID = static_cast<unsigned short>(val);
|
pPlatform->usDeviceID = static_cast<unsigned short>(val);
|
||||||
ret = drm->getDeviceRevID(val);
|
ret = drm->getDeviceRevID(val);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
memset(outHwInfo, 0, sizeof(HardwareInfo));
|
*outHwInfo = {};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
pPlatform->usRevId = static_cast<unsigned short>(val);
|
pPlatform->usRevId = static_cast<unsigned short>(val);
|
||||||
|
@ -116,7 +116,7 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
|
||||||
int euCount;
|
int euCount;
|
||||||
ret = drm->getEuTotal(euCount);
|
ret = drm->getEuTotal(euCount);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
memset(outHwInfo, 0, sizeof(HardwareInfo));
|
*outHwInfo = {};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
pSysInfo->EUCount = static_cast<uint32_t>(euCount);
|
pSysInfo->EUCount = static_cast<uint32_t>(euCount);
|
||||||
|
@ -126,7 +126,7 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
|
||||||
int subSliceCount;
|
int subSliceCount;
|
||||||
ret = drm->getSubsliceTotal(subSliceCount);
|
ret = drm->getSubsliceTotal(subSliceCount);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
memset(outHwInfo, 0, sizeof(HardwareInfo));
|
*outHwInfo = {};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
pSysInfo->SubSliceCount = static_cast<uint32_t>(subSliceCount);
|
pSysInfo->SubSliceCount = static_cast<uint32_t>(subSliceCount);
|
||||||
|
@ -138,7 +138,7 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
|
||||||
|
|
||||||
GTTYPE gtType = drm->getGtType();
|
GTTYPE gtType = drm->getGtType();
|
||||||
if (gtType == GTTYPE_UNDEFINED) {
|
if (gtType == GTTYPE_UNDEFINED) {
|
||||||
memset(outHwInfo, 0, sizeof(HardwareInfo));
|
*outHwInfo = {};
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
pPlatform->eGTType = gtType;
|
pPlatform->eGTType = gtType;
|
||||||
|
@ -154,7 +154,7 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
|
||||||
|
|
||||||
ret = configureHardwareCustom(outHwInfo, osIface);
|
ret = configureHardwareCustom(outHwInfo, osIface);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
memset(outHwInfo, 0, sizeof(HardwareInfo));
|
*outHwInfo = {};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
configureCacheInfo(outHwInfo);
|
configureCacheInfo(outHwInfo);
|
||||||
|
|
|
@ -93,41 +93,41 @@ Wddm::~Wddm() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Wddm::enumAdapters(unsigned int devNum, HardwareInfo &outHardwareInfo) {
|
bool Wddm::enumAdapters(unsigned int devNum, HardwareInfo &outHardwareInfo) {
|
||||||
bool success = false;
|
if (devNum > 0) {
|
||||||
if (devNum > 0)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::unique_ptr<Wddm> wddm(createWddm(WddmInterfaceVersion::Wddm20));
|
|
||||||
DEBUG_BREAK_IF(wddm == nullptr);
|
|
||||||
|
|
||||||
if (wddm->gdi->isInitialized()) {
|
|
||||||
do {
|
|
||||||
success = wddm->openAdapter();
|
|
||||||
if (!success)
|
|
||||||
break;
|
|
||||||
success = wddm->queryAdapterInfo();
|
|
||||||
if (!success)
|
|
||||||
break;
|
|
||||||
} while (!success);
|
|
||||||
}
|
}
|
||||||
if (success) {
|
|
||||||
auto productFamily = wddm->gfxPlatform->eProductFamily;
|
|
||||||
if (hardwareInfoTable[productFamily] == nullptr)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
outHardwareInfo.pPlatform = new PLATFORM(*wddm->gfxPlatform);
|
std::unique_ptr<Wddm> wddm(createWddm(Wddm::pickWddmInterfaceVersion(outHardwareInfo)));
|
||||||
outHardwareInfo.pSkuTable = new FeatureTable(*wddm->featureTable);
|
UNRECOVERABLE_IF(!wddm.get());
|
||||||
outHardwareInfo.pWaTable = new WorkaroundTable(*wddm->waTable);
|
|
||||||
outHardwareInfo.pSysInfo = new GT_SYSTEM_INFO(*wddm->gtSystemInfo);
|
|
||||||
|
|
||||||
outHardwareInfo.capabilityTable = hardwareInfoTable[productFamily]->capabilityTable;
|
if (!wddm->gdi->isInitialized()) {
|
||||||
outHardwareInfo.capabilityTable.maxRenderFrequency = wddm->maxRenderFrequency;
|
return false;
|
||||||
outHardwareInfo.capabilityTable.instrumentationEnabled &= wddm->instrumentationEnabled;
|
|
||||||
|
|
||||||
HwInfoConfig *hwConfig = HwInfoConfig::get(productFamily);
|
|
||||||
hwConfig->adjustPlatformForProductFamily(&outHardwareInfo);
|
|
||||||
}
|
}
|
||||||
return success;
|
if (!wddm->openAdapter()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!wddm->queryAdapterInfo()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto productFamily = wddm->gfxPlatform->eProductFamily;
|
||||||
|
if (!hardwareInfoTable[productFamily]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
outHardwareInfo.pPlatform = new PLATFORM(*wddm->gfxPlatform);
|
||||||
|
outHardwareInfo.pSkuTable = new FeatureTable(*wddm->featureTable);
|
||||||
|
outHardwareInfo.pWaTable = new WorkaroundTable(*wddm->waTable);
|
||||||
|
outHardwareInfo.pSysInfo = new GT_SYSTEM_INFO(*wddm->gtSystemInfo);
|
||||||
|
|
||||||
|
outHardwareInfo.capabilityTable = hardwareInfoTable[productFamily]->capabilityTable;
|
||||||
|
outHardwareInfo.capabilityTable.maxRenderFrequency = wddm->maxRenderFrequency;
|
||||||
|
outHardwareInfo.capabilityTable.instrumentationEnabled &= wddm->instrumentationEnabled;
|
||||||
|
|
||||||
|
HwInfoConfig *hwConfig = HwInfoConfig::get(productFamily);
|
||||||
|
hwConfig->adjustPlatformForProductFamily(&outHardwareInfo);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Wddm::queryAdapterInfo() {
|
bool Wddm::queryAdapterInfo() {
|
||||||
|
@ -960,4 +960,12 @@ void Wddm::resetMonitoredFenceParams(D3DKMT_HANDLE &handle, uint64_t *cpuAddress
|
||||||
monitoredFence.gpuAddress = gpuAddress;
|
monitoredFence.gpuAddress = gpuAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WddmInterfaceVersion Wddm::pickWddmInterfaceVersion(const HardwareInfo &hwInfo) {
|
||||||
|
if (hwInfo.pSkuTable && hwInfo.pSkuTable->ftrWddmHwQueues) {
|
||||||
|
return WddmInterfaceVersion::Wddm23;
|
||||||
|
}
|
||||||
|
// Use default version when hwInfo is not yet populated (eg. during enumAdapter call)
|
||||||
|
return WddmInterfaceVersion::Wddm20;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace OCLRT
|
} // namespace OCLRT
|
||||||
|
|
|
@ -49,10 +49,10 @@ struct FeatureTable;
|
||||||
struct WorkaroundTable;
|
struct WorkaroundTable;
|
||||||
struct KmDafListener;
|
struct KmDafListener;
|
||||||
|
|
||||||
namespace WddmInterfaceVersion {
|
enum class WddmInterfaceVersion {
|
||||||
constexpr uint32_t Wddm20 = 20;
|
Wddm20 = 20,
|
||||||
constexpr uint32_t Wddm23 = 23;
|
Wddm23 = 23,
|
||||||
} // namespace WddmInterfaceVersion
|
};
|
||||||
|
|
||||||
class Wddm {
|
class Wddm {
|
||||||
public:
|
public:
|
||||||
|
@ -63,8 +63,8 @@ class Wddm {
|
||||||
|
|
||||||
virtual ~Wddm();
|
virtual ~Wddm();
|
||||||
|
|
||||||
static Wddm *createWddm(uint32_t interfaceVersion);
|
static Wddm *createWddm(WddmInterfaceVersion interfaceVersion);
|
||||||
|
static WddmInterfaceVersion pickWddmInterfaceVersion(const HardwareInfo &hwInfo);
|
||||||
static bool enumAdapters(unsigned int devNum, HardwareInfo &outHardwareInfo);
|
static bool enumAdapters(unsigned int devNum, HardwareInfo &outHardwareInfo);
|
||||||
|
|
||||||
MOCKABLE_VIRTUAL bool evict(D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_t &sizeToTrim);
|
MOCKABLE_VIRTUAL bool evict(D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_t &sizeToTrim);
|
||||||
|
|
|
@ -25,11 +25,7 @@
|
||||||
#include "runtime/os_interface/windows/wddm/wddm23.h"
|
#include "runtime/os_interface/windows/wddm/wddm23.h"
|
||||||
|
|
||||||
namespace OCLRT {
|
namespace OCLRT {
|
||||||
Wddm *Wddm::createWddm(uint32_t interfaceVersion) {
|
Wddm *Wddm::createWddm(WddmInterfaceVersion interfaceVersion) {
|
||||||
if (DebugManager.flags.HwQueueSupported.get()) {
|
|
||||||
interfaceVersion = WddmInterfaceVersion::Wddm23;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (interfaceVersion) {
|
switch (interfaceVersion) {
|
||||||
case WddmInterfaceVersion::Wddm20:
|
case WddmInterfaceVersion::Wddm20:
|
||||||
return new Wddm20();
|
return new Wddm20();
|
||||||
|
|
|
@ -52,7 +52,7 @@ WddmCommandStreamReceiver<GfxFamily>::WddmCommandStreamReceiver(const HardwareIn
|
||||||
: BaseClass(hwInfoIn) {
|
: BaseClass(hwInfoIn) {
|
||||||
this->wddm = wddm;
|
this->wddm = wddm;
|
||||||
if (this->wddm == nullptr) {
|
if (this->wddm == nullptr) {
|
||||||
this->wddm = Wddm::createWddm(WddmInterfaceVersion::Wddm20);
|
this->wddm = Wddm::createWddm(Wddm::pickWddmInterfaceVersion(hwInfoIn));
|
||||||
}
|
}
|
||||||
GPUNODE_ORDINAL nodeOrdinal = GPUNODE_3D;
|
GPUNODE_ORDINAL nodeOrdinal = GPUNODE_3D;
|
||||||
UNRECOVERABLE_IF(!WddmEngineMapper<GfxFamily>::engineNodeMap(hwInfoIn.capabilityTable.defaultEngineType, nodeOrdinal));
|
UNRECOVERABLE_IF(!WddmEngineMapper<GfxFamily>::engineNodeMap(hwInfoIn.capabilityTable.defaultEngineType, nodeOrdinal));
|
||||||
|
|
|
@ -86,14 +86,15 @@ struct FeatureTableBase {
|
||||||
bool ftrAstcHdr2D = false;
|
bool ftrAstcHdr2D = false;
|
||||||
bool ftrAstcLdr2D = false;
|
bool ftrAstcLdr2D = false;
|
||||||
|
|
||||||
bool ftrStandardMipTailFormat = false; // Gmmlib
|
bool ftrStandardMipTailFormat = false;
|
||||||
bool ftrFrameBufferLLC = false; // Gmmlib
|
bool ftrFrameBufferLLC = false;
|
||||||
bool ftrCrystalwell = false; // Gmmlib
|
bool ftrCrystalwell = false;
|
||||||
bool ftrLLCBypass = false; // Gmmlib
|
bool ftrLLCBypass = false;
|
||||||
bool ftrDisplayEngineS3d = false; // Gmmlib
|
bool ftrDisplayEngineS3d = false;
|
||||||
bool ftrVERing = false; // Gmmlib
|
bool ftrVERing = false;
|
||||||
bool ftrWddm2GpuMmu = false; // Gmmlib
|
bool ftrWddm2GpuMmu = false;
|
||||||
bool ftrWddm2_1_64kbPages = false; // Gmmlib
|
bool ftrWddm2_1_64kbPages = false;
|
||||||
|
bool ftrWddmHwQueues = false;
|
||||||
|
|
||||||
bool ftrKmdDaf = false;
|
bool ftrKmdDaf = false;
|
||||||
};
|
};
|
||||||
|
@ -107,10 +108,10 @@ struct WorkaroundTableBase {
|
||||||
bool waDisableLSQCROPERFforOCL = false;
|
bool waDisableLSQCROPERFforOCL = false;
|
||||||
bool waMsaa8xTileYDepthPitchAlignment = false;
|
bool waMsaa8xTileYDepthPitchAlignment = false;
|
||||||
bool waLosslessCompressionSurfaceStride = false;
|
bool waLosslessCompressionSurfaceStride = false;
|
||||||
bool waFbcLinearSurfaceStride = false; // Gmmlib
|
bool waFbcLinearSurfaceStride = false;
|
||||||
bool wa4kAlignUVOffsetNV12LinearSurface = false;
|
bool wa4kAlignUVOffsetNV12LinearSurface = false;
|
||||||
bool waEncryptedEdramOnlyPartials = false; // Gmmlib
|
bool waEncryptedEdramOnlyPartials = false;
|
||||||
bool waDisableEdramForDisplayRT = false; // Gmmlib
|
bool waDisableEdramForDisplayRT = false;
|
||||||
bool waForcePcBbFullCfgRestore = false;
|
bool waForcePcBbFullCfgRestore = false;
|
||||||
bool waCompressedResourceRequiresConstVA21 = false;
|
bool waCompressedResourceRequiresConstVA21 = false;
|
||||||
bool waDisablePerCtxtPreemptionGranularityControl = false;
|
bool waDisablePerCtxtPreemptionGranularityControl = false;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, Intel Corporation
|
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
@ -52,7 +52,7 @@ void HwInfoConfigTest::SetUp() {
|
||||||
memcpy(&testSysInfo, pOldSysInfo, sizeof(testSysInfo));
|
memcpy(&testSysInfo, pOldSysInfo, sizeof(testSysInfo));
|
||||||
pInHwInfo->pSysInfo = &testSysInfo;
|
pInHwInfo->pSysInfo = &testSysInfo;
|
||||||
|
|
||||||
memset(&outHwInfo, 0, sizeof(outHwInfo));
|
outHwInfo = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void HwInfoConfigTest::TearDown() {
|
void HwInfoConfigTest::TearDown() {
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "unit_tests/mocks/mock_program.h"
|
#include "unit_tests/mocks/mock_program.h"
|
||||||
#include "unit_tests/mocks/mock_submissions_aggregator.h"
|
#include "unit_tests/mocks/mock_submissions_aggregator.h"
|
||||||
#include "unit_tests/mocks/mock_gmm_page_table_mngr.h"
|
#include "unit_tests/mocks/mock_gmm_page_table_mngr.h"
|
||||||
|
#include "unit_tests/mocks/mock_wddm23.h"
|
||||||
#include "unit_tests/os_interface/windows/mock_wddm_memory_manager.h"
|
#include "unit_tests/os_interface/windows/mock_wddm_memory_manager.h"
|
||||||
#include "unit_tests/os_interface/windows/wddm_fixture.h"
|
#include "unit_tests/os_interface/windows/wddm_fixture.h"
|
||||||
#include "unit_tests/os_interface/windows/mock_gdi_interface.h"
|
#include "unit_tests/os_interface/windows/mock_gdi_interface.h"
|
||||||
|
@ -759,6 +760,30 @@ HWTEST_F(WddmDefaultTest, givenDefaultWddmCsrWhenItIsCreatedThenBatchingIsTurned
|
||||||
EXPECT_EQ(DispatchMode::BatchedDispatch, mockCsr->dispatchMode);
|
EXPECT_EQ(DispatchMode::BatchedDispatch, mockCsr->dispatchMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HWTEST_F(WddmDefaultTest, givenFtrWddmHwQueuesFlagWhenCreatingCsrThenPickWddmVersionBasingOnFtrFlag) {
|
||||||
|
HardwareInfo myHwInfo = *platformDevices[0];
|
||||||
|
FeatureTable myFtrTable = *myHwInfo.pSkuTable;
|
||||||
|
myHwInfo.pSkuTable = &myFtrTable;
|
||||||
|
|
||||||
|
myFtrTable.ftrWddmHwQueues = false;
|
||||||
|
EXPECT_TRUE(WddmInterfaceVersion::Wddm20 == Wddm::pickWddmInterfaceVersion(myHwInfo));
|
||||||
|
{
|
||||||
|
WddmCommandStreamReceiver<FamilyType> wddmCsr20(myHwInfo, nullptr);
|
||||||
|
auto wddm20 = wddmCsr20.peekWddm();
|
||||||
|
EXPECT_EQ(typeid(*wddm20), typeid(WddmMock20));
|
||||||
|
delete wddm20;
|
||||||
|
}
|
||||||
|
|
||||||
|
myFtrTable.ftrWddmHwQueues = true;
|
||||||
|
EXPECT_TRUE(WddmInterfaceVersion::Wddm23 == Wddm::pickWddmInterfaceVersion(myHwInfo));
|
||||||
|
{
|
||||||
|
WddmCommandStreamReceiver<FamilyType> wddmCsr23(myHwInfo, nullptr);
|
||||||
|
auto wddm23 = wddmCsr23.peekWddm();
|
||||||
|
EXPECT_EQ(typeid(*wddm23), typeid(WddmMock23));
|
||||||
|
delete wddm23;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct WddmCsrCompressionTests : WddmCommandStreamMockGdiTest {
|
struct WddmCsrCompressionTests : WddmCommandStreamMockGdiTest {
|
||||||
void setCompressionEnabled(bool enabled) {
|
void setCompressionEnabled(bool enabled) {
|
||||||
RuntimeCapabilityTable capabilityTable = {platformDevices[0]->capabilityTable};
|
RuntimeCapabilityTable capabilityTable = {platformDevices[0]->capabilityTable};
|
||||||
|
|
|
@ -693,10 +693,6 @@ HWTEST_F(Wddm20Tests, givenDebugManagerWhenGetForUseNoRingFlushesKmdModeIsCalled
|
||||||
EXPECT_TRUE(DebugManager.flags.UseNoRingFlushesKmdMode.get());
|
EXPECT_TRUE(DebugManager.flags.UseNoRingFlushesKmdMode.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(Wddm20Tests, givenDebugManagerWhenGetForHwQueueSupportedIsCalledThenFalseIsReturned) {
|
|
||||||
EXPECT_FALSE(DebugManager.flags.HwQueueSupported.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
HWTEST_F(Wddm20Tests, makeResidentMultipleHandles) {
|
HWTEST_F(Wddm20Tests, makeResidentMultipleHandles) {
|
||||||
wddm->init<FamilyType>();
|
wddm->init<FamilyType>();
|
||||||
ASSERT_TRUE(wddm->isInitialized());
|
ASSERT_TRUE(wddm->isInitialized());
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "unit_tests/mocks/mock_wddm23.h"
|
#include "unit_tests/mocks/mock_wddm23.h"
|
||||||
|
|
||||||
namespace OCLRT {
|
namespace OCLRT {
|
||||||
Wddm *Wddm::createWddm(uint32_t interfaceVersion) {
|
Wddm *Wddm::createWddm(WddmInterfaceVersion interfaceVersion) {
|
||||||
switch (interfaceVersion) {
|
switch (interfaceVersion) {
|
||||||
case WddmInterfaceVersion::Wddm20:
|
case WddmInterfaceVersion::Wddm20:
|
||||||
return new WddmMock20();
|
return new WddmMock20();
|
||||||
|
|
|
@ -62,7 +62,6 @@ PrintDriverDiagnostics = -1
|
||||||
FlattenBatchBufferForAUBDump = false
|
FlattenBatchBufferForAUBDump = false
|
||||||
PrintDispatchParameters = false
|
PrintDispatchParameters = false
|
||||||
AddPatchInfoCommentsForAUBDump = false
|
AddPatchInfoCommentsForAUBDump = false
|
||||||
HwQueueSupported = false
|
|
||||||
DisableZeroCopyForUseHostPtr = false
|
DisableZeroCopyForUseHostPtr = false
|
||||||
SchedulerGWS = 0
|
SchedulerGWS = 0
|
||||||
DisableZeroCopyForBuffers = false
|
DisableZeroCopyForBuffers = false
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "runtime/helpers/hw_info.h"
|
||||||
#include "runtime/os_interface/windows/wddm/wddm.h"
|
#include "runtime/os_interface/windows/wddm/wddm.h"
|
||||||
#include "runtime/os_interface/windows/wddm/wddm23.h"
|
#include "runtime/os_interface/windows/wddm/wddm23.h"
|
||||||
#include "unit_tests/helpers/debug_manager_state_restore.h"
|
#include "unit_tests/helpers/debug_manager_state_restore.h"
|
||||||
|
@ -38,17 +39,13 @@ TEST(wddmCreateTests, givenInputVersionWhenCreatingThenCreateRequestedObject) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(wddmCreateTests, givenInvalidInputVersionWhenCreatingThenThrowException) {
|
TEST(wddmCreateTests, givenInvalidInputVersionWhenCreatingThenThrowException) {
|
||||||
EXPECT_THROW(Wddm::createWddm(0), std::exception);
|
EXPECT_THROW(Wddm::createWddm(static_cast<WddmInterfaceVersion>(0)), std::exception);
|
||||||
EXPECT_THROW(Wddm::createWddm(21), std::exception);
|
EXPECT_THROW(Wddm::createWddm(static_cast<WddmInterfaceVersion>(21)), std::exception);
|
||||||
EXPECT_THROW(Wddm::createWddm(22), std::exception);
|
EXPECT_THROW(Wddm::createWddm(static_cast<WddmInterfaceVersion>(22)), std::exception);
|
||||||
EXPECT_THROW(Wddm::createWddm(24), std::exception);
|
EXPECT_THROW(Wddm::createWddm(static_cast<WddmInterfaceVersion>(24)), std::exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(wddmCreateTests, givenHwQueuesSupportedDebugVariableWhenCreatingThenForceWddm23) {
|
TEST(wddmCreateTests, givenNotPopulatedHwInfoWhenAskingForWddmVersionThenReturn20) {
|
||||||
DebugManagerStateRestore restore;
|
HardwareInfo hwInfo = {};
|
||||||
DebugManager.flags.HwQueueSupported.set(true);
|
EXPECT_TRUE(WddmInterfaceVersion::Wddm20 == Wddm::pickWddmInterfaceVersion(hwInfo));
|
||||||
|
|
||||||
std::unique_ptr<Wddm> wddm(Wddm::createWddm(WddmInterfaceVersion::Wddm20));
|
|
||||||
|
|
||||||
EXPECT_EQ(typeid(*wddm.get()), typeid(Wddm23));
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue