mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Add debug flags for blitter
Change-Id: I57e47cfa3dde10f441cd7400ad6463367450a899
This commit is contained in:

committed by
sys_ocldev

parent
97c5a68e8e
commit
656468e42b
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -1,5 +1,5 @@
|
||||
#!groovy
|
||||
dependenciesRevision='4659ec97f5caf1aa49d25d3389dac0fe63091c19-1408'
|
||||
strategy='EQUAL'
|
||||
allowedCD=247
|
||||
allowedCD=253
|
||||
allowedF=20
|
||||
|
@ -155,3 +155,6 @@ ForcePerDssBackedBufferProgramming = 0
|
||||
DisableAtomicForPostSyncs = 0
|
||||
MaxHwThreadsPercent = 0
|
||||
MinHwThreadsUnoccupied = 0
|
||||
LimitBlitterMaxWidth = -1
|
||||
LimitBlitterMaxHeight = -1
|
||||
FlushAfterEachBlit = -1
|
||||
|
@ -60,6 +60,9 @@ DECLARE_DEBUG_VARIABLE(bool, OverrideInvalidEngineWithDefault, false, "When set
|
||||
DECLARE_DEBUG_VARIABLE(bool, DisableAuxTranslation, false, "Disable aux translation when required by Kernel.")
|
||||
DECLARE_DEBUG_VARIABLE(bool, DisableTimestampPacketOptimizations, false, "Allocate new allocation per node + dont reuse old nodes")
|
||||
DECLARE_DEBUG_VARIABLE(bool, DisableCachingForStatefulBufferAccess, false, "Disable caching for stateful buffer access")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, LimitBlitterMaxWidth, -1, "-1: default, >=0: Max width")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, LimitBlitterMaxHeight, -1, "-1: default, >=0: Max height")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, FlushAfterEachBlit, -1, "-1: default, 0: disable, 1: enable")
|
||||
|
||||
/*LOGGING FLAGS*/
|
||||
DECLARE_DEBUG_VARIABLE(bool, PrintDebugSettings, false, "Dump all debug variables settings to text file. Print to stdout if value is different than default.")
|
||||
|
@ -75,6 +75,10 @@ struct BlitProperties {
|
||||
template <typename GfxFamily>
|
||||
struct BlitCommandsHelper {
|
||||
using COLOR_DEPTH = typename GfxFamily::XY_COLOR_BLT::COLOR_DEPTH;
|
||||
static uint64_t getMaxBlitWidth();
|
||||
static uint64_t getMaxBlitHeight();
|
||||
static void dispatchPostBlitCommand(LinearStream &linearStream);
|
||||
static size_t estimatePostBlitCommandSize();
|
||||
static size_t estimateBlitCommandsSize(Vec3<size_t> copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket);
|
||||
static size_t estimateBlitCommandsSize(const BlitPropertiesContainer &blitPropertiesContainer, const HardwareInfo &hwInfo);
|
||||
static uint64_t calculateBlitCommandDestinationBaseAddress(const BlitProperties &blitProperties, uint64_t offset, uint64_t row, uint64_t slice);
|
||||
|
@ -12,6 +12,50 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint64_t BlitCommandsHelper<GfxFamily>::getMaxBlitWidth() {
|
||||
if (DebugManager.flags.LimitBlitterMaxWidth.get() != -1) {
|
||||
return static_cast<uint64_t>(DebugManager.flags.LimitBlitterMaxWidth.get());
|
||||
}
|
||||
return BlitterConstants::maxBlitWidth;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint64_t BlitCommandsHelper<GfxFamily>::getMaxBlitHeight() {
|
||||
if (DebugManager.flags.LimitBlitterMaxHeight.get() != -1) {
|
||||
return static_cast<uint64_t>(DebugManager.flags.LimitBlitterMaxHeight.get());
|
||||
}
|
||||
return BlitterConstants::maxBlitHeight;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void BlitCommandsHelper<GfxFamily>::dispatchPostBlitCommand(LinearStream &linearStream) {
|
||||
bool useFlush = false;
|
||||
if (DebugManager.flags.FlushAfterEachBlit.get() != -1) {
|
||||
useFlush = static_cast<bool>(DebugManager.flags.FlushAfterEachBlit.get());
|
||||
}
|
||||
|
||||
if (useFlush) {
|
||||
EncodeMiFlushDW<GfxFamily>::programMiFlushDw(linearStream, 0, 0, false, false);
|
||||
} else {
|
||||
auto miArbCheckStream = linearStream.getSpaceForCmd<typename GfxFamily::MI_ARB_CHECK>();
|
||||
*miArbCheckStream = GfxFamily::cmdInitArbCheck;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize() {
|
||||
bool useFlush = false;
|
||||
if (DebugManager.flags.FlushAfterEachBlit.get() != -1) {
|
||||
useFlush = static_cast<bool>(DebugManager.flags.FlushAfterEachBlit.get());
|
||||
}
|
||||
|
||||
if (useFlush) {
|
||||
return sizeof(typename GfxFamily::MI_FLUSH_DW);
|
||||
}
|
||||
return sizeof(typename GfxFamily::MI_ARB_CHECK);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
size_t BlitCommandsHelper<GfxFamily>::estimateBlitCommandsSize(Vec3<size_t> copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket) {
|
||||
size_t numberOfBlits = 0;
|
||||
@ -22,10 +66,10 @@ size_t BlitCommandsHelper<GfxFamily>::estimateBlitCommandsSize(Vec3<size_t> copy
|
||||
for (uint64_t row = 0; row < copySize.y; row++) {
|
||||
uint64_t sizeToBlit = copySize.x;
|
||||
while (sizeToBlit != 0) {
|
||||
if (sizeToBlit > BlitterConstants::maxBlitWidth) {
|
||||
if (sizeToBlit > getMaxBlitWidth()) {
|
||||
// dispatch 2D blit: maxBlitWidth x (1 .. maxBlitHeight)
|
||||
width = BlitterConstants::maxBlitWidth;
|
||||
height = std::min((sizeToBlit / width), BlitterConstants::maxBlitHeight);
|
||||
width = getMaxBlitWidth();
|
||||
height = std::min((sizeToBlit / width), getMaxBlitHeight());
|
||||
|
||||
} else {
|
||||
// dispatch 1D blt: (1 .. maxBlitWidth) x 1
|
||||
@ -38,7 +82,7 @@ size_t BlitCommandsHelper<GfxFamily>::estimateBlitCommandsSize(Vec3<size_t> copy
|
||||
}
|
||||
}
|
||||
|
||||
constexpr size_t cmdsSizePerBlit = (sizeof(typename GfxFamily::XY_COPY_BLT) + sizeof(typename GfxFamily::MI_ARB_CHECK));
|
||||
const size_t cmdsSizePerBlit = (sizeof(typename GfxFamily::XY_COPY_BLT) + estimatePostBlitCommandSize());
|
||||
|
||||
return TimestampPacketHelper::getRequiredCmdStreamSize<GfxFamily>(csrDependencies) +
|
||||
(cmdsSizePerBlit * numberOfBlits) +
|
||||
@ -86,10 +130,10 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBuffer(const BlitProp
|
||||
uint64_t offset = 0;
|
||||
uint64_t sizeToBlit = blitProperties.copySize.x;
|
||||
while (sizeToBlit != 0) {
|
||||
if (sizeToBlit > BlitterConstants::maxBlitWidth) {
|
||||
if (sizeToBlit > getMaxBlitWidth()) {
|
||||
// dispatch 2D blit: maxBlitWidth x (1 .. maxBlitHeight)
|
||||
width = BlitterConstants::maxBlitWidth;
|
||||
height = std::min((sizeToBlit / width), BlitterConstants::maxBlitHeight);
|
||||
width = getMaxBlitWidth();
|
||||
height = std::min((sizeToBlit / width), getMaxBlitHeight());
|
||||
} else {
|
||||
// dispatch 1D blt: (1 .. maxBlitWidth) x 1
|
||||
width = sizeToBlit;
|
||||
@ -116,10 +160,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBuffer(const BlitProp
|
||||
*bltStream = bltCmd;
|
||||
}
|
||||
|
||||
{
|
||||
auto miArbCheckStream = linearStream.getSpaceForCmd<typename GfxFamily::MI_ARB_CHECK>();
|
||||
*miArbCheckStream = GfxFamily::cmdInitArbCheck;
|
||||
}
|
||||
dispatchPostBlitCommand(linearStream);
|
||||
|
||||
auto blitSize = width * height;
|
||||
sizeToBlit -= blitSize;
|
||||
@ -146,12 +187,12 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocati
|
||||
tmpCmd.setDestinationBaseAddress(ptrOffset(dstAlloc->getGpuAddress(), static_cast<size_t>(offset)));
|
||||
uint64_t height = 0;
|
||||
uint64_t width = 0;
|
||||
if (sizeToFill <= BlitterConstants::maxBlitWidth) {
|
||||
if (sizeToFill <= getMaxBlitWidth()) {
|
||||
width = sizeToFill;
|
||||
height = 1;
|
||||
} else {
|
||||
width = BlitterConstants::maxBlitWidth;
|
||||
height = std::min((sizeToFill / width), BlitterConstants::maxBlitHeight);
|
||||
width = getMaxBlitWidth();
|
||||
height = std::min((sizeToFill / width), getMaxBlitHeight());
|
||||
if (height > 1) {
|
||||
appendTilingEnable(tmpCmd);
|
||||
}
|
||||
|
Reference in New Issue
Block a user