wa: enable wa to add additional dummy blits after blit copy

- reduce number of dummy blits where are not needed
- track if dummy blit required in cmdlist

Related-To: NEO-7450
Signed-off-by: Cencelewska, Katarzyna <katarzyna.cencelewska@intel.com>
This commit is contained in:
Cencelewska, Katarzyna
2023-03-10 19:21:59 +00:00
committed by Compute-Runtime-Automation
parent 2a60522e6e
commit a4a296d59f
28 changed files with 266 additions and 212 deletions

View File

@@ -33,7 +33,7 @@ struct BlitCommandsHelper {
static uint64_t getMaxBlitHeightOverride(const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed);
static void dispatchPreBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment);
static size_t estimatePreBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment);
static void dispatchPostBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment);
static void dispatchPostBlitCommand(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static size_t estimatePostBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment);
static size_t estimateBlitCommandSize(const Vec3<size_t> &copySize, const CsrDependencies &csrDependencies, bool updateTimestampPacket,
bool profilingEnabled, bool isImage, const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed, bool relaxedOrderingEnabled);
@@ -45,13 +45,13 @@ struct BlitCommandsHelper {
static uint64_t calculateBlitCommandSourceBaseAddress(const BlitProperties &blitProperties, uint64_t offset, uint64_t row, uint64_t slice);
static uint64_t calculateBlitCommandDestinationBaseAddressCopyRegion(const BlitProperties &blitProperties, size_t slice);
static uint64_t calculateBlitCommandSourceBaseAddressCopyRegion(const BlitProperties &blitProperties, size_t slice);
static void dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment);
static void dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment);
static void dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment);
static void dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment);
static void dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, const RootDeviceEnvironment &rootDeviceEnvironment);
static void dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static void dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static void dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static void dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static void dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs);
template <size_t patternSize>
static void dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, const RootDeviceEnvironment &rootDeviceEnvironment, COLOR_DEPTH depth);
static void dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs, COLOR_DEPTH depth);
static void dispatchDummyBlit(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs);
static size_t getDummyBlitSize(const EncodeDummyBlitWaArgs &waArgs);
static bool isDummyBlitWaNeeded(const EncodeDummyBlitWaArgs &waArgs);

View File

