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"
|
|
|
|
|
2019-11-15 23:20:45 +08:00
|
|
|
#include "core/command_stream/preemption.h"
|
2019-11-13 17:01:19 +08:00
|
|
|
#include "core/helpers/hw_helper.h"
|
2019-09-04 16:58:52 +08:00
|
|
|
#include "core/memory_manager/memory_constants.h"
|
2018-03-23 17:49:30 +08:00
|
|
|
#include "runtime/gen_common/hw_cmds.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/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) {
|
2019-05-08 22:00:24 +08:00
|
|
|
HwHelper &hwHelper = HwHelper::get(outHwInfo->platform.eRenderCoreFamily);
|
2018-03-23 17:49:30 +08:00
|
|
|
|
2019-05-08 22:00:24 +08:00
|
|
|
outHwInfo->capabilityTable.ftrSvm = outHwInfo->featureTable.ftrSVM;
|
2018-03-23 17:49:30 +08:00
|
|
|
|
|
|
|
hwHelper.adjustDefaultEngineType(outHwInfo);
|
2019-03-27 17:06:29 +08:00
|
|
|
outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo);
|
2018-03-23 17:49:30 +08:00
|
|
|
|
|
|
|
hwHelper.setCapabilityCoherencyFlag(outHwInfo, outHwInfo->capabilityTable.ftrSupportsCoherency);
|
|
|
|
|
|
|
|
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
|
2019-05-08 22:00:24 +08:00
|
|
|
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidThreadLevelPreempt),
|
|
|
|
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt),
|
|
|
|
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt));
|
|
|
|
outHwInfo->capabilityTable.requiredPreemptionSurfaceSize = outHwInfo->gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte;
|
2018-03-23 17:49:30 +08:00
|
|
|
|
2019-08-13 16:06:28 +08:00
|
|
|
outHwInfo->capabilityTable.instrumentationEnabled =
|
|
|
|
(outHwInfo->capabilityTable.instrumentationEnabled && haveInstrumentation);
|
2018-03-23 17:49:30 +08:00
|
|
|
|
|
|
|
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
|