2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2021-01-05 17:00:12 +00:00
|
|
|
* Copyright (C) 2019-2021 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
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2021-10-21 14:30:54 +00:00
|
|
|
#include "shared/source/command_container/command_encoder.h"
|
2020-02-25 13:32:27 +01:00
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/gmm_helper/gmm.h"
|
|
|
|
|
#include "shared/source/gmm_helper/gmm_helper.h"
|
|
|
|
|
#include "shared/source/helpers/aligned_memory.h"
|
2020-06-08 21:49:11 +02:00
|
|
|
#include "shared/source/helpers/basic_math.h"
|
2020-04-02 11:28:38 +02:00
|
|
|
#include "shared/source/helpers/constants.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
|
|
|
|
#include "shared/source/helpers/preamble.h"
|
2021-05-14 10:20:32 +00:00
|
|
|
#include "shared/source/helpers/timestamp_packet.h"
|
2020-06-02 13:38:02 +02:00
|
|
|
#include "shared/source/memory_manager/allocation_properties.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2021-08-20 15:41:43 +00:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/os_interface/os_interface.h"
|
2021-05-14 10:20:32 +00:00
|
|
|
#include "shared/source/utilities/tag_allocator.h"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2021-03-19 13:43:50 +01:00
|
|
|
#include "aub_mem_dump.h"
|
2020-04-26 21:48:59 +02:00
|
|
|
#include "pipe_control_args.h"
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-11-22 15:16:20 +01:00
|
|
|
|
2019-11-21 21:32:16 +01:00
|
|
|
template <typename Family>
|
|
|
|
|
const AuxTranslationMode HwHelperHw<Family>::defaultAuxTranslationMode = AuxTranslationMode::Builtin;
|
|
|
|
|
|
2019-03-19 12:57:47 +01:00
|
|
|
template <typename Family>
|
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();
|
|
|
|
|
}
|
2019-04-17 12:56:54 +02:00
|
|
|
return size > KB;
|
2019-03-19 12:57:47 +01:00
|
|
|
}
|
|
|
|
|
|
2018-02-19 09:50:17 +01:00
|
|
|
template <typename Family>
|
2021-10-08 13:01:26 +00:00
|
|
|
size_t HwHelperHw<Family>::getMax3dImageWidthOrHeight() const {
|
|
|
|
|
return 16384;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename Family>
|
|
|
|
|
uint64_t HwHelperHw<Family>::getMaxMemAllocSize() const {
|
2018-06-08 16:42:29 +02:00
|
|
|
//With statefull messages we have an allocation cap of 4GB
|
|
|
|
|
//Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching..
|
2021-10-08 13:01:26 +00:00
|
|
|
return (4ULL * MemoryConstants::gigaByte) - (8ULL * MemoryConstants::kiloByte);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename Family>
|
|
|
|
|
bool HwHelperHw<Family>::isStatelesToStatefullWithOffsetSupported() const {
|
|
|
|
|
return true;
|
2018-02-19 09:50:17 +01:00
|
|
|
}
|
|
|
|
|
|
2019-08-28 20:46:37 -07:00
|
|
|
template <typename Family>
|
|
|
|
|
bool HwHelperHw<Family>::isL3Configurable(const HardwareInfo &hwInfo) {
|
|
|
|
|
return PreambleHelper<Family>::isL3Configurable(hwInfo);
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-06 14:25:22 +02:00
|
|
|
template <typename Family>
|
2021-01-14 13:08:10 +01:00
|
|
|
SipKernelType HwHelperHw<Family>::getSipKernelType(bool debuggingActive) const {
|
2018-04-06 14:25:22 +02:00
|
|
|
if (!debuggingActive) {
|
|
|
|
|
return SipKernelType::Csr;
|
|
|
|
|
}
|
2021-10-18 15:59:47 +00:00
|
|
|
return DebugManager.flags.UseBindlessDebugSip.get() ? SipKernelType::DbgBindless : SipKernelType::DbgCsr;
|
2018-04-06 14:25:22 +02:00
|
|
|
}
|
2018-07-10 13:22:11 +02:00
|
|
|
|
2018-09-06 16:41:50 +02:00
|
|
|
template <typename Family>
|
|
|
|
|
size_t HwHelperHw<Family>::getMaxBarrierRegisterPerSlice() const {
|
|
|
|
|
return 32;
|
|
|
|
|
}
|
2018-09-25 12:44:36 -07:00
|
|
|
|
2021-04-23 14:09:03 +00:00
|
|
|
template <typename Family>
|
|
|
|
|
size_t HwHelperHw<Family>::getPaddingForISAAllocation() const {
|
|
|
|
|
return 512;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-23 00:23:10 +02:00
|
|
|
template <typename Family>
|
2021-01-13 14:42:47 +01:00
|
|
|
uint32_t HwHelperHw<Family>::getPitchAlignmentForImage(const HardwareInfo *hwInfo) const {
|
2019-08-23 00:23:10 +02:00
|
|
|
return 4u;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-20 19:33:19 +02:00
|
|
|
template <typename Family>
|
|
|
|
|
uint32_t HwHelperHw<Family>::getMaxNumSamplers() const {
|
|
|
|
|
return 16;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-25 12:44:36 -07:00
|
|
|
template <typename Family>
|
2019-03-27 10:06:29 +01:00
|
|
|
const AubMemDump::LrcaHelper &HwHelperHw<Family>::getCsTraits(aub_stream::EngineType engineType) const {
|
2019-03-20 10:56:22 +01:00
|
|
|
return *AUBFamilyMapper<Family>::csTraits[engineType];
|
2018-09-25 12:44:36 -07:00
|
|
|
}
|
2018-10-02 10:10:29 -07:00
|
|
|
|
2020-02-13 13:28:21 +01:00
|
|
|
template <typename Family>
|
|
|
|
|
bool HwHelperHw<Family>::isFenceAllocationRequired(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-29 11:48:32 +01:00
|
|
|
template <typename GfxFamily>
|
2019-11-14 14:34:34 +01:00
|
|
|
inline bool HwHelperHw<GfxFamily>::checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) {
|
|
|
|
|
return true;
|
2019-03-29 11:48:32 +01:00
|
|
|
}
|
|
|
|
|
|
2018-11-22 15:16:20 +01:00
|
|
|
template <typename Family>
|
2020-02-25 13:32:27 +01:00
|
|
|
void HwHelperHw<Family>::setRenderSurfaceStateForBuffer(const RootDeviceEnvironment &rootDeviceEnvironment,
|
2018-11-22 15:16:20 +01:00
|
|
|
void *surfaceStateBuffer,
|
|
|
|
|
size_t bufferSize,
|
|
|
|
|
uint64_t gpuVa,
|
|
|
|
|
size_t offset,
|
|
|
|
|
uint32_t pitch,
|
|
|
|
|
GraphicsAllocation *gfxAlloc,
|
2019-11-14 14:34:34 +01:00
|
|
|
bool isReadOnly,
|
2018-11-22 15:16:20 +01:00
|
|
|
uint32_t surfaceType,
|
2020-05-07 11:52:25 +02:00
|
|
|
bool forceNonAuxMode,
|
|
|
|
|
bool useL1Cache) {
|
2018-11-22 15:16:20 +01:00
|
|
|
using RENDER_SURFACE_STATE = typename Family::RENDER_SURFACE_STATE;
|
|
|
|
|
using SURFACE_FORMAT = typename RENDER_SURFACE_STATE::SURFACE_FORMAT;
|
|
|
|
|
using AUXILIARY_SURFACE_MODE = typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
|
|
|
|
|
|
2020-02-25 13:32:27 +01:00
|
|
|
auto gmmHelper = rootDeviceEnvironment.getGmmHelper();
|
2018-11-22 15:16:20 +01:00
|
|
|
auto surfaceState = reinterpret_cast<RENDER_SURFACE_STATE *>(surfaceStateBuffer);
|
2020-04-27 18:55:26 +02:00
|
|
|
RENDER_SURFACE_STATE state = Family::cmdInitRenderSurfaceState;
|
2018-11-22 15:16:20 +01:00
|
|
|
auto surfaceSize = alignUp(bufferSize, 4);
|
|
|
|
|
|
|
|
|
|
SURFACE_STATE_BUFFER_LENGTH Length = {0};
|
|
|
|
|
Length.Length = static_cast<uint32_t>(surfaceSize - 1);
|
|
|
|
|
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setWidth(Length.SurfaceState.Width + 1);
|
|
|
|
|
state.setHeight(Length.SurfaceState.Height + 1);
|
|
|
|
|
state.setDepth(Length.SurfaceState.Depth + 1);
|
2018-11-22 15:16:20 +01:00
|
|
|
if (pitch) {
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setSurfacePitch(pitch);
|
2018-11-22 15:16:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The graphics allocation for Host Ptr surface will be created in makeResident call and GPU address is expected to be the same as CPU address
|
|
|
|
|
auto bufferStateAddress = (gfxAlloc != nullptr) ? gfxAlloc->getGpuAddress() : gpuVa;
|
|
|
|
|
bufferStateAddress += offset;
|
|
|
|
|
|
|
|
|
|
auto bufferStateSize = (gfxAlloc != nullptr) ? gfxAlloc->getUnderlyingBufferSize() : bufferSize;
|
|
|
|
|
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setSurfaceType(static_cast<typename RENDER_SURFACE_STATE::SURFACE_TYPE>(surfaceType));
|
2018-11-22 15:16:20 +01:00
|
|
|
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setSurfaceFormat(SURFACE_FORMAT::SURFACE_FORMAT_RAW);
|
|
|
|
|
state.setSurfaceVerticalAlignment(RENDER_SURFACE_STATE::SURFACE_VERTICAL_ALIGNMENT_VALIGN_4);
|
|
|
|
|
state.setSurfaceHorizontalAlignment(RENDER_SURFACE_STATE::SURFACE_HORIZONTAL_ALIGNMENT_HALIGN_4);
|
2018-11-22 15:16:20 +01:00
|
|
|
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setTileMode(RENDER_SURFACE_STATE::TILE_MODE_LINEAR);
|
|
|
|
|
state.setVerticalLineStride(0);
|
|
|
|
|
state.setVerticalLineStrideOffset(0);
|
2018-11-22 15:16:20 +01:00
|
|
|
if ((isAligned<MemoryConstants::cacheLineSize>(bufferStateAddress) && isAligned<MemoryConstants::cacheLineSize>(bufferStateSize)) ||
|
2019-11-14 14:34:34 +01:00
|
|
|
isReadOnly) {
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER));
|
2018-11-22 15:16:20 +01:00
|
|
|
} else {
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED));
|
2018-11-22 15:16:20 +01:00
|
|
|
}
|
|
|
|
|
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setSurfaceBaseAddress(bufferStateAddress);
|
2018-11-22 15:16:20 +01:00
|
|
|
|
2021-12-01 18:11:27 +00:00
|
|
|
bool isCompressionEnabled = gfxAlloc ? gfxAlloc->isCompressionEnabled() : false;
|
|
|
|
|
if (isCompressionEnabled && !forceNonAuxMode) {
|
2018-11-22 15:16:20 +01:00
|
|
|
// Its expected to not program pitch/qpitch/baseAddress for Aux surface in CCS scenarios
|
2021-04-13 00:36:24 +00:00
|
|
|
EncodeSurfaceState<Family>::setCoherencyType(&state, RENDER_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT);
|
2021-01-29 15:40:17 +00:00
|
|
|
EncodeSurfaceState<Family>::setBufferAuxParamsForCCS(&state);
|
2018-11-22 15:16:20 +01:00
|
|
|
} else {
|
2021-04-13 00:36:24 +00:00
|
|
|
EncodeSurfaceState<Family>::setCoherencyType(&state, RENDER_SURFACE_STATE::COHERENCY_TYPE_IA_COHERENT);
|
2020-04-27 18:55:26 +02:00
|
|
|
state.setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
2018-11-22 15:16:20 +01:00
|
|
|
}
|
2021-07-09 12:14:05 +00:00
|
|
|
setL1CachePolicy(useL1Cache, &state, rootDeviceEnvironment.getHardwareInfo());
|
2020-05-07 11:52:25 +02:00
|
|
|
|
2021-07-09 12:14:05 +00:00
|
|
|
*surfaceState = state;
|
2018-11-22 15:16:20 +01:00
|
|
|
}
|
|
|
|
|
|
2020-05-07 11:52:25 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void NEO::HwHelperHw<GfxFamily>::setL1CachePolicy(bool useL1Cache, typename GfxFamily::RENDER_SURFACE_STATE *surfaceState, const HardwareInfo *hwInfo) {}
|
|
|
|
|
|
2019-02-12 10:56:27 +01:00
|
|
|
template <typename Family>
|
|
|
|
|
bool HwHelperHw<Family>::getEnableLocalMemory(const HardwareInfo &hwInfo) const {
|
|
|
|
|
if (DebugManager.flags.EnableLocalMemory.get() != -1) {
|
|
|
|
|
return DebugManager.flags.EnableLocalMemory.get();
|
|
|
|
|
} else if (DebugManager.flags.AUBDumpForceAllToLocalMemory.get()) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return OSInterface::osEnableLocalMemory && isLocalMemoryEnabled(hwInfo);
|
|
|
|
|
}
|
2019-01-10 13:57:40 +01:00
|
|
|
|
2021-02-19 11:45:53 +00:00
|
|
|
template <typename Family>
|
2021-06-08 16:37:54 +00:00
|
|
|
bool HwHelperHw<Family>::is1MbAlignmentSupported(const HardwareInfo &hwInfo, bool isCompressionEnabled) const {
|
2021-02-19 11:45:53 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-31 10:19:52 +01:00
|
|
|
template <typename Family>
|
2021-03-01 15:05:04 +00:00
|
|
|
AuxTranslationMode HwHelperHw<Family>::getAuxTranslationMode(const HardwareInfo &hwInfo) {
|
|
|
|
|
auto mode = HwHelperHw<Family>::defaultAuxTranslationMode;
|
2019-10-31 10:19:52 +01:00
|
|
|
if (DebugManager.flags.ForceAuxTranslationMode.get() != -1) {
|
2021-03-01 15:05:04 +00:00
|
|
|
mode = static_cast<AuxTranslationMode>(DebugManager.flags.ForceAuxTranslationMode.get());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mode == AuxTranslationMode::Blit && !hwInfo.capabilityTable.blitterOperationsSupported) {
|
|
|
|
|
DEBUG_BREAK_IF(true);
|
|
|
|
|
mode = AuxTranslationMode::Builtin;
|
2019-10-31 10:19:52 +01:00
|
|
|
}
|
|
|
|
|
|
2021-03-01 15:05:04 +00:00
|
|
|
return mode;
|
2019-10-31 10:19:52 +01:00
|
|
|
}
|
|
|
|
|
|
2020-04-26 21:48:59 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation(
|
|
|
|
|
LinearStream &commandStream,
|
|
|
|
|
POST_SYNC_OPERATION operation,
|
|
|
|
|
uint64_t gpuAddress,
|
|
|
|
|
uint64_t immediateData,
|
|
|
|
|
const HardwareInfo &hwInfo,
|
|
|
|
|
PipeControlArgs &args) {
|
2021-11-08 16:50:31 +00:00
|
|
|
|
|
|
|
|
void *commandBuffer = commandStream.getSpace(
|
|
|
|
|
MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWithPostSyncOperation(hwInfo));
|
|
|
|
|
|
|
|
|
|
MemorySynchronizationCommands<GfxFamily>::setPipeControlAndProgramPostSyncOperation(
|
|
|
|
|
commandBuffer,
|
|
|
|
|
operation,
|
|
|
|
|
gpuAddress,
|
|
|
|
|
immediateData,
|
|
|
|
|
hwInfo,
|
|
|
|
|
args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void MemorySynchronizationCommands<GfxFamily>::setPipeControlAndProgramPostSyncOperation(
|
|
|
|
|
void *&commandsBuffer,
|
|
|
|
|
POST_SYNC_OPERATION operation,
|
|
|
|
|
uint64_t gpuAddress,
|
|
|
|
|
uint64_t immediateData,
|
|
|
|
|
const HardwareInfo &hwInfo,
|
|
|
|
|
PipeControlArgs &args) {
|
|
|
|
|
|
|
|
|
|
MemorySynchronizationCommands<GfxFamily>::setPipeControlWA(commandsBuffer, gpuAddress, hwInfo);
|
2019-07-11 14:35:40 +02:00
|
|
|
|
2020-09-07 16:30:58 +02:00
|
|
|
setPostSyncExtraProperties(args, hwInfo);
|
2021-11-08 16:50:31 +00:00
|
|
|
MemorySynchronizationCommands<GfxFamily>::setPipeControlWithPostSync(commandsBuffer, operation, gpuAddress, immediateData, args);
|
|
|
|
|
|
|
|
|
|
MemorySynchronizationCommands<GfxFamily>::setAdditionalSynchronization(commandsBuffer, gpuAddress, hwInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void MemorySynchronizationCommands<GfxFamily>::setPipeControlWithPostSync(void *&commandsBuffer,
|
|
|
|
|
POST_SYNC_OPERATION operation,
|
|
|
|
|
uint64_t gpuAddress,
|
|
|
|
|
uint64_t immediateData,
|
|
|
|
|
PipeControlArgs &args) {
|
|
|
|
|
PIPE_CONTROL pipeControl = GfxFamily::cmdInitPipeControl;
|
|
|
|
|
setPipeControl(pipeControl, args);
|
|
|
|
|
pipeControl.setPostSyncOperation(operation);
|
|
|
|
|
pipeControl.setAddress(static_cast<uint32_t>(gpuAddress & 0x0000FFFFFFFFULL));
|
|
|
|
|
pipeControl.setAddressHigh(static_cast<uint32_t>(gpuAddress >> 32));
|
|
|
|
|
if (operation == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
|
|
|
|
|
pipeControl.setImmediateData(immediateData);
|
|
|
|
|
}
|
2020-09-07 16:30:58 +02:00
|
|
|
|
2021-11-08 16:50:31 +00:00
|
|
|
*reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = pipeControl;
|
|
|
|
|
commandsBuffer = ptrOffset(commandsBuffer, sizeof(PIPE_CONTROL));
|
2020-09-07 16:30:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWithPostSync(
|
|
|
|
|
LinearStream &commandStream,
|
|
|
|
|
POST_SYNC_OPERATION operation,
|
|
|
|
|
uint64_t gpuAddress,
|
|
|
|
|
uint64_t immediateData,
|
|
|
|
|
PipeControlArgs &args) {
|
2021-11-08 16:50:31 +00:00
|
|
|
void *pipeControl = commandStream.getSpace(sizeof(PIPE_CONTROL));
|
|
|
|
|
setPipeControlWithPostSync(pipeControl, operation, gpuAddress, immediateData, args);
|
|
|
|
|
}
|
2020-09-07 16:30:58 +02:00
|
|
|
|
2021-11-08 16:50:31 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
|
|
|
|
size_t requiredSize = MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWA(hwInfo);
|
2021-11-10 15:17:52 +00:00
|
|
|
void *commandBuffer = commandStream.getSpace(requiredSize);
|
|
|
|
|
setPipeControlWA(commandBuffer, gpuAddress, hwInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void MemorySynchronizationCommands<GfxFamily>::setPipeControlWA(void *&commandsBuffer, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
|
|
|
|
if (MemorySynchronizationCommands<GfxFamily>::isPipeControlWArequired(hwInfo)) {
|
|
|
|
|
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
|
|
|
|
|
MemorySynchronizationCommands<GfxFamily>::setPipeControlWAFlags(cmd);
|
|
|
|
|
*reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = cmd;
|
|
|
|
|
commandsBuffer = ptrOffset(commandsBuffer, sizeof(PIPE_CONTROL));
|
|
|
|
|
|
|
|
|
|
MemorySynchronizationCommands<GfxFamily>::setAdditionalSynchronization(commandsBuffer, gpuAddress, hwInfo);
|
2019-03-20 17:08:05 +01:00
|
|
|
}
|
2021-11-08 16:50:31 +00:00
|
|
|
}
|
2019-03-20 17:08:05 +01:00
|
|
|
|
2021-11-08 16:50:31 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void MemorySynchronizationCommands<GfxFamily>::addAdditionalSynchronization(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
2021-11-10 15:17:52 +00:00
|
|
|
size_t requiredSize = MemorySynchronizationCommands<GfxFamily>::getSizeForSingleAdditionalSynchronization(hwInfo);
|
|
|
|
|
void *commandBuffer = commandStream.getSpace(requiredSize);
|
|
|
|
|
setAdditionalSynchronization(commandBuffer, gpuAddress, hwInfo);
|
2020-01-31 08:16:58 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-28 14:15:51 +01:00
|
|
|
template <typename GfxFamily>
|
2020-04-26 21:48:59 +02:00
|
|
|
void MemorySynchronizationCommands<GfxFamily>::setPipeControl(typename GfxFamily::PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
|
2020-04-08 18:33:03 +02:00
|
|
|
pipeControl.setCommandStreamerStallEnable(true);
|
2020-04-26 21:48:59 +02:00
|
|
|
pipeControl.setConstantCacheInvalidationEnable(args.constantCacheInvalidationEnable);
|
|
|
|
|
pipeControl.setInstructionCacheInvalidateEnable(args.instructionCacheInvalidateEnable);
|
|
|
|
|
pipeControl.setPipeControlFlushEnable(args.pipeControlFlushEnable);
|
|
|
|
|
pipeControl.setRenderTargetCacheFlushEnable(args.renderTargetCacheFlushEnable);
|
|
|
|
|
pipeControl.setStateCacheInvalidationEnable(args.stateCacheInvalidationEnable);
|
|
|
|
|
pipeControl.setTextureCacheInvalidationEnable(args.textureCacheInvalidationEnable);
|
|
|
|
|
pipeControl.setVfCacheInvalidationEnable(args.vfCacheInvalidationEnable);
|
|
|
|
|
pipeControl.setGenericMediaStateClear(args.genericMediaStateClear);
|
2021-03-22 15:16:16 +00:00
|
|
|
pipeControl.setTlbInvalidate(args.tlbInvalidation);
|
2021-06-17 11:55:28 +00:00
|
|
|
pipeControl.setNotifyEnable(args.notifyEnable);
|
2020-04-26 21:48:59 +02:00
|
|
|
|
2021-03-31 13:46:34 +00:00
|
|
|
if (isDcFlushAllowed()) {
|
|
|
|
|
pipeControl.setDcFlushEnable(args.dcFlushEnable);
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-26 21:48:59 +02:00
|
|
|
setPipeControlExtraProperties(pipeControl, args);
|
2019-03-28 14:15:51 +01:00
|
|
|
|
|
|
|
|
if (DebugManager.flags.FlushAllCaches.get()) {
|
2020-04-08 18:33:03 +02:00
|
|
|
pipeControl.setDcFlushEnable(true);
|
|
|
|
|
pipeControl.setRenderTargetCacheFlushEnable(true);
|
|
|
|
|
pipeControl.setInstructionCacheInvalidateEnable(true);
|
|
|
|
|
pipeControl.setTextureCacheInvalidationEnable(true);
|
|
|
|
|
pipeControl.setPipeControlFlushEnable(true);
|
|
|
|
|
pipeControl.setVfCacheInvalidationEnable(true);
|
|
|
|
|
pipeControl.setConstantCacheInvalidationEnable(true);
|
|
|
|
|
pipeControl.setStateCacheInvalidationEnable(true);
|
2020-11-24 10:46:57 +00:00
|
|
|
pipeControl.setTlbInvalidate(true);
|
2019-03-28 14:15:51 +01:00
|
|
|
}
|
2020-09-30 15:06:42 +02:00
|
|
|
if (DebugManager.flags.DoNotFlushCaches.get()) {
|
|
|
|
|
pipeControl.setDcFlushEnable(false);
|
|
|
|
|
pipeControl.setRenderTargetCacheFlushEnable(false);
|
|
|
|
|
pipeControl.setInstructionCacheInvalidateEnable(false);
|
|
|
|
|
pipeControl.setTextureCacheInvalidationEnable(false);
|
|
|
|
|
pipeControl.setPipeControlFlushEnable(false);
|
|
|
|
|
pipeControl.setVfCacheInvalidationEnable(false);
|
|
|
|
|
pipeControl.setConstantCacheInvalidationEnable(false);
|
|
|
|
|
pipeControl.setStateCacheInvalidationEnable(false);
|
|
|
|
|
}
|
2019-03-28 14:15:51 +01:00
|
|
|
}
|
|
|
|
|
|
2021-03-31 13:46:34 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool MemorySynchronizationCommands<GfxFamily>::isDcFlushAllowed() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-28 14:15:51 +01:00
|
|
|
template <typename GfxFamily>
|
2020-04-26 21:48:59 +02:00
|
|
|
void MemorySynchronizationCommands<GfxFamily>::addPipeControl(LinearStream &commandStream, PipeControlArgs &args) {
|
2020-04-08 18:33:03 +02:00
|
|
|
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
|
|
|
|
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
|
2020-04-26 21:48:59 +02:00
|
|
|
MemorySynchronizationCommands<GfxFamily>::setPipeControl(cmd, args);
|
2020-04-08 18:33:03 +02:00
|
|
|
auto pipeControl = commandStream.getSpaceForCmd<PIPE_CONTROL>();
|
|
|
|
|
*pipeControl = cmd;
|
2019-07-11 14:35:40 +02:00
|
|
|
}
|
|
|
|
|
|
2020-07-06 09:34:15 +02:00
|
|
|
template <typename GfxFamily>
|
2021-03-31 16:41:29 +00:00
|
|
|
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWithCSStallOnly(LinearStream &commandStream) {
|
2020-07-06 09:34:15 +02:00
|
|
|
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
|
|
|
|
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
|
|
|
|
|
cmd.setCommandStreamerStallEnable(true);
|
|
|
|
|
auto pipeControl = commandStream.getSpaceForCmd<PIPE_CONTROL>();
|
|
|
|
|
*pipeControl = cmd;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-11 14:35:40 +02:00
|
|
|
template <typename GfxFamily>
|
2020-02-17 12:45:24 +01:00
|
|
|
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForSinglePipeControl() {
|
2019-07-11 14:35:40 +02:00
|
|
|
return sizeof(typename GfxFamily::PIPE_CONTROL);
|
2019-03-28 14:15:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-02-17 12:45:24 +01:00
|
|
|
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWithPostSyncOperation(const HardwareInfo &hwInfo) {
|
2021-11-08 16:50:31 +00:00
|
|
|
size_t size = getSizeForSinglePipeControl() +
|
|
|
|
|
getSizeForPipeControlWA(hwInfo) +
|
|
|
|
|
getSizeForSingleAdditionalSynchronization(hwInfo);
|
|
|
|
|
return size;
|
2019-03-28 14:15:51 +01:00
|
|
|
}
|
|
|
|
|
|
2020-03-11 11:27:19 +01:00
|
|
|
template <typename GfxFamily>
|
2021-11-08 16:50:31 +00:00
|
|
|
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForPipeControlWA(const HardwareInfo &hwInfo) {
|
|
|
|
|
size_t size = 0;
|
|
|
|
|
if (MemorySynchronizationCommands<GfxFamily>::isPipeControlWArequired(hwInfo)) {
|
|
|
|
|
size = getSizeForSinglePipeControl() +
|
|
|
|
|
getSizeForSingleAdditionalSynchronization(hwInfo);
|
|
|
|
|
}
|
|
|
|
|
return size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void MemorySynchronizationCommands<GfxFamily>::setAdditionalSynchronization(void *&commandsBuffer, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
2020-03-11 11:27:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2021-11-08 16:50:31 +00:00
|
|
|
inline size_t MemorySynchronizationCommands<GfxFamily>::getSizeForSingleAdditionalSynchronization(const HardwareInfo &hwInfo) {
|
2020-03-11 11:27:19 +01:00
|
|
|
return 0u;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
inline size_t MemorySynchronizationCommands<GfxFamily>::getSizeForAdditonalSynchronization(const HardwareInfo &hwInfo) {
|
|
|
|
|
return 0u;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-20 11:19:27 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
uint32_t HwHelperHw<GfxFamily>::getMetricsLibraryGenId() const {
|
|
|
|
|
return static_cast<uint32_t>(MetricsLibraryApi::ClientGen::Gen9);
|
|
|
|
|
}
|
2019-09-05 08:24:22 +02:00
|
|
|
|
2019-09-06 10:25:14 +02:00
|
|
|
template <typename GfxFamily>
|
2019-11-14 14:34:34 +01:00
|
|
|
bool HwHelperHw<GfxFamily>::tilingAllowed(bool isSharedContext, bool isImage1d, bool forceLinearStorage) {
|
2019-09-06 10:25:14 +02:00
|
|
|
if (DebugManager.flags.ForceLinearImages.get() || forceLinearStorage || isSharedContext) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2019-11-14 14:34:34 +01:00
|
|
|
return !isImage1d;
|
2019-09-06 10:25:14 +02:00
|
|
|
}
|
2019-11-07 18:49:46 +01:00
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
uint32_t HwHelperHw<GfxFamily>::alignSlmSize(uint32_t slmSize) {
|
2020-06-08 21:49:11 +02:00
|
|
|
if (slmSize == 0u) {
|
|
|
|
|
return 0u;
|
|
|
|
|
}
|
|
|
|
|
slmSize = std::max(slmSize, 1024u);
|
|
|
|
|
slmSize = Math::nextPowerOfTwo(slmSize);
|
|
|
|
|
UNRECOVERABLE_IF(slmSize > 64u * KB);
|
|
|
|
|
return slmSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-12-04 11:57:11 +00:00
|
|
|
uint32_t HwHelperHw<GfxFamily>::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) {
|
2020-06-08 21:49:11 +02:00
|
|
|
auto value = std::max(slmSize, 1024u);
|
|
|
|
|
value = Math::nextPowerOfTwo(value);
|
|
|
|
|
value = Math::getMinLsbSet(value);
|
|
|
|
|
value = value - 9;
|
|
|
|
|
DEBUG_BREAK_IF(value > 7);
|
|
|
|
|
return value * !!slmSize;
|
2019-11-07 18:49:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
uint32_t HwHelperHw<GfxFamily>::getBarriersCountFromHasBarriers(uint32_t hasBarriers) {
|
|
|
|
|
return hasBarriers;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 16:31:09 +01:00
|
|
|
template <typename GfxFamily>
|
2020-03-19 15:15:51 +01:00
|
|
|
inline bool HwHelperHw<GfxFamily>::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-29 13:07:41 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isWorkaroundRequired(uint32_t lowestSteppingWithBug, uint32_t steppingWithFix, const HardwareInfo &hwInfo) const {
|
2021-08-20 15:41:43 +00:00
|
|
|
const auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
2021-08-26 14:57:05 +00:00
|
|
|
auto lowestHwRevIdWithBug = hwInfoConfig->getHwRevIdFromStepping(lowestSteppingWithBug, hwInfo);
|
|
|
|
|
auto hwRevIdWithFix = hwInfoConfig->getHwRevIdFromStepping(steppingWithFix, hwInfo);
|
2020-07-17 17:04:52 +02:00
|
|
|
if ((lowestHwRevIdWithBug == CommonConstants::invalidStepping) || (hwRevIdWithFix == CommonConstants::invalidStepping)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return (lowestHwRevIdWithBug <= hwInfo.platform.usRevId && hwInfo.platform.usRevId < hwRevIdWithFix);
|
2020-06-29 13:07:41 +02:00
|
|
|
}
|
|
|
|
|
|
2019-12-13 16:31:09 +01:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isForceDefaultRCSEngineWARequired(const HardwareInfo &hwInfo) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-09 12:27:32 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isWaDisableRccRhwoOptimizationRequired() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-27 18:02:27 +01:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
inline uint32_t HwHelperHw<GfxFamily>::getMinimalSIMDSize() {
|
|
|
|
|
return 8u;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-07 13:51:31 +02:00
|
|
|
template <typename GfxFamily>
|
2020-05-12 15:14:10 +02:00
|
|
|
inline bool HwHelperHw<GfxFamily>::isSpecialWorkgroupSizeRequired(const HardwareInfo &hwInfo, bool isSimulation) const {
|
2020-05-07 13:51:31 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-10 17:04:42 +02:00
|
|
|
template <typename GfxFamily>
|
2020-10-09 11:52:00 +02:00
|
|
|
inline bool HwHelperHw<GfxFamily>::isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const {
|
|
|
|
|
return allocation.isAllocatedInLocalMemoryPool() &&
|
2021-09-09 12:27:41 +00:00
|
|
|
(HwInfoConfig::get(hwInfo.platform.eProductFamily)->getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed ||
|
|
|
|
|
!allocation.isAllocationLockable());
|
2020-07-10 17:04:42 +02:00
|
|
|
}
|
|
|
|
|
|
2021-05-14 10:20:32 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
std::unique_ptr<TagAllocatorBase> HwHelperHw<GfxFamily>::createTimestampPacketAllocator(const std::vector<uint32_t> &rootDeviceIndices, MemoryManager *memoryManager,
|
|
|
|
|
size_t initialTagCount, CommandStreamReceiverType csrType, DeviceBitfield deviceBitfield) const {
|
|
|
|
|
bool doNotReleaseNodes = (csrType > CommandStreamReceiverType::CSR_HW) ||
|
|
|
|
|
DebugManager.flags.DisableTimestampPacketOptimizations.get();
|
|
|
|
|
|
|
|
|
|
auto tagAlignment = getTimestampPacketAllocatorAlignment();
|
|
|
|
|
|
|
|
|
|
if (DebugManager.flags.OverrideTimestampPacketSize.get() != -1) {
|
|
|
|
|
if (DebugManager.flags.OverrideTimestampPacketSize.get() == 4) {
|
|
|
|
|
using TimestampPackets32T = TimestampPackets<uint32_t>;
|
|
|
|
|
return std::make_unique<TagAllocator<TimestampPackets32T>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPackets32T), doNotReleaseNodes, deviceBitfield);
|
|
|
|
|
} else if (DebugManager.flags.OverrideTimestampPacketSize.get() == 8) {
|
|
|
|
|
using TimestampPackets64T = TimestampPackets<uint64_t>;
|
|
|
|
|
return std::make_unique<TagAllocator<TimestampPackets64T>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPackets64T), doNotReleaseNodes, deviceBitfield);
|
|
|
|
|
} else {
|
|
|
|
|
UNRECOVERABLE_IF(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
using TimestampPacketType = typename GfxFamily::TimestampPacketType;
|
|
|
|
|
using TimestampPacketsT = TimestampPackets<TimestampPacketType>;
|
|
|
|
|
|
|
|
|
|
return std::make_unique<TagAllocator<TimestampPacketsT>>(rootDeviceIndices, memoryManager, initialTagCount, tagAlignment, sizeof(TimestampPacketsT), doNotReleaseNodes, deviceBitfield);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
size_t HwHelperHw<GfxFamily>::getTimestampPacketAllocatorAlignment() const {
|
|
|
|
|
return MemoryConstants::cacheLineSize * 4;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-18 16:28:14 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
size_t HwHelperHw<GfxFamily>::getSingleTimestampPacketSize() const {
|
2021-11-30 14:41:26 +00:00
|
|
|
return HwHelperHw<GfxFamily>::getSingleTimestampPacketSizeHw();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
size_t HwHelperHw<GfxFamily>::getSingleTimestampPacketSizeHw() {
|
2021-05-18 16:28:14 +00:00
|
|
|
if (DebugManager.flags.OverrideTimestampPacketSize.get() != -1) {
|
|
|
|
|
if (DebugManager.flags.OverrideTimestampPacketSize.get() == 4) {
|
|
|
|
|
return TimestampPackets<uint32_t>::getSinglePacketSize();
|
|
|
|
|
} else if (DebugManager.flags.OverrideTimestampPacketSize.get() == 8) {
|
|
|
|
|
return TimestampPackets<uint64_t>::getSinglePacketSize();
|
|
|
|
|
} else {
|
|
|
|
|
UNRECOVERABLE_IF(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TimestampPackets<typename GfxFamily::TimestampPacketType>::getSinglePacketSize();
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-13 13:14:28 +01:00
|
|
|
template <typename GfxFamily>
|
2020-02-17 12:45:24 +01:00
|
|
|
size_t MemorySynchronizationCommands<GfxFamily>::getSizeForFullCacheFlush() {
|
2020-02-10 11:02:21 +01:00
|
|
|
return sizeof(typename GfxFamily::PIPE_CONTROL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-04-26 21:48:59 +02:00
|
|
|
void MemorySynchronizationCommands<GfxFamily>::addFullCacheFlush(LinearStream &commandStream) {
|
2020-04-08 18:33:03 +02:00
|
|
|
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
|
|
|
|
|
|
|
|
|
PIPE_CONTROL *pipeControl = commandStream.getSpaceForCmd<PIPE_CONTROL>();
|
|
|
|
|
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
|
2020-02-10 11:02:21 +01:00
|
|
|
|
2020-04-26 21:48:59 +02:00
|
|
|
PipeControlArgs args(true);
|
|
|
|
|
args.renderTargetCacheFlushEnable = true;
|
|
|
|
|
args.instructionCacheInvalidateEnable = true;
|
|
|
|
|
args.textureCacheInvalidationEnable = true;
|
|
|
|
|
args.pipeControlFlushEnable = true;
|
|
|
|
|
args.constantCacheInvalidationEnable = true;
|
|
|
|
|
args.stateCacheInvalidationEnable = true;
|
2021-03-22 15:16:16 +00:00
|
|
|
args.tlbInvalidation = true;
|
2020-09-30 15:06:42 +02:00
|
|
|
MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperties(args);
|
2020-04-26 21:48:59 +02:00
|
|
|
MemorySynchronizationCommands<GfxFamily>::setPipeControl(cmd, args);
|
2020-04-08 18:33:03 +02:00
|
|
|
*pipeControl = cmd;
|
2020-02-10 11:02:21 +01:00
|
|
|
}
|
|
|
|
|
|
2020-02-20 09:20:33 +01:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
const StackVec<size_t, 3> HwHelperHw<GfxFamily>::getDeviceSubGroupSizes() const {
|
|
|
|
|
return {8, 16, 32};
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-19 15:50:16 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
const StackVec<uint32_t, 6> HwHelperHw<GfxFamily>::getThreadsPerEUConfigs() const {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-02 13:38:02 +02:00
|
|
|
template <typename GfxFamily>
|
2020-07-01 11:12:48 +02:00
|
|
|
void HwHelperHw<GfxFamily>::setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const HardwareInfo &hwInfo) const {}
|
2020-06-02 13:38:02 +02:00
|
|
|
|
2020-07-21 17:24:26 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isBankOverrideRequired(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-03 20:39:06 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
uint32_t HwHelperHw<GfxFamily>::getDefaultThreadArbitrationPolicy() const {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-03 09:06:11 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::useOnlyGlobalTimestamps() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2020-09-21 18:08:07 +02:00
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::useSystemMemoryPlacementForISA(const HardwareInfo &hwInfo) const {
|
2020-10-14 15:40:57 +02:00
|
|
|
return !getEnableLocalMemory(hwInfo);
|
2020-09-21 18:08:07 +02:00
|
|
|
}
|
2020-09-23 17:01:19 +02:00
|
|
|
|
2021-02-01 14:27:48 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-05 18:32:55 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool MemorySynchronizationCommands<GfxFamily>::isPipeControlPriorToPipelineSelectWArequired(const HardwareInfo &hwInfo) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-06 16:21:46 +02:00
|
|
|
template <typename GfxFamily>
|
2021-08-23 17:42:53 +00:00
|
|
|
bool HwHelperHw<GfxFamily>::isRcsAvailable(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isCooperativeDispatchSupported(const EngineGroupType engineGroupType, const HardwareInfo &hwInfo) const {
|
2020-10-06 16:21:46 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-23 18:02:53 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
uint32_t HwHelperHw<GfxFamily>::adjustMaxWorkGroupCount(uint32_t maxWorkGroupCount, const EngineGroupType engineGroupType,
|
|
|
|
|
const HardwareInfo &hwInfo, bool isEngineInstanced) const {
|
|
|
|
|
return maxWorkGroupCount;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-03 14:53:13 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isKmdMigrationSupported(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-16 18:24:13 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isCooperativeEngineSupported(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-05 12:04:36 +01:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isCopyOnlyEngineType(EngineGroupType type) const {
|
|
|
|
|
return NEO::EngineGroupType::Copy == type;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-10 19:05:25 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isSipWANeeded(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-05 14:16:42 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-09 19:28:51 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
uint32_t HwHelperHw<GfxFamily>::getDefaultRevisionId(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return 0u;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-11 20:31:28 +00:00
|
|
|
template <typename GfxFamily>
|
2021-06-30 08:56:08 +00:00
|
|
|
uint32_t HwHelperHw<GfxFamily>::getNumCacheRegions() const {
|
2021-02-11 20:31:28 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-03 14:26:16 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isSubDeviceEngineSupported(const HardwareInfo &hwInfo, const DeviceBitfield &deviceBitfield, aub_stream::EngineType engineType) const {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-30 15:39:01 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
size_t HwHelperHw<GfxFamily>::getPreemptionAllocationAlignment() const {
|
|
|
|
|
return 256 * MemoryConstants::kiloByte;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-10 16:03:59 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void HwHelperHw<GfxFamily>::applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const {}
|
|
|
|
|
|
2021-06-08 16:37:54 +00:00
|
|
|
template <typename GfxFamily>
|
2021-12-03 13:52:16 +00:00
|
|
|
void HwHelperHw<GfxFamily>::applyRenderCompressionFlag(Gmm &gmm, uint32_t isCompressed) const {
|
|
|
|
|
gmm.resourceParams.Flags.Info.RenderCompressed = isCompressed;
|
2021-06-08 16:37:54 +00:00
|
|
|
}
|
|
|
|
|
|
2021-08-31 13:25:49 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isEngineTypeRemappingToHwSpecificRequired() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-29 23:41:42 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isSipKernelAsHexadecimalArrayPreferred() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void HwHelperHw<GfxFamily>::setSipKernelData(uint32_t *&sipKernelBinary, size_t &kernelBinarySize) const {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void HwHelperHw<GfxFamily>::adjustPreemptionSurfaceSize(size_t &csrSize) const {
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-21 14:30:54 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void HwHelperHw<GfxFamily>::encodeBufferSurfaceState(EncodeSurfaceStateArgs &args) {
|
|
|
|
|
EncodeSurfaceState<GfxFamily>::encodeBuffer(args);
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|