2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "runtime/os_interface/hw_info_config.h"
|
|
|
|
|
2018-03-23 17:49:30 +08:00
|
|
|
#include "runtime/command_stream/preemption.h"
|
|
|
|
#include "runtime/gen_common/hw_cmds.h"
|
|
|
|
#include "runtime/helpers/hw_helper.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "runtime/helpers/hw_info.h"
|
2018-03-23 17:49:30 +08:00
|
|
|
#include "runtime/memory_manager/memory_constants.h"
|
|
|
|
#include "runtime/os_interface/debug_settings_manager.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-09-29 05:36:11 +08:00
|
|
|
#include "instrumentation.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-03-15 22:03:51 +08:00
|
|
|
|
|
|
|
HwInfoConfig *hwInfoConfigFactory[IGFX_MAX_PRODUCT] = {};
|
|
|
|
|
|
|
|
int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *outHwInfo, OSInterface *osIface) {
|
2018-03-23 17:49:30 +08:00
|
|
|
HwHelper &hwHelper = HwHelper::get(outHwInfo->pPlatform->eRenderCoreFamily);
|
|
|
|
|
|
|
|
outHwInfo->capabilityTable.ftrSvm = outHwInfo->pSkuTable->ftrSVM;
|
|
|
|
|
|
|
|
hwHelper.adjustDefaultEngineType(outHwInfo);
|
|
|
|
const auto nodeOrdinal = DebugManager.flags.NodeOrdinal.get();
|
|
|
|
outHwInfo->capabilityTable.defaultEngineType = nodeOrdinal == -1
|
|
|
|
? outHwInfo->capabilityTable.defaultEngineType
|
|
|
|
: static_cast<EngineType>(nodeOrdinal);
|
|
|
|
|
|
|
|
hwHelper.setCapabilityCoherencyFlag(outHwInfo, outHwInfo->capabilityTable.ftrSupportsCoherency);
|
|
|
|
|
|
|
|
hwHelper.setupPreemptionRegisters(outHwInfo, outHwInfo->pWaTable->waEnablePreemptionGranularityControlByUMD);
|
|
|
|
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
|
|
|
|
static_cast<bool>(outHwInfo->pSkuTable->ftrGpGpuMidThreadLevelPreempt),
|
|
|
|
static_cast<bool>(outHwInfo->pSkuTable->ftrGpGpuThreadGroupLevelPreempt),
|
|
|
|
static_cast<bool>(outHwInfo->pSkuTable->ftrGpGpuMidBatchPreempt));
|
|
|
|
outHwInfo->capabilityTable.requiredPreemptionSurfaceSize = outHwInfo->pSysInfo->CsrSizeInMb * MemoryConstants::megaByte;
|
|
|
|
|
|
|
|
outHwInfo->capabilityTable.instrumentationEnabled &= haveInstrumentation;
|
|
|
|
|
|
|
|
auto &kmdNotifyProperties = outHwInfo->capabilityTable.kmdNotifyProperties;
|
2018-04-10 16:26:59 +08:00
|
|
|
KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideEnableKmdNotify.get(), kmdNotifyProperties.enableKmdNotify);
|
|
|
|
KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideKmdNotifyDelayMicroseconds.get(), kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
|
|
|
KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideEnableQuickKmdSleep.get(), kmdNotifyProperties.enableQuickKmdSleep);
|
|
|
|
KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideQuickKmdSleepDelayMicroseconds.get(), kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
|
|
|
KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideEnableQuickKmdSleepForSporadicWaits.get(), kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
|
|
|
|
KmdNotifyHelper::overrideFromDebugVariable(DebugManager.flags.OverrideDelayQuickKmdSleepForSporadicWaitsMicroseconds.get(), kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds);
|
2018-03-23 17:49:30 +08:00
|
|
|
|
|
|
|
// Product specific config
|
|
|
|
int ret = configureHardwareCustom(outHwInfo, osIface);
|
|
|
|
if (ret != 0) {
|
2018-07-11 17:25:11 +08:00
|
|
|
outHwInfo = {};
|
2018-03-23 17:49:30 +08:00
|
|
|
}
|
|
|
|
return ret;
|
2018-03-15 22:03:51 +08:00
|
|
|
}
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|