2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2018-09-18 09:11:08 +02:00
|
|
|
* Copyright (C) 2017-2018 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "hw_info.h"
|
|
|
|
|
#include "hw_cmds.h"
|
|
|
|
|
|
|
|
|
|
namespace OCLRT {
|
2018-06-12 09:42:47 +02:00
|
|
|
HardwareInfo::HardwareInfo(const PLATFORM *platform, const FeatureTable *skuTable, const WorkaroundTable *waTable,
|
2018-07-02 13:42:23 +02:00
|
|
|
const GT_SYSTEM_INFO *sysInfo, const RuntimeCapabilityTable &capabilityTable)
|
2018-06-12 09:42:47 +02:00
|
|
|
: pPlatform(platform), pSkuTable(skuTable), pWaTable(waTable), pSysInfo(sysInfo), capabilityTable(capabilityTable) {
|
|
|
|
|
}
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
|
const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT] = {};
|
2018-08-27 12:11:07 +02:00
|
|
|
void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(GT_SYSTEM_INFO *, FeatureTable *, bool) = {
|
2017-12-21 00:45:38 +01:00
|
|
|
nullptr,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const FeatureTable emptySkuTable = {};
|
|
|
|
|
const WorkaroundTable emptyWaTable = {};
|
|
|
|
|
|
2018-04-17 18:11:50 +02:00
|
|
|
const char *getPlatformType(const HardwareInfo &hwInfo) {
|
2018-04-27 09:42:32 +02:00
|
|
|
if (hwInfo.capabilityTable.isCore) {
|
2018-04-17 18:11:50 +02:00
|
|
|
return "core";
|
|
|
|
|
}
|
|
|
|
|
return "lp";
|
|
|
|
|
}
|
2018-06-07 16:18:53 +02:00
|
|
|
|
|
|
|
|
bool getHwInfoForPlatformString(const char *str, const HardwareInfo *&hwInfoIn) {
|
|
|
|
|
bool ret = false;
|
|
|
|
|
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
|
|
|
|
|
if (hardwarePrefix[j] == nullptr)
|
|
|
|
|
continue;
|
|
|
|
|
if (strcmp(hardwarePrefix[j], str) == 0) {
|
|
|
|
|
hwInfoIn = hardwareInfoTable[j];
|
|
|
|
|
ret = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
2017-12-21 00:45:38 +01:00
|
|
|
} // namespace OCLRT
|