2019-09-19 01:32:33 +08:00
|
|
|
/*
|
2019-12-23 21:28:33 +08:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-09-19 01:32:33 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_container/command_encoder.h"
|
|
|
|
#include "shared/source/helpers/flat_batch_buffer_helper_hw.inl"
|
|
|
|
#include "shared/source/helpers/hw_helper_bdw_plus.inl"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/aub/aub_helper_bdw_plus.inl"
|
|
|
|
#include "opencl/source/gen12lp/helpers_gen12lp.h"
|
2019-09-19 01:32:33 +08:00
|
|
|
|
|
|
|
#include "engine_node.h"
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
typedef TGLLPFamily Family;
|
|
|
|
|
2019-12-13 23:31:09 +08:00
|
|
|
template <>
|
2020-01-23 22:52:49 +08:00
|
|
|
bool HwHelperHw<Family>::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const {
|
2020-01-27 22:42:06 +08:00
|
|
|
return Gen12LPHelpers::isOffsetToSkipSetFFIDGPWARequired(hwInfo);
|
2019-12-13 23:31:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
bool HwHelperHw<Family>::isForceDefaultRCSEngineWARequired(const HardwareInfo &hwInfo) {
|
2020-01-27 22:42:06 +08:00
|
|
|
return Gen12LPHelpers::isForceDefaultRCSEngineWARequired(hwInfo);
|
2019-12-13 23:31:09 +08:00
|
|
|
}
|
|
|
|
|
2019-12-19 21:26:29 +08:00
|
|
|
template <>
|
|
|
|
bool HwHelperHw<Family>::isForceEmuInt32DivRemSPWARequired(const HardwareInfo &hwInfo) {
|
2020-01-27 22:42:06 +08:00
|
|
|
return Gen12LPHelpers::isForceEmuInt32DivRemSPWARequired(hwInfo);
|
2019-12-19 21:26:29 +08:00
|
|
|
}
|
|
|
|
|
2019-09-19 01:32:33 +08:00
|
|
|
template <>
|
|
|
|
void HwHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo) {
|
2019-12-13 23:31:09 +08:00
|
|
|
if (!pHwInfo->featureTable.ftrCCSNode || isForceDefaultRCSEngineWARequired(*pHwInfo)) {
|
2019-09-19 01:32:33 +08:00
|
|
|
pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
|
|
|
return Gen12LPHelpers::isLocalMemoryEnabled(hwInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
bool HwHelperHw<Family>::isPageTableManagerSupported(const HardwareInfo &hwInfo) const {
|
2020-01-10 18:22:54 +08:00
|
|
|
return hwInfo.capabilityTable.ftrRenderCompressedBuffers || hwInfo.capabilityTable.ftrRenderCompressedImages;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2019-10-09 23:32:35 +08:00
|
|
|
bool HwHelperHw<Family>::obtainRenderBufferCompressionPreference(const HardwareInfo &hwInfo, const size_t size) const {
|
2020-01-10 18:22:54 +08:00
|
|
|
return false;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2019-11-14 21:34:34 +08:00
|
|
|
bool HwHelperHw<Family>::checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) {
|
|
|
|
if (graphicsAllocation.getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) {
|
|
|
|
return false;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
2019-11-14 21:34:34 +08:00
|
|
|
return true;
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void HwHelperHw<Family>::setCapabilityCoherencyFlag(const HardwareInfo *pHwInfo, bool &coherencyFlag) {
|
|
|
|
coherencyFlag = true;
|
|
|
|
if (pHwInfo->platform.eProductFamily == IGFX_TIGERLAKE_LP && pHwInfo->platform.usRevId == 0x0) {
|
|
|
|
//stepping A0 devices - turn off coherency
|
|
|
|
coherencyFlag = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Gen12LPHelpers::adjustCoherencyFlag(pHwInfo->platform.eProductFamily, coherencyFlag);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
uint32_t HwHelperHw<Family>::getPitchAlignmentForImage(const HardwareInfo *hwInfo) {
|
|
|
|
if (Gen12LPHelpers::imagePitchAlignmentWaRequired(hwInfo->platform.eProductFamily)) {
|
|
|
|
auto stepping = hwInfo->platform.usRevId;
|
|
|
|
if (stepping == 0) {
|
|
|
|
return 64u;
|
|
|
|
}
|
|
|
|
return 4u;
|
|
|
|
}
|
|
|
|
return 4u;
|
|
|
|
}
|
|
|
|
|
2019-11-13 21:48:44 +08:00
|
|
|
template <>
|
|
|
|
uint32_t HwHelperHw<Family>::getMetricsLibraryGenId() const {
|
|
|
|
return static_cast<uint32_t>(MetricsLibraryApi::ClientGen::Gen12);
|
|
|
|
}
|
|
|
|
|
2019-09-19 01:32:33 +08:00
|
|
|
template <>
|
|
|
|
const std::vector<aub_stream::EngineType> HwHelperHw<Family>::getGpgpuEngineInstances() const {
|
2020-01-21 16:35:12 +08:00
|
|
|
constexpr std::array<aub_stream::EngineType, 4> gpgpuEngineInstances = {{aub_stream::ENGINE_RCS,
|
2019-09-19 01:32:33 +08:00
|
|
|
aub_stream::ENGINE_RCS, // low priority
|
2020-01-21 16:35:12 +08:00
|
|
|
aub_stream::ENGINE_RCS, // internal usage
|
2019-09-19 01:32:33 +08:00
|
|
|
aub_stream::ENGINE_CCS}};
|
|
|
|
return std::vector<aub_stream::EngineType>(gpgpuEngineInstances.begin(), gpgpuEngineInstances.end());
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
2020-02-17 19:45:24 +08:00
|
|
|
void MemorySynchronizationCommands<Family>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
2019-09-19 01:32:33 +08:00
|
|
|
if (Gen12LPHelpers::pipeControlWaRequired(hwInfo.platform.eProductFamily)) {
|
|
|
|
auto stepping = hwInfo.platform.usRevId;
|
|
|
|
if (stepping == 0) {
|
|
|
|
auto pCmd = static_cast<Family::PIPE_CONTROL *>(commandStream.getSpace(sizeof(Family::PIPE_CONTROL)));
|
|
|
|
*pCmd = Family::cmdInitPipeControl;
|
|
|
|
pCmd->setCommandStreamerStallEnable(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-06 22:10:59 +08:00
|
|
|
template <>
|
|
|
|
std::string HwHelperHw<Family>::getExtensions() const {
|
|
|
|
return "cl_intel_subgroup_local_block_io ";
|
|
|
|
}
|
|
|
|
|
2020-02-10 18:02:21 +08:00
|
|
|
template <>
|
2020-02-17 19:45:24 +08:00
|
|
|
void MemorySynchronizationCommands<Family>::setExtraCacheFlushFields(Family::PIPE_CONTROL *pipeControl) {
|
2020-02-10 18:02:21 +08:00
|
|
|
pipeControl->setHdcPipelineFlush(true);
|
|
|
|
}
|
|
|
|
|
2020-02-19 21:45:06 +08:00
|
|
|
template <>
|
|
|
|
void MemorySynchronizationCommands<Family>::addAdditionalSynchronization(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
|
|
|
using MI_SEMAPHORE_WAIT = typename Family::MI_SEMAPHORE_WAIT;
|
|
|
|
|
|
|
|
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
|
|
|
if (hwHelper.isLocalMemoryEnabled(hwInfo)) {
|
|
|
|
auto miSemaphoreWait = static_cast<MI_SEMAPHORE_WAIT *>(commandStream.getSpace(sizeof(MI_SEMAPHORE_WAIT)));
|
|
|
|
EncodeSempahore<Family>::programMiSemaphoreWait(miSemaphoreWait,
|
|
|
|
gpuAddress,
|
|
|
|
EncodeSempahore<Family>::invalidHardwareTag,
|
|
|
|
MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
size_t MemorySynchronizationCommands<Family>::getSizeForSingleSynchronization(const HardwareInfo &hwInfo) {
|
|
|
|
auto size = 0u;
|
|
|
|
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
|
|
|
if (hwHelper.isLocalMemoryEnabled(hwInfo)) {
|
|
|
|
size += sizeof(typename Family::MI_SEMAPHORE_WAIT);
|
|
|
|
}
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
size_t MemorySynchronizationCommands<Family>::getSizeForAdditonalSynchronization(const HardwareInfo &hwInfo) {
|
|
|
|
return 2 * getSizeForSingleSynchronization(hwInfo);
|
|
|
|
}
|
|
|
|
|
2019-09-19 01:32:33 +08:00
|
|
|
template class AubHelperHw<Family>;
|
|
|
|
template class HwHelperHw<Family>;
|
|
|
|
template class FlatBatchBufferHelperHw<Family>;
|
2020-02-17 19:45:24 +08:00
|
|
|
template struct MemorySynchronizationCommands<Family>;
|
2019-09-19 01:32:33 +08:00
|
|
|
} // namespace NEO
|