From fafcc0b58c1117aa7184ef540efc0375fa4570ee Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Fri, 4 Jun 2021 15:22:06 +0000 Subject: [PATCH] Correct naming of get/set transfer width/height functions for block copy These functions set parameters x2/y2 for block copy. When offset is not 0 then x2/y2 != transfer width/height, so the new names are more correct. Signed-off-by: Kamil Kopryk Related-To: NEO-4692 --- .../sources/cmdlist/test_cmdlist_2.cpp | 2 +- .../command_stream_receiver_hw_1_tests.cpp | 12 ++++---- .../command_stream_receiver_hw_2_tests.cpp | 4 +-- .../gen11/hw_cmds_generated_gen11.inl | 16 +++++----- .../gen12lp/hw_cmds_generated_gen12lp.inl | 30 +++++-------------- .../generated/gen8/hw_cmds_generated_gen8.inl | 16 +++++----- .../generated/gen9/hw_cmds_generated_gen9.inl | 16 +++++----- .../helpers/blit_commands_helper_base.inl | 16 +++++----- .../helpers/blit_commands_helper_tests.cpp | 6 ++-- 9 files changed, 52 insertions(+), 66 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp index fc4a5e029b..7026196f92 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp @@ -897,7 +897,7 @@ HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionWithinMaxBlitSize auto itor = find(cmdList.begin(), cmdList.end()); auto cmd = genCmdCast(*itor); EXPECT_EQ(cmd->getDestinationX1CoordinateLeft(), offsetX / bytesPerPixel); - EXPECT_EQ(cmd->getTransferWidth(), (offsetX + static_cast(copySize.x)) / bytesPerPixel); + EXPECT_EQ(cmd->getDestinationX2CoordinateRight(), (offsetX + static_cast(copySize.x)) / bytesPerPixel); } HWTEST2_F(CommandListCreate, givenCopyCommandListWhenCopyRegionGreaterThanMaxBlitSizeThenMoreThanOneBlitCommandHasBeenSpown, BlitBlockCopyPlatforms) { using GfxFamily = typename NEO::GfxFamilyMapper::GfxFamily; diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp index 965a157399..d20c6ffc36 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp @@ -894,8 +894,8 @@ HWTEST_F(BcsTests, givenBltSizeWithLeftoverWhenDispatchedThenProgramAllRequiredC expectedWidth = bltLeftover; expectedHeight = 1; } - EXPECT_EQ(expectedWidth, bltCmd->getTransferWidth()); - EXPECT_EQ(expectedHeight, bltCmd->getTransferHeight()); + EXPECT_EQ(expectedWidth, bltCmd->getDestinationX2CoordinateRight()); + EXPECT_EQ(expectedHeight, bltCmd->getDestinationY2CoordinateBottom()); EXPECT_EQ(expectedWidth, bltCmd->getDestinationPitch()); EXPECT_EQ(expectedWidth, bltCmd->getSourcePitch()); @@ -1207,8 +1207,8 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP offset = 0; } - EXPECT_EQ(expectedWidth, bltCmd->getTransferWidth()); - EXPECT_EQ(expectedHeight, bltCmd->getTransferHeight()); + EXPECT_EQ(expectedWidth, bltCmd->getDestinationX2CoordinateRight()); + EXPECT_EQ(expectedHeight, bltCmd->getDestinationY2CoordinateBottom()); EXPECT_EQ(expectedWidth, bltCmd->getDestinationPitch()); EXPECT_EQ(expectedWidth, bltCmd->getSourcePitch()); @@ -1295,8 +1295,8 @@ HWTEST_P(BcsDetaliedTestsWithParams, givenBltSizeWithLeftoverWhenDispatchedThenP offset = 0; } - EXPECT_EQ(expectedWidth, bltCmd->getTransferWidth()); - EXPECT_EQ(expectedHeight, bltCmd->getTransferHeight()); + EXPECT_EQ(expectedWidth, bltCmd->getDestinationX2CoordinateRight()); + EXPECT_EQ(expectedHeight, bltCmd->getDestinationY2CoordinateBottom()); EXPECT_EQ(expectedWidth, bltCmd->getDestinationPitch()); EXPECT_EQ(expectedWidth, bltCmd->getSourcePitch()); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp index d42bdced6c..d05fe10cff 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_2_tests.cpp @@ -1227,8 +1227,8 @@ HWTEST_F(BcsTests, givenAuxTranslationRequestWhenBlitCalledThenProgramCommandCor for (auto &cmd : hwParser.cmdList) { if (auto bltCmd = genCmdCast(cmd)) { xyCopyBltCmdFound++; - EXPECT_EQ(static_cast(allocationSize), bltCmd->getTransferWidth()); - EXPECT_EQ(1u, bltCmd->getTransferHeight()); + EXPECT_EQ(static_cast(allocationSize), bltCmd->getDestinationX2CoordinateRight()); + EXPECT_EQ(1u, bltCmd->getDestinationY2CoordinateBottom()); EXPECT_EQ(allocationGpuAddress, bltCmd->getDestinationBaseAddress()); EXPECT_EQ(allocationGpuAddress, bltCmd->getSourceBaseAddress()); diff --git a/shared/source/generated/gen11/hw_cmds_generated_gen11.inl b/shared/source/generated/gen11/hw_cmds_generated_gen11.inl index a93bf705e2..5ebc7d85c0 100644 --- a/shared/source/generated/gen11/hw_cmds_generated_gen11.inl +++ b/shared/source/generated/gen11/hw_cmds_generated_gen11.inl @@ -4360,18 +4360,18 @@ typedef struct tagXY_SRC_COPY_BLT { inline uint32_t getDestinationY1CoordinateTop(void) const { return TheStructure.Common.DestinationY1Coordinate_Top; } - inline void setTransferWidth(const uint32_t value) { + inline void setDestinationX2CoordinateRight(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationX2Coordinate_Right = value; } - inline uint32_t getTransferWidth(void) const { + inline uint32_t getDestinationX2CoordinateRight(void) const { return TheStructure.Common.DestinationX2Coordinate_Right; } - inline void setTransferHeight(const uint32_t value) { + inline void setDestinationY2CoordinateBottom(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff0000); TheStructure.Common.DestinationY2Coordinate_Bottom = value; } - inline uint32_t getTransferHeight(void) const { + inline uint32_t getDestinationY2CoordinateBottom(void) const { return TheStructure.Common.DestinationY2Coordinate_Bottom; } inline void setDestinationBaseAddress(const uint64_t value) { @@ -4553,18 +4553,18 @@ typedef struct tagXY_COLOR_BLT { inline uint32_t getDestinationY1CoordinateTop(void) const { return TheStructure.Common.DestinationY1Coordinate_Top; } - inline void setTransferWidth(const uint32_t value) { + inline void setDestinationX2CoordinateRight(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationX2Coordinate_Right = value; } - inline uint32_t getTransferWidth(void) const { + inline uint32_t getDestinationX2CoordinateRight(void) const { return TheStructure.Common.DestinationX2Coordinate_Right; } - inline void setTransferHeight(const uint32_t value) { + inline void setDestinationY2CoordinateBottom(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff0000); TheStructure.Common.DestinationY2Coordinate_Bottom = value; } - inline uint32_t getTransferHeight(void) const { + inline uint32_t getDestinationY2CoordinateBottom(void) const { return TheStructure.Common.DestinationY2Coordinate_Bottom; } inline void setDestinationBaseAddress(const uint64_t value) { diff --git a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl index 8b41fe2b82..8ac27e1a00 100644 --- a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl +++ b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl @@ -4029,18 +4029,18 @@ typedef struct tagXY_SRC_COPY_BLT { inline uint32_t getDestinationY1CoordinateTop(void) const { return TheStructure.Common.DestinationY1Coordinate_Top; } - inline void setTransferWidth(const uint32_t value) { + inline void setDestinationX2CoordinateRight(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationX2Coordinate_Right = value; } - inline uint32_t getTransferWidth(void) const { + inline uint32_t getDestinationX2CoordinateRight(void) const { return TheStructure.Common.DestinationX2Coordinate_Right; } - inline void setTransferHeight(const uint32_t value) { + inline void setDestinationY2CoordinateBottom(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationY2Coordinate_Bottom = value; } - inline uint32_t getTransferHeight(void) const { + inline uint32_t getDestinationY2CoordinateBottom(void) const { return TheStructure.Common.DestinationY2Coordinate_Bottom; } inline void setDestinationBaseAddress(const uint64_t value) { @@ -5672,21 +5672,7 @@ typedef struct tagXY_BLOCK_COPY_BLT { UNRECOVERABLE_IF(index >= 13); return TheStructure.RawData[index]; } - inline void setTransferWidth(const uint32_t value) { - TheStructure.Common.DestinationX2Coordinate_Right = value; - } - inline uint32_t getTransferWidth(void) const { - return (TheStructure.Common.DestinationX2Coordinate_Right); - } - - inline void setTransferHeight(const uint32_t value) { - TheStructure.Common.DestinationY2Coordinate_Bottom = value; - } - - inline uint32_t getTransferHeight(void) const { - return (TheStructure.Common.DestinationY2Coordinate_Bottom); - } inline void setColorDepth(const COLOR_DEPTH value) { TheStructure.Common.ColorDepth = value; } @@ -5955,18 +5941,18 @@ typedef struct tagXY_FAST_COLOR_BLT { inline uint32_t getDestinationY1CoordinateTop(void) const { return TheStructure.Common.DestinationY1Coordinate_Top; } - inline void setTransferWidth(const uint32_t value) { + inline void setDestinationX2CoordinateRight(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationX2Coordinate_Right = value; } - inline uint32_t getTransferWidth(void) const { + inline uint32_t getDestinationX2CoordinateRight(void) const { return TheStructure.Common.DestinationX2Coordinate_Right; } - inline void setTransferHeight(const uint32_t value) { + inline void setDestinationY2CoordinateBottom(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationY2Coordinate_Bottom = value; } - inline uint32_t getTransferHeight(void) const { + inline uint32_t getDestinationY2CoordinateBottom(void) const { return TheStructure.Common.DestinationY2Coordinate_Bottom; } inline void setDestinationBaseAddress(const uint64_t value) { diff --git a/shared/source/generated/gen8/hw_cmds_generated_gen8.inl b/shared/source/generated/gen8/hw_cmds_generated_gen8.inl index 7f0d8b623b..433e82f086 100644 --- a/shared/source/generated/gen8/hw_cmds_generated_gen8.inl +++ b/shared/source/generated/gen8/hw_cmds_generated_gen8.inl @@ -4044,18 +4044,18 @@ typedef struct tagXY_SRC_COPY_BLT { inline uint32_t getDestinationY1CoordinateTop(void) const { return TheStructure.Common.DestinationY1Coordinate_Top; } - inline void setTransferWidth(const uint32_t value) { + inline void setDestinationX2CoordinateRight(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationX2Coordinate_Right = value; } - inline uint32_t getTransferWidth(void) const { + inline uint32_t getDestinationX2CoordinateRight(void) const { return TheStructure.Common.DestinationX2Coordinate_Right; } - inline void setTransferHeight(const uint32_t value) { + inline void setDestinationY2CoordinateBottom(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff0000); TheStructure.Common.DestinationY2Coordinate_Bottom = value; } - inline uint32_t getTransferHeight(void) const { + inline uint32_t getDestinationY2CoordinateBottom(void) const { return TheStructure.Common.DestinationY2Coordinate_Bottom; } inline void setDestinationBaseAddress(const uint64_t value) { @@ -4237,18 +4237,18 @@ typedef struct tagXY_COLOR_BLT { inline uint32_t getDestinationY1CoordinateTop(void) const { return TheStructure.Common.DestinationY1Coordinate_Top; } - inline void setTransferWidth(const uint32_t value) { + inline void setDestinationX2CoordinateRight(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationX2Coordinate_Right = value; } - inline uint32_t getTransferWidth(void) const { + inline uint32_t getDestinationX2CoordinateRight(void) const { return TheStructure.Common.DestinationX2Coordinate_Right; } - inline void setTransferHeight(const uint32_t value) { + inline void setDestinationY2CoordinateBottom(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff0000); TheStructure.Common.DestinationY2Coordinate_Bottom = value; } - inline uint32_t getTransferHeight(void) const { + inline uint32_t getDestinationY2CoordinateBottom(void) const { return TheStructure.Common.DestinationY2Coordinate_Bottom; } inline void setDestinationBaseAddress(const uint64_t value) { diff --git a/shared/source/generated/gen9/hw_cmds_generated_gen9.inl b/shared/source/generated/gen9/hw_cmds_generated_gen9.inl index 19d5733103..5c2680836c 100644 --- a/shared/source/generated/gen9/hw_cmds_generated_gen9.inl +++ b/shared/source/generated/gen9/hw_cmds_generated_gen9.inl @@ -4239,18 +4239,18 @@ typedef struct tagXY_SRC_COPY_BLT { inline uint32_t getDestinationY1CoordinateTop(void) const { return TheStructure.Common.DestinationY1Coordinate_Top; } - inline void setTransferWidth(const uint32_t value) { + inline void setDestinationX2CoordinateRight(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationX2Coordinate_Right = value; } - inline uint32_t getTransferWidth(void) const { + inline uint32_t getDestinationX2CoordinateRight(void) const { return TheStructure.Common.DestinationX2Coordinate_Right; } - inline void setTransferHeight(const uint32_t value) { + inline void setDestinationY2CoordinateBottom(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff0000); TheStructure.Common.DestinationY2Coordinate_Bottom = value; } - inline uint32_t getTransferHeight(void) const { + inline uint32_t getDestinationY2CoordinateBottom(void) const { return TheStructure.Common.DestinationY2Coordinate_Bottom; } inline void setDestinationBaseAddress(const uint64_t value) { @@ -4432,18 +4432,18 @@ typedef struct tagXY_COLOR_BLT { inline uint32_t getDestinationY1CoordinateTop(void) const { return TheStructure.Common.DestinationY1Coordinate_Top; } - inline void setTransferWidth(const uint32_t value) { + inline void setDestinationX2CoordinateRight(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff); TheStructure.Common.DestinationX2Coordinate_Right = value; } - inline uint32_t getTransferWidth(void) const { + inline uint32_t getDestinationX2CoordinateRight(void) const { return TheStructure.Common.DestinationX2Coordinate_Right; } - inline void setTransferHeight(const uint32_t value) { + inline void setDestinationY2CoordinateBottom(const uint32_t value) { UNRECOVERABLE_IF(value > 0xffff0000); TheStructure.Common.DestinationY2Coordinate_Bottom = value; } - inline uint32_t getTransferHeight(void) const { + inline uint32_t getDestinationY2CoordinateBottom(void) const { return TheStructure.Common.DestinationY2Coordinate_Bottom; } inline void setDestinationBaseAddress(const uint64_t value) { diff --git a/shared/source/helpers/blit_commands_helper_base.inl b/shared/source/helpers/blit_commands_helper_base.inl index 0a187977c4..06de55f11e 100644 --- a/shared/source/helpers/blit_commands_helper_base.inl +++ b/shared/source/helpers/blit_commands_helper_base.inl @@ -192,8 +192,8 @@ void BlitCommandsHelper::dispatchBlitCommandsForBufferPerRow(const Bl { auto bltCmd = GfxFamily::cmdInitXyCopyBlt; - bltCmd.setTransferWidth(static_cast(width)); - bltCmd.setTransferHeight(static_cast(height)); + bltCmd.setDestinationX2CoordinateRight(static_cast(width)); + bltCmd.setDestinationY2CoordinateBottom(static_cast(height)); bltCmd.setDestinationPitch(static_cast(width)); bltCmd.setSourcePitch(static_cast(width)); @@ -248,8 +248,8 @@ void BlitCommandsHelper::dispatchBlitMemoryFill(NEO::GraphicsAllocati appendTilingEnable(tmpCmd); } } - tmpCmd.setTransferWidth(static_cast(width)); - tmpCmd.setTransferHeight(static_cast(height)); + tmpCmd.setDestinationX2CoordinateRight(static_cast(width)); + tmpCmd.setDestinationY2CoordinateBottom(static_cast(height)); tmpCmd.setDestinationPitch(static_cast(width)); appendBlitCommandsForFillBuffer(dstAlloc, tmpCmd, rootDeviceEnvironment); @@ -275,8 +275,8 @@ void BlitCommandsHelper::dispatchBlitCommandsRegion(const BlitPropert bltCmd.setDestinationX1CoordinateLeft(static_cast(blitProperties.dstOffset.x)); bltCmd.setDestinationY1CoordinateTop(static_cast(blitProperties.dstOffset.y)); - bltCmd.setTransferWidth(static_cast(blitProperties.dstOffset.x + blitProperties.copySize.x)); - bltCmd.setTransferHeight(static_cast(blitProperties.dstOffset.y + blitProperties.copySize.y)); + bltCmd.setDestinationX2CoordinateRight(static_cast(blitProperties.dstOffset.x + blitProperties.copySize.x)); + bltCmd.setDestinationY2CoordinateBottom(static_cast(blitProperties.dstOffset.y + blitProperties.copySize.y)); bltCmd.setSourceX1CoordinateLeft(static_cast(blitProperties.srcOffset.x)); bltCmd.setSourceY1CoordinateTop(static_cast(blitProperties.srcOffset.y)); @@ -377,8 +377,8 @@ void BlitCommandsHelper::dispatchBlitCommandsForBufferRegion(const Bl bltCmd.setSourceBaseAddress(srcAddress); bltCmd.setDestinationBaseAddress(dstAddress); - bltCmd.setTransferWidth(width); - bltCmd.setTransferHeight(height); + bltCmd.setDestinationX2CoordinateRight(width); + bltCmd.setDestinationY2CoordinateBottom(height); bltCmd.setSourcePitch(static_cast(blitProperties.srcRowPitch)); bltCmd.setDestinationPitch(static_cast(blitProperties.dstRowPitch)); diff --git a/shared/test/common/helpers/blit_commands_helper_tests.cpp b/shared/test/common/helpers/blit_commands_helper_tests.cpp index ea4640a9ed..b4034d1bd8 100644 --- a/shared/test/common/helpers/blit_commands_helper_tests.cpp +++ b/shared/test/common/helpers/blit_commands_helper_tests.cpp @@ -218,7 +218,7 @@ HWTEST_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWhe EXPECT_NE(cmdList.end(), itor); { auto cmd = genCmdCast(*itor); - EXPECT_EQ(cmd->getTransferHeight(), 1u); + EXPECT_EQ(cmd->getDestinationY2CoordinateBottom(), 1u); } } @@ -239,7 +239,7 @@ HWTEST_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBli EXPECT_NE(cmdList.end(), itor); { auto cmd = genCmdCast(*itor); - EXPECT_EQ(cmd->getTransferHeight(), 2u); + EXPECT_EQ(cmd->getDestinationY2CoordinateBottom(), 2u); EXPECT_EQ(cmd->getDestinationPitch(), BlitterConstants::maxBlitWidth); } } @@ -261,7 +261,7 @@ HWTEST_F(BlitTests, givenMemorySizeIsLessThanTwicenMaxWidthWhenFillPatternWithBl EXPECT_NE(cmdList.end(), itor); { auto cmd = genCmdCast(*itor); - EXPECT_EQ(cmd->getTransferHeight(), 1u); + EXPECT_EQ(cmd->getDestinationY2CoordinateBottom(), 1u); } }