@@ -43,9 +43,9 @@ uint64_t BlitCommandsHelper<GfxFamily>::getMaxBlitHeight(const RootDeviceEnviron
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchPreBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) {
if (BlitCommandsHelper<GfxFamily>::preBlitCommandWARequired()) {
MiFlushArgs args;
args.waArgs.isBcs = true;
args.waArgs.rootDeviceEnvironment = const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment);
NEO::EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
MiFlushArgs args{waArgs};
EncodeMiFlushDW<GfxFamily>::programWithWa(linearStream, 0, 0, args);
}
}
@@ -53,7 +53,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchPreBlitCommand(LinearStream &linearS
template <typename GfxFamily>
size_t BlitCommandsHelper<GfxFamily>::estimatePreBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment) {
if (BlitCommandsHelper<GfxFamily>::preBlitCommandWARequired()) {
EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
return EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa(waArgs);
}
@@ -61,15 +61,12 @@ size_t BlitCommandsHelper<GfxFamily>::estimatePreBlitCommandSize(const RootDevic
}
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchPostBlitCommand(LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) {
MiFlushArgs args;
args.waArgs.isBcs = true;
args.waArgs.rootDeviceEnvironment = &rootDeviceEnvironment;
void BlitCommandsHelper<GfxFamily>::dispatchPostBlitCommand(LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
MiFlushArgs args{waArgs};
if (DebugManager.flags.PostBlitCommand.get() != BlitterConstants::PostBlitMode::Default) {
switch (DebugManager.flags.PostBlitCommand.get()) {
case BlitterConstants::PostBlitMode::MiArbCheck:
EncodeMiArbCheck<GfxFamily>::programWithWa(linearStream, std::nullopt, args.waArgs);
EncodeMiArbCheck<GfxFamily>::programWithWa(linearStream, std::nullopt, waArgs);
return;
case BlitterConstants::PostBlitMode::MiFlush:
EncodeMiFlushDW<GfxFamily>::programWithWa(linearStream, 0, 0, args);
@@ -81,14 +78,16 @@ void BlitCommandsHelper<GfxFamily>::dispatchPostBlitCommand(LinearStream &linear
if (BlitCommandsHelper<GfxFamily>::miArbCheckWaRequired()) {
EncodeMiFlushDW<GfxFamily>::programWithWa(linearStream, 0, 0, args);
args.waArgs.isWaRequired = false;
}
EncodeMiArbCheck<GfxFamily>::programWithWa(linearStream, std::nullopt, args.waArgs);
EncodeMiArbCheck<GfxFamily>::programWithWa(linearStream, std::nullopt, waArgs);
}
template <typename GfxFamily>
size_t BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(const RootDeviceEnvironment &rootDeviceEnvironment) {
EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
if (DebugManager.flags.PostBlitCommand.get() != BlitterConstants::PostBlitMode::Default) {
switch (DebugManager.flags.PostBlitCommand.get()) {
case BlitterConstants::PostBlitMode::MiArbCheck:
@@ -99,12 +98,13 @@ size_t BlitCommandsHelper<GfxFamily>::estimatePostBlitCommandSize(const RootDevi
return 0;
}
}
size_t size = 0u;
if (BlitCommandsHelper<GfxFamily>::miArbCheckWaRequired()) {
return (EncodeMiArbCheck<GfxFamily>::getCommandSizeWithWa(waArgs) + EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa(waArgs));
size += EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa(waArgs);
waArgs.isWaRequired = false;
}
return EncodeMiArbCheck<GfxFamily>::getCommandSizeWithWa(waArgs);
size += EncodeMiArbCheck<GfxFamily>::getCommandSizeWithWa(waArgs);
return size;
}
template <typename GfxFamily>
@@ -112,7 +112,7 @@ size_t BlitCommandsHelper<GfxFamily>::estimateBlitCommandSize(const Vec3<size_t>
bool isImage, const RootDeviceEnvironment &rootDeviceEnvironment, bool isSystemMemoryPoolUsed, bool relaxedOrderingEnabled) {
size_t timestampCmdSize = 0;
if (updateTimestampPacket) {
EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
timestampCmdSize += EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa(waArgs);
if (profilingEnabled) {
timestampCmdSize += getProfilingMmioCmdsSize();
@@ -144,7 +144,7 @@ size_t BlitCommandsHelper<GfxFamily>::estimateBlitCommandsSize(const BlitPropert
bool profilingEnabled, bool debugPauseEnabled, bool blitterDirectSubmission,
bool relaxedOrderingEnabled, const RootDeviceEnvironment &rootDeviceEnvironment) {
size_t size = 0;
EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
for (auto &blitProperties : blitPropertiesContainer) {
auto updateTimestampPacket = blitProperties.outputTimestampPacket != nullptr;
auto isImage = blitProperties.isImageOperation();
@@ -191,14 +191,14 @@ uint64_t BlitCommandsHelper<GfxFamily>::calculateBlitCommandSourceBaseAddress(co
}
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) {
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
uint64_t width = 1;
uint64_t height = 1;
PRINT_DEBUG_STRING(DebugManager.flags.PrintBlitDispatchDetails.get(), stdout,
"\nBlit dispatch with AuxTranslationDirection %u ", static_cast<uint32_t>(blitProperties.auxTranslationDirection));
dispatchPreBlitCommand(linearStream, rootDeviceEnvironment);
dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment);
auto bltCmd = GfxFamily::cmdInitXyCopyBlt;
appendColorDepth(blitProperties, bltCmd);
@@ -207,10 +207,10 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const Bl
uint64_t offset = 0;
uint64_t sizeToBlit = blitProperties.copySize.x;
while (sizeToBlit != 0) {
if (sizeToBlit > getMaxBlitWidth(rootDeviceEnvironment)) {
if (sizeToBlit > getMaxBlitWidth(*waArgs.rootDeviceEnvironment)) {
// dispatch 2D blit: maxBlitWidth x (1 .. maxBlitHeight)
width = getMaxBlitWidth(rootDeviceEnvironment);
height = std::min((sizeToBlit / width), getMaxBlitHeight(rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed));
width = getMaxBlitWidth(*waArgs.rootDeviceEnvironment);
height = std::min((sizeToBlit / width), getMaxBlitHeight(*waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed));
} else {
// dispatch 1D blt: (1 .. maxBlitWidth) x 1
width = sizeToBlit;
@@ -231,12 +231,13 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const Bl
bltCmd.setDestinationBaseAddress(dstAddr);
bltCmd.setSourceBaseAddress(srcAddr);
appendBlitCommandsForBuffer(blitProperties, bltCmd, rootDeviceEnvironment);
appendBlitCommandsForBuffer(blitProperties, bltCmd, *waArgs.rootDeviceEnvironment);
auto bltStream = linearStream.getSpaceForCmd<typename GfxFamily::XY_COPY_BLT>();
*bltStream = bltCmd;
dispatchPostBlitCommand(linearStream, rootDeviceEnvironment);
waArgs.isWaRequired = true;
dispatchPostBlitCommand(linearStream, waArgs);
auto blitSize = width * height;
sizeToBlit -= blitSize;
@@ -248,9 +249,10 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferPerRow(const Bl
template <typename GfxFamily>
template <size_t patternSize>
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, const RootDeviceEnvironment &rootDeviceEnvironment, COLOR_DEPTH depth) {
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs, COLOR_DEPTH depth) {
using XY_COLOR_BLT = typename GfxFamily::XY_COLOR_BLT;
auto blitCmd = GfxFamily::cmdInitXyColorBlt;
auto &rootDeviceEnvironment = *waArgs.rootDeviceEnvironment;
blitCmd.setFillColor(pattern);
blitCmd.setColorDepth(depth);
@@ -279,6 +281,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocati
auto cmd = linearStream.getSpaceForCmd<XY_COLOR_BLT>();
*cmd = tmpCmd;
waArgs.isWaRequired = true;
auto blitSize = width * height;
offset += (blitSize * patternSize);
sizeToFill -= blitSize;
@@ -286,7 +289,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill(NEO::GraphicsAllocati
}
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) {
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
auto srcSlicePitch = static_cast<uint32_t>(blitProperties.srcSlicePitch);
auto dstSlicePitch = static_cast<uint32_t>(blitProperties.dstSlicePitch);
@@ -305,14 +308,14 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(const Bli
bltCmd.setSourceX1CoordinateLeft(static_cast<uint32_t>(blitProperties.srcOffset.x));
bltCmd.setSourceY1CoordinateTop(static_cast<uint32_t>(blitProperties.srcOffset.y));
appendBlitCommandsBlockCopy(blitProperties, bltCmd, rootDeviceEnvironment);
appendBlitCommandsForImages(blitProperties, bltCmd, rootDeviceEnvironment, srcSlicePitch, dstSlicePitch);
appendBlitCommandsBlockCopy(blitProperties, bltCmd, *(waArgs.rootDeviceEnvironment));
appendBlitCommandsForImages(blitProperties, bltCmd, *(waArgs.rootDeviceEnvironment), srcSlicePitch, dstSlicePitch);
appendColorDepth(blitProperties, bltCmd);
appendSurfaceType(blitProperties, bltCmd);
dispatchPreBlitCommand(linearStream, rootDeviceEnvironment);
dispatchPreBlitCommand(linearStream, *(waArgs.rootDeviceEnvironment));
for (uint32_t i = 0; i < blitProperties.copySize.z; i++) {
appendSliceOffsets(blitProperties, bltCmd, i, rootDeviceEnvironment, srcSlicePitch, dstSlicePitch);
appendSliceOffsets(blitProperties, bltCmd, i, *(waArgs.rootDeviceEnvironment), srcSlicePitch, dstSlicePitch);
if (DebugManager.flags.PrintImageBlitBlockCopyCmdDetails.get()) {
printImageBlitBlockCopyCommand(bltCmd, i);
@@ -320,7 +323,8 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForImageRegion(const Bli
auto cmd = linearStream.getSpaceForCmd<typename GfxFamily::XY_BLOCK_COPY_BLT>();
*cmd = bltCmd;
dispatchPostBlitCommand(linearStream, rootDeviceEnvironment);
waArgs.isWaRequired = true;
dispatchPostBlitCommand(linearStream, waArgs);
}
}
@@ -330,10 +334,10 @@ void BlitCommandsHelper<GfxFamily>::dispatchDebugPauseCommands(LinearStream &com
RootDeviceEnvironment &rootDeviceEnvironment) {
using COMPARE_OPERATION = typename GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION;
MiFlushArgs args;
NEO::EncodeDummyBlitWaArgs waArgs{false, &rootDeviceEnvironment};
MiFlushArgs args{waArgs};
args.commandWithPostSync = true;
args.waArgs.isBcs = true;
args.waArgs.rootDeviceEnvironment = &rootDeviceEnvironment;
EncodeMiFlushDW<GfxFamily>::programWithWa(commandStream, debugPauseStateGPUAddress, static_cast<uint32_t>(confirmationTrigger),
args);
@@ -342,7 +346,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchDebugPauseCommands(LinearStream &com
template <typename GfxFamily>
size_t BlitCommandsHelper<GfxFamily>::getSizeForDebugPauseCommands(const RootDeviceEnvironment &rootDeviceEnvironment) {
EncodeDummyBlitWaArgs waArgs{true, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
EncodeDummyBlitWaArgs waArgs{false, const_cast<RootDeviceEnvironment *>(&rootDeviceEnvironment)};
return (EncodeMiFlushDW<GfxFamily>::getCommandSizeWithWa(waArgs) + EncodeSemaphore<GfxFamily>::getSizeMiSemaphoreWait()) * 2;
}
@@ -361,13 +365,13 @@ uint32_t BlitCommandsHelper<GfxFamily>::getAvailableBytesPerPixel(size_t copySiz
}
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) {
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommands(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
if (blitProperties.isImageOperation()) {
dispatchBlitCommandsForImageRegion(blitProperties, linearStream, rootDeviceEnvironment);
dispatchBlitCommandsForImageRegion(blitProperties, linearStream, waArgs);
} else {
bool preferCopyBufferRegion = isCopyRegionPreferred(blitProperties.copySize, rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
preferCopyBufferRegion ? dispatchBlitCommandsForBufferRegion(blitProperties, linearStream, rootDeviceEnvironment)
: dispatchBlitCommandsForBufferPerRow(blitProperties, linearStream, rootDeviceEnvironment);
bool preferCopyBufferRegion = isCopyRegionPreferred(blitProperties.copySize, *waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
preferCopyBufferRegion ? dispatchBlitCommandsForBufferRegion(blitProperties, linearStream, waArgs)
: dispatchBlitCommandsForBufferPerRow(blitProperties, linearStream, waArgs);
}
}
@@ -397,12 +401,12 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsMemCopy(const BlitProperti
}
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, RootDeviceEnvironment &rootDeviceEnvironment) {
void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferRegion(const BlitProperties &blitProperties, LinearStream &linearStream, EncodeDummyBlitWaArgs &waArgs) {
const auto maxWidthToCopy = getMaxBlitWidth(rootDeviceEnvironment);
const auto maxHeightToCopy = getMaxBlitHeight(rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
const auto maxWidthToCopy = getMaxBlitWidth(*waArgs.rootDeviceEnvironment);
const auto maxHeightToCopy = getMaxBlitHeight(*waArgs.rootDeviceEnvironment, blitProperties.isSystemMemoryPoolUsed);
dispatchPreBlitCommand(linearStream, rootDeviceEnvironment);
dispatchPreBlitCommand(linearStream, *waArgs.rootDeviceEnvironment);
auto bltCmd = GfxFamily::cmdInitXyCopyBlt;
bltCmd.setSourcePitch(static_cast<uint32_t>(blitProperties.srcRowPitch));
@@ -426,11 +430,13 @@ void BlitCommandsHelper<GfxFamily>::dispatchBlitCommandsForBufferRegion(const Bl
bltCmd.setDestinationX2CoordinateRight(width);
bltCmd.setDestinationY2CoordinateBottom(height);
appendBlitCommandsForBuffer(blitProperties, bltCmd, rootDeviceEnvironment);
appendBlitCommandsForBuffer(blitProperties, bltCmd, *waArgs.rootDeviceEnvironment);
auto cmd = linearStream.getSpaceForCmd<typename GfxFamily::XY_COPY_BLT>();
*cmd = bltCmd;
dispatchPostBlitCommand(linearStream, rootDeviceEnvironment);
waArgs.isWaRequired = true;
dispatchPostBlitCommand(linearStream, waArgs);
srcAddress += width;
dstAddress += width;

View File

@@ -39,16 +39,16 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsForFillBuffer(NEO::Graphic
}
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, const RootDeviceEnvironment &rootDeviceEnvironment) {
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs) {
switch (patternSize) {
case 1:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR);
break;
case 2:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR1555);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR1555);
break;
default:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR);
}
}

View File

@@ -149,22 +149,22 @@ void BlitCommandsHelper<GfxFamily>::appendBlitCommandsForFillBuffer(NEO::Graphic
}
template <typename GfxFamily>
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, const RootDeviceEnvironment &rootDeviceEnvironment) {
void BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryColorFill(NEO::GraphicsAllocation *dstAlloc, uint64_t offset, uint32_t *pattern, size_t patternSize, LinearStream &linearStream, size_t size, EncodeDummyBlitWaArgs &waArgs) {
switch (patternSize) {
case 1:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<1>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR);
break;
case 2:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<2>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR);
break;
case 4:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<4>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR);
break;
case 8:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<8>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR);
break;
default:
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, rootDeviceEnvironment, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR);
NEO::BlitCommandsHelper<GfxFamily>::dispatchBlitMemoryFill<16>(dstAlloc, offset, pattern, linearStream, size, waArgs, COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR);
}
}
@@ -437,7 +437,7 @@ void BlitCommandsHelper<GfxFamily>::printImageBlitBlockCopyCommand(const typenam
template <typename GfxFamily>
bool BlitCommandsHelper<GfxFamily>::isDummyBlitWaNeeded(const EncodeDummyBlitWaArgs &waArgs) {
if (waArgs.isBcs) {
if (waArgs.isWaRequired) {
UNRECOVERABLE_IF(!waArgs.rootDeviceEnvironment);
if (DebugManager.flags.ForceDummyBlitWa.get() != -1) {
return DebugManager.flags.ForceDummyBlitWa.get();
@@ -469,6 +469,7 @@ void BlitCommandsHelper<GfxFamily>::dispatchDummyBlit(LinearStream &linearStream
auto cmd = linearStream.getSpaceForCmd<XY_COLOR_BLT>();
*cmd = blitCmd;
waArgs.isWaRequired = false;
}
}

View File

@@ -11,7 +11,7 @@ namespace NEO {
struct RootDeviceEnvironment;
struct EncodeDummyBlitWaArgs {
bool isBcs = false;
bool isWaRequired = false;
RootDeviceEnvironment *rootDeviceEnvironment = nullptr;
};
@@ -21,7 +21,7 @@ struct MiFlushArgs {
bool notifyEnable = false;
bool tlbFlush = false;
EncodeDummyBlitWaArgs waArgs{};
MiFlushArgs() = default;
EncodeDummyBlitWaArgs &waArgs;
MiFlushArgs(EncodeDummyBlitWaArgs &args) : waArgs(args) {}
};
} // namespace NEO