Skip to content

Commit 5d3a914

Browse files
Revert "fix: Fix copying with blitter"
This reverts commit efcbd38. Signed-off-by: Compute-Runtime-Validation <[email protected]>
1 parent 1901409 commit 5d3a914

File tree

6 files changed

+0
-150
lines changed

6 files changed

+0
-150
lines changed

shared/source/helpers/blit_commands_helper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ struct BlitCommandsHelper {
7474
static void appendTilingEnable(typename GfxFamily::XY_COLOR_BLT &blitCmd);
7575
static void appendTilingType(const GMM_TILE_TYPE srcTilingType, const GMM_TILE_TYPE dstTilingType, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd);
7676
static void appendSliceOffsets(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, uint32_t sliceIndex, const RootDeviceEnvironment &rootDeviceEnvironment, uint32_t srcSlicePitch, uint32_t dstSlicePitch);
77-
static void appendBaseAddressOffset(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, const bool isSource);
7877
static void getBlitAllocationProperties(const GraphicsAllocation &allocation, uint32_t &pitch, uint32_t &qPitch, GMM_TILE_TYPE &tileType,
7978
uint32_t &mipTailLod, uint32_t &compressionDetails,
8079
const RootDeviceEnvironment &rootDeviceEnvironment, GMM_YUV_PLANE_ENUM plane);

shared/source/helpers/blit_commands_helper_base.inl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,6 @@ size_t BlitCommandsHelper<GfxFamily>::getProfilingMmioCmdsSize() {
559559
return 4 * sizeof(typename GfxFamily::MI_STORE_REGISTER_MEM);
560560
}
561561

562-
template <typename GfxFamily>
563-
void BlitCommandsHelper<GfxFamily>::appendBaseAddressOffset(const BlitProperties &blitProperties, typename GfxFamily::XY_BLOCK_COPY_BLT &blitCmd, const bool isSource) {}
564-
565562
template <typename GfxFamily>
566563
void BlitCommandsHelper<GfxFamily>::encodeWa(LinearStream &cmdStream, const BlitProperties &blitProperties, uint32_t &latestSentBcsWaValue) {
567564
}

shared/source/xe2_hpg_core/command_stream_receiver_hw_xe2_hpg_core.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -134,54 +134,6 @@ void BlitCommandsHelper<Family>::appendBlitCommandsBlockCopy(const BlitPropertie
134134
blitCmd.setSourceMOCS(mocs);
135135
}
136136

137-
template <>
138-
void BlitCommandsHelper<Family>::appendBaseAddressOffset(const BlitProperties &blitProperties, typename Family::XY_BLOCK_COPY_BLT &blitCmd, const bool isSource) {
139-
using XY_BLOCK_COPY_BLT = typename Family::XY_BLOCK_COPY_BLT;
140-
auto surfaceType = isSource ? blitCmd.getSourceSurfaceType() : blitCmd.getDestinationSurfaceType();
141-
if (surfaceType == XY_BLOCK_COPY_BLT::SURFACE_TYPE_SURFTYPE_2D) {
142-
// max allowed y1 offset for 2D surface is 0x3fff,
143-
// if it's bigger then we need to reduce it by adding offset to base address instead
144-
GMM_REQ_OFFSET_INFO offsetInfo = {};
145-
offsetInfo.ArrayIndex = isSource ? (blitCmd.getSourceArrayIndex() - 1) : (blitCmd.getDestinationArrayIndex() - 1);
146-
offsetInfo.ReqRender = 1;
147-
148-
if (isSource) {
149-
blitProperties.srcAllocation->getDefaultGmm()->gmmResourceInfo->getOffset(offsetInfo);
150-
blitCmd.setSourceBaseAddress(ptrOffset(blitProperties.srcGpuAddress, offsetInfo.Render.Offset));
151-
blitCmd.setSourceXOffset(offsetInfo.Render.XOffset);
152-
blitCmd.setSourceYOffset(offsetInfo.Render.YOffset);
153-
blitCmd.setSourceSurfaceDepth(1);
154-
blitCmd.setSourceArrayIndex(1);
155-
} else {
156-
blitProperties.dstAllocation->getDefaultGmm()->gmmResourceInfo->getOffset(offsetInfo);
157-
blitCmd.setDestinationBaseAddress(ptrOffset(blitProperties.dstGpuAddress, offsetInfo.Render.Offset));
158-
blitCmd.setDestinationXOffset(offsetInfo.Render.XOffset);
159-
blitCmd.setDestinationYOffset(offsetInfo.Render.YOffset);
160-
blitCmd.setDestinationSurfaceDepth(1);
161-
blitCmd.setDestinationArrayIndex(1);
162-
}
163-
}
164-
}
165-
166-
template <>
167-
void BlitCommandsHelper<Family>::appendSliceOffsets(const BlitProperties &blitProperties, typename Family::XY_BLOCK_COPY_BLT &blitCmd, uint32_t sliceIndex, const RootDeviceEnvironment &rootDeviceEnvironment, uint32_t srcSlicePitch, uint32_t dstSlicePitch) {
168-
using XY_BLOCK_COPY_BLT = typename Family::XY_BLOCK_COPY_BLT;
169-
auto srcAddress = blitProperties.srcGpuAddress;
170-
auto dstAddress = blitProperties.dstGpuAddress;
171-
if (blitCmd.getSourceTiling() == XY_BLOCK_COPY_BLT::TILING::TILING_LINEAR) {
172-
blitCmd.setSourceBaseAddress(ptrOffset(srcAddress, srcSlicePitch * (sliceIndex + blitProperties.srcOffset.z)));
173-
} else {
174-
blitCmd.setSourceArrayIndex(sliceIndex + static_cast<uint32_t>(blitProperties.srcOffset.z) + 1);
175-
appendBaseAddressOffset(blitProperties, blitCmd, true);
176-
}
177-
if (blitCmd.getDestinationTiling() == XY_BLOCK_COPY_BLT::TILING::TILING_LINEAR) {
178-
blitCmd.setDestinationBaseAddress(ptrOffset(dstAddress, dstSlicePitch * (sliceIndex + blitProperties.dstOffset.z)));
179-
} else {
180-
blitCmd.setDestinationArrayIndex(sliceIndex + static_cast<uint32_t>(blitProperties.dstOffset.z) + 1);
181-
appendBaseAddressOffset(blitProperties, blitCmd, false);
182-
}
183-
}
184-
185137
template <>
186138
template <typename T>
187139
void BlitCommandsHelper<Family>::appendBlitCommandsForBuffer(const BlitProperties &blitProperties, T &blitCmd, const RootDeviceEnvironment &rootDeviceEnvironment) {

shared/test/unit_test/helpers/blit_commands_helper_tests.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -405,19 +405,6 @@ HWTEST_F(BlitTests, givenXyCopyBltCommandWhenAppendBlitCommandsMemCopyIsCalledTh
405405
EXPECT_EQ(memcmp(&bltCmd, &bltCmdBefore, sizeof(XY_COPY_BLT)), 0);
406406
}
407407

408-
HWTEST_F(BlitTests, givenXyBlockCopyBltCommandAndSliceIndex0WhenAppendBaseAddressOffsetIsCalledThenNothingChanged) {
409-
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
410-
auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt;
411-
auto bltCmdBefore = bltCmd;
412-
BlitProperties properties{};
413-
414-
NEO::BlitCommandsHelper<FamilyType>::appendBaseAddressOffset(properties, bltCmd, false);
415-
EXPECT_EQ(memcmp(&bltCmd, &bltCmdBefore, sizeof(XY_BLOCK_COPY_BLT)), 0);
416-
417-
NEO::BlitCommandsHelper<FamilyType>::appendBaseAddressOffset(properties, bltCmd, true);
418-
EXPECT_EQ(memcmp(&bltCmd, &bltCmdBefore, sizeof(XY_BLOCK_COPY_BLT)), 0);
419-
}
420-
421408
using BlitColor = IsWithinProducts<IGFX_SKYLAKE, IGFX_ICELAKE_LP>;
422409

423410
HWTEST2_F(BlitTests, givenMemoryWhenFillPatternSizeIs4BytesThen32BitMaskISSetCorrectly, BlitColor) {

shared/test/unit_test/helpers/test_blit_commands_helper_xehp_and_later.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -669,33 +669,3 @@ HWTEST2_F(BlitTests, givenDispatchDummyBlitWhenForceDummyBlitWaDisabledThenAddit
669669
EXPECT_EQ(expectedSize, stream.getUsed());
670670
EXPECT_EQ(nullptr, rootDeviceEnvironment.getDummyAllocation());
671671
}
672-
673-
struct IsAtLeastXeHpCoreAndNotXe2HpgCoreWith2DArrayImageSupport {
674-
template <PRODUCT_FAMILY productFamily>
675-
static constexpr bool isMatched() {
676-
return IsAtLeastGfxCore<IGFX_XE_HP_CORE>::isMatched<productFamily>() && !IsXe2HpgCore::isMatched<productFamily>() && NEO::HwMapper<productFamily>::GfxProduct::supportsSampler;
677-
}
678-
};
679-
680-
HWTEST2_F(BlitTests, givenXeHPOrAboveTiledResourcesWhenAppendSliceOffsetsIsCalledThenIndexesAreSet, IsAtLeastXeHpCoreAndNotXe2HpgCoreWith2DArrayImageSupport) {
681-
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
682-
683-
auto blitCmd = FamilyType::cmdInitXyBlockCopyBlt;
684-
blitCmd.setSourceTiling(XY_BLOCK_COPY_BLT::TILING::TILING_TILE64);
685-
blitCmd.setDestinationTiling(XY_BLOCK_COPY_BLT::TILING::TILING_TILE64);
686-
MockGraphicsAllocation mockAllocationSrc(0, 1u /*num gmms*/, AllocationType::internalHostMemory,
687-
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
688-
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
689-
MockGraphicsAllocation mockAllocationDst(0, 1u /*num gmms*/, AllocationType::internalHostMemory,
690-
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
691-
MemoryPool::system4KBPages, MemoryManager::maxOsContextCount);
692-
BlitProperties properties{};
693-
uint32_t sliceIndex = 1;
694-
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
695-
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
696-
697-
BlitCommandsHelper<FamilyType>::appendSliceOffsets(properties, blitCmd, sliceIndex, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
698-
699-
EXPECT_EQ(blitCmd.getDestinationArrayIndex(), sliceIndex + 1);
700-
EXPECT_EQ(blitCmd.getSourceArrayIndex(), sliceIndex + 1);
701-
}

shared/test/unit_test/xe2_hpg_core/test_blit_commands_helper_xe2_hpg_core.cpp

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -396,58 +396,3 @@ HWTEST2_F(BlitTests, givenMemoryAndImageWhenDispatchCopyImageCallThenCommandAdde
396396
auto itor = find<XY_BLOCK_COPY_BLT *>(cmdList.begin(), cmdList.end());
397397
EXPECT_NE(cmdList.end(), itor);
398398
}
399-
400-
HWTEST2_F(BlitTests, givenSurfaceTypeAndSliceIndexWhenAppendBaseAddressOffsetIsCalledThenBaseAddressAndArrayIndexAreCorrectlySet, IsXe2HpgCore) {
401-
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
402-
MockGraphicsAllocation mockAllocationSrc(reinterpret_cast<void *>(0x1234), 0x1000, sizeof(uint32_t));
403-
MockGraphicsAllocation mockAllocationDst(reinterpret_cast<void *>(0x1234), 0x1000, sizeof(uint32_t));
404-
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
405-
mockAllocationSrc.setGmm(gmm.get(), 0u);
406-
mockAllocationDst.setGmm(gmm.get(), 0u);
407-
BlitProperties properties{};
408-
properties.srcAllocation = &mockAllocationSrc;
409-
properties.dstAllocation = &mockAllocationDst;
410-
properties.srcGpuAddress = mockAllocationSrc.getGpuAddress();
411-
properties.dstGpuAddress = mockAllocationDst.getGpuAddress();
412-
properties.srcRowPitch = 1;
413-
properties.dstRowPitch = 1;
414-
properties.srcSize.z = 129;
415-
properties.dstSize.z = 129;
416-
std::array<std::tuple<typename XY_BLOCK_COPY_BLT::SURFACE_TYPE, uint32_t, uint32_t, uint32_t>, 4> testParams =
417-
{{{XY_BLOCK_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_2D, 0u, 0u, 0u},
418-
{XY_BLOCK_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_2D, 64u, 64u, 64u},
419-
{XY_BLOCK_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_2D, 64u, 128u, 128u},
420-
{XY_BLOCK_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_2D, 4096u, 1u, 1u}}};
421-
for (const auto &isSource : {false, true}) {
422-
for (const auto &[surfaceType, qPitch, sliceIndex, anchorSliceIndex] : testParams) {
423-
uint32_t y1Top = 0;
424-
uint32_t yOffset = 0;
425-
auto blitCmd = FamilyType::cmdInitXyBlockCopyBlt;
426-
blitCmd.setSourceTiling(XY_BLOCK_COPY_BLT::TILING::TILING_TILE4);
427-
blitCmd.setDestinationTiling(XY_BLOCK_COPY_BLT::TILING::TILING_TILE4);
428-
blitCmd.setSourceSurfaceType(surfaceType);
429-
blitCmd.setDestinationSurfaceType(surfaceType);
430-
blitCmd.setSourceBaseAddress(properties.srcGpuAddress);
431-
blitCmd.setDestinationBaseAddress(properties.dstGpuAddress);
432-
blitCmd.setSourceY1CoordinateTop(y1Top);
433-
blitCmd.setDestinationY1CoordinateTop(y1Top);
434-
blitCmd.setSourceYOffset(yOffset);
435-
blitCmd.setDestinationYOffset(yOffset);
436-
blitCmd.setSourceSurfaceQpitch(qPitch);
437-
blitCmd.setDestinationSurfaceQpitch(qPitch);
438-
blitCmd.setSourceSurfaceDepth(static_cast<uint32_t>(properties.srcSize.z));
439-
blitCmd.setDestinationSurfaceDepth(static_cast<uint32_t>(properties.dstSize.z));
440-
BlitCommandsHelper<FamilyType>::appendBaseAddressOffset(properties, blitCmd, isSource);
441-
auto gpuAddress = isSource ? properties.srcGpuAddress : properties.dstGpuAddress;
442-
if (isSource) {
443-
EXPECT_EQ(blitCmd.getSourceBaseAddress(), gpuAddress);
444-
EXPECT_EQ(blitCmd.getSourceSurfaceDepth(), 1u);
445-
EXPECT_EQ(blitCmd.getSourceArrayIndex(), 1u);
446-
} else {
447-
EXPECT_EQ(blitCmd.getDestinationBaseAddress(), gpuAddress);
448-
EXPECT_EQ(blitCmd.getDestinationSurfaceDepth(), 1u);
449-
EXPECT_EQ(blitCmd.getDestinationArrayIndex(), 1u);
450-
}
451-
}
452-
}
453-
}

0 commit comments

Comments
 (0)