2019-09-18 19:32:33 +02:00
|
|
|
/*
|
2022-02-02 19:46:25 +00:00
|
|
|
* Copyright (C) 2019-2022 Intel Corporation
|
2019-09-18 19:32:33 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-08-26 22:36:51 +02:00
|
|
|
#include "shared/source/gen12lp/aub_mapper.h"
|
2020-03-13 13:14:28 +01:00
|
|
|
#include "shared/source/gen12lp/hw_cmds.h"
|
|
|
|
|
|
|
|
using Family = NEO::TGLLPFamily;
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/flat_batch_buffer_helper_hw.inl"
|
2020-10-22 11:25:32 +02:00
|
|
|
#include "shared/source/helpers/hw_helper_base.inl"
|
2021-08-03 11:48:35 +00:00
|
|
|
#include "shared/source/helpers/hw_helper_bdw_and_later.inl"
|
|
|
|
#include "shared/source/helpers/hw_helper_tgllp_and_later.inl"
|
2022-06-14 14:18:28 +00:00
|
|
|
#include "shared/source/helpers/logical_state_helper.inl"
|
2020-06-16 16:25:46 +02:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2019-09-18 19:32:33 +02:00
|
|
|
#include "engine_node.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
2022-03-17 15:53:21 +00:00
|
|
|
template <>
|
|
|
|
inline bool HwHelperHw<Family>::isFusedEuDispatchEnabled(const HardwareInfo &hwInfo, bool disableEUFusionForKernel) const {
|
|
|
|
auto fusedEuDispatchEnabled = !hwInfo.workaroundTable.flags.waDisableFusedThreadScheduling;
|
|
|
|
fusedEuDispatchEnabled &= hwInfo.capabilityTable.fusedEuEnabled;
|
|
|
|
|
|
|
|
if (disableEUFusionForKernel)
|
|
|
|
fusedEuDispatchEnabled = false;
|
|
|
|
|
|
|
|
if (DebugManager.flags.CFEFusedEUDispatch.get() != -1) {
|
|
|
|
fusedEuDispatchEnabled = (DebugManager.flags.CFEFusedEUDispatch.get() == 0);
|
|
|
|
}
|
|
|
|
return fusedEuDispatchEnabled;
|
|
|
|
}
|
|
|
|
|
2020-03-20 11:52:03 +01:00
|
|
|
template <>
|
2021-10-08 13:01:26 +00:00
|
|
|
size_t HwHelperHw<Family>::getMax3dImageWidthOrHeight() const {
|
|
|
|
return 2048;
|
2020-03-20 11:52:03 +01:00
|
|
|
}
|
|
|
|
|
2019-12-13 16:31:09 +01:00
|
|
|
template <>
|
2020-01-23 15:52:49 +01:00
|
|
|
bool HwHelperHw<Family>::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const {
|
2021-09-27 14:43:52 +00:00
|
|
|
return isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo);
|
2019-12-13 16:31:09 +01:00
|
|
|
}
|
|
|
|
|
2020-10-09 12:27:32 +02:00
|
|
|
template <>
|
|
|
|
bool HwHelperHw<Family>::isWaDisableRccRhwoOptimizationRequired() const {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-02-05 14:16:42 +00:00
|
|
|
template <>
|
|
|
|
bool HwHelperHw<Family>::isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const {
|
2021-11-25 09:31:14 +00:00
|
|
|
return featureTable->flags.ftrGpGpuMidThreadLevelPreempt;
|
2021-02-05 14:16:42 +00:00
|
|
|
}
|
|
|
|
|
2019-09-18 19:32:33 +02:00
|
|
|
template <>
|
|
|
|
uint32_t HwHelperHw<Family>::getComputeUnitsUsedForScratch(const HardwareInfo *pHwInfo) const {
|
|
|
|
/* For ICL+ maxThreadCount equals (EUCount * 8).
|
|
|
|
ThreadCount/EUCount=7 is no longer valid, so we have to force 8 in below formula.
|
|
|
|
This is required to allocate enough scratch space. */
|
|
|
|
return pHwInfo->gtSystemInfo.MaxSubSlicesSupported * pHwInfo->gtSystemInfo.MaxEuPerSubSlice * 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
bool HwHelperHw<Family>::isLocalMemoryEnabled(const HardwareInfo &hwInfo) const {
|
2021-11-25 09:31:14 +00:00
|
|
|
return hwInfo.featureTable.flags.ftrLocalMemory;
|
2019-09-18 19:32:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2021-12-03 13:52:16 +00:00
|
|
|
bool HwHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
2021-08-26 18:14:02 +00:00
|
|
|
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
|
|
|
|
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
|
|
|
|
}
|
2020-01-10 11:22:54 +01:00
|
|
|
return false;
|
2019-09-18 19:32:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2019-11-14 14:34:34 +01:00
|
|
|
bool HwHelperHw<Family>::checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) {
|
2021-12-02 16:47:05 +00:00
|
|
|
return !graphicsAllocation.isCompressionEnabled();
|
2019-09-18 19:32:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2021-01-13 14:42:47 +01:00
|
|
|
uint32_t HwHelperHw<Family>::getPitchAlignmentForImage(const HardwareInfo *hwInfo) const {
|
2021-09-24 14:29:49 +00:00
|
|
|
if (HwInfoConfig::get(hwInfo->platform.eProductFamily)->imagePitchAlignmentWARequired(*hwInfo)) {
|
|
|
|
return 64u;
|
2019-09-18 19:32:33 +02:00
|
|
|
}
|
|
|
|
return 4u;
|
|
|
|
}
|
|
|
|
|
2019-11-13 14:48:44 +01:00
|
|
|
template <>
|
|
|
|
uint32_t HwHelperHw<Family>::getMetricsLibraryGenId() const {
|
|
|
|
return static_cast<uint32_t>(MetricsLibraryApi::ClientGen::Gen12);
|
|
|
|
}
|
|
|
|
|
2019-09-18 19:32:33 +02:00
|
|
|
template <>
|
2021-08-18 15:34:29 +00:00
|
|
|
const EngineInstancesContainer HwHelperHw<Family>::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const {
|
2020-02-21 15:25:04 +01:00
|
|
|
auto defaultEngine = getChosenEngineType(hwInfo);
|
|
|
|
|
2021-11-26 16:58:20 +00:00
|
|
|
EngineInstancesContainer engines;
|
2020-02-21 15:25:04 +01:00
|
|
|
|
2021-11-25 09:31:14 +00:00
|
|
|
if (defaultEngine == aub_stream::EngineType::ENGINE_CCS && hwInfo.featureTable.flags.ftrCCSNode && !hwInfo.featureTable.flags.ftrGpGpuMidThreadLevelPreempt) {
|
2020-09-15 17:29:02 +02:00
|
|
|
engines.push_back({aub_stream::ENGINE_CCS, EngineUsage::Regular});
|
2020-02-21 15:25:04 +01:00
|
|
|
}
|
|
|
|
|
2021-11-26 16:58:20 +00:00
|
|
|
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::Regular});
|
|
|
|
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::LowPriority}); // low priority
|
|
|
|
engines.push_back({defaultEngine, EngineUsage::Internal}); // internal usage
|
|
|
|
|
2021-11-08 17:03:15 +00:00
|
|
|
if (hwInfo.capabilityTable.blitterOperationsSupported) {
|
|
|
|
if (hwInfo.featureTable.ftrBcsInfo.test(0)) {
|
|
|
|
engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::Regular});
|
|
|
|
}
|
2020-05-04 16:34:13 +02:00
|
|
|
}
|
|
|
|
|
2020-02-21 15:25:04 +01:00
|
|
|
return engines;
|
2019-09-18 19:32:33 +02:00
|
|
|
};
|
|
|
|
|
2020-07-28 01:36:52 -07:00
|
|
|
template <>
|
2021-08-16 18:24:13 +00:00
|
|
|
EngineGroupType HwHelperHw<Family>::getEngineGroupType(aub_stream::EngineType engineType, EngineUsage engineUsage, const HardwareInfo &hwInfo) const {
|
2020-12-15 16:37:05 +00:00
|
|
|
switch (engineType) {
|
|
|
|
case aub_stream::ENGINE_RCS:
|
|
|
|
return EngineGroupType::RenderCompute;
|
|
|
|
case aub_stream::ENGINE_CCS:
|
|
|
|
return EngineGroupType::Compute;
|
|
|
|
case aub_stream::ENGINE_BCS:
|
|
|
|
return EngineGroupType::Copy;
|
|
|
|
default:
|
|
|
|
UNRECOVERABLE_IF(true);
|
2020-07-28 01:36:52 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-06 15:10:59 +01:00
|
|
|
template <>
|
2022-05-25 15:35:43 +00:00
|
|
|
std::string HwHelperHw<Family>::getExtensions(const HardwareInfo &hwInfo) const {
|
2022-04-12 17:51:03 +00:00
|
|
|
std::string extensions;
|
|
|
|
extensions += "cl_intel_subgroup_local_block_io ";
|
|
|
|
|
|
|
|
return extensions;
|
2020-02-06 15:10:59 +01:00
|
|
|
}
|
|
|
|
|
2020-02-10 11:02:21 +01:00
|
|
|
template <>
|
2020-04-26 21:48:59 +02:00
|
|
|
inline void MemorySynchronizationCommands<Family>::setPipeControlExtraProperties(PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
|
|
|
|
pipeControl.setHdcPipelineFlush(args.hdcPipelineFlush);
|
2020-09-30 15:06:42 +02:00
|
|
|
|
|
|
|
if (DebugManager.flags.FlushAllCaches.get()) {
|
|
|
|
pipeControl.setHdcPipelineFlush(true);
|
|
|
|
}
|
|
|
|
if (DebugManager.flags.DoNotFlushCaches.get()) {
|
|
|
|
pipeControl.setHdcPipelineFlush(false);
|
|
|
|
}
|
2020-04-26 21:48:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2020-09-30 15:06:42 +02:00
|
|
|
void MemorySynchronizationCommands<Family>::setCacheFlushExtraProperties(PipeControlArgs &args) {
|
|
|
|
args.hdcPipelineFlush = true;
|
|
|
|
args.constantCacheInvalidationEnable = false;
|
2020-02-10 11:02:21 +01:00
|
|
|
}
|
|
|
|
|
2020-09-03 09:06:11 +02:00
|
|
|
template <>
|
|
|
|
bool HwHelperHw<Family>::useOnlyGlobalTimestamps() const {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-10-01 12:22:54 +02:00
|
|
|
template <>
|
|
|
|
uint32_t HwHelperHw<Family>::getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const {
|
|
|
|
if (l3enabled) {
|
2020-10-12 10:13:29 +02:00
|
|
|
if (DebugManager.flags.ForceL1Caching.get() != 1) {
|
|
|
|
l1enabled = false;
|
2020-10-01 12:22:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (l1enabled) {
|
|
|
|
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST) >> 1;
|
|
|
|
} else {
|
|
|
|
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
|
|
|
|
}
|
|
|
|
|
2020-10-05 18:32:55 +02:00
|
|
|
template <>
|
2021-09-28 10:54:52 +00:00
|
|
|
bool MemorySynchronizationCommands<Family>::isPipeControlWArequired(const HardwareInfo &hwInfo) {
|
2021-09-24 14:29:49 +00:00
|
|
|
return HwInfoConfig::get(hwInfo.platform.eProductFamily)->pipeControlWARequired(hwInfo);
|
2020-10-05 18:32:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2021-09-28 10:54:52 +00:00
|
|
|
bool MemorySynchronizationCommands<Family>::isPipeControlPriorToPipelineSelectWArequired(const HardwareInfo &hwInfo) {
|
|
|
|
return MemorySynchronizationCommands<Family>::isPipeControlWArequired(hwInfo);
|
2020-10-05 18:32:55 +02:00
|
|
|
}
|
|
|
|
|
2020-10-30 09:02:18 +01:00
|
|
|
template <>
|
2021-09-28 10:54:52 +00:00
|
|
|
void HwHelperHw<Family>::setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const HardwareInfo &hwInfo) const {
|
2021-09-09 12:27:41 +00:00
|
|
|
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
|
|
|
if (hwInfoConfig.getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed) {
|
2020-10-30 09:02:18 +01:00
|
|
|
if (GraphicsAllocation::isCpuAccessRequired(properties.allocationType)) {
|
|
|
|
allocationData.flags.useSystemMemory = true;
|
|
|
|
}
|
|
|
|
}
|
2021-09-28 10:54:52 +00:00
|
|
|
if (HwInfoConfig::get(hwInfo.platform.eProductFamily)->isStorageInfoAdjustmentRequired()) {
|
2022-02-04 13:59:01 +00:00
|
|
|
if (properties.allocationType == AllocationType::BUFFER && !properties.flags.preferCompressed && !properties.flags.shareable) {
|
2021-05-13 19:42:16 +00:00
|
|
|
allocationData.storageInfo.isLockable = true;
|
|
|
|
}
|
|
|
|
}
|
2020-10-30 09:02:18 +01:00
|
|
|
}
|
|
|
|
|
2021-12-20 16:09:41 +00:00
|
|
|
template <>
|
|
|
|
bool HwHelperHw<Family>::forceNonGpuCoherencyWA(bool requiresCoherency) const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-09-18 19:32:33 +02:00
|
|
|
template class HwHelperHw<Family>;
|
|
|
|
template class FlatBatchBufferHelperHw<Family>;
|
2020-02-17 12:45:24 +01:00
|
|
|
template struct MemorySynchronizationCommands<Family>;
|
2020-04-28 16:48:23 +02:00
|
|
|
template struct LriHelper<Family>;
|
2022-06-14 14:18:28 +00:00
|
|
|
|
2022-07-04 14:16:44 +00:00
|
|
|
template LogicalStateHelper *LogicalStateHelper::create<Family>();
|
2019-09-18 19:32:33 +02:00
|
|
|
} // namespace NEO
|