From d633b59f171e2e0c6a5c3e63067ab895b33a5b53 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Tue, 21 Sep 2021 19:18:49 +0000 Subject: [PATCH] Cleanup get/set MOCS functions Signed-off-by: Kamil Kopryk --- .../copy_engine_tests_xe_hp_core.cpp | 8 ++++---- .../gen12lp/hw_cmds_generated_gen12lp.inl | 20 +++++++++---------- .../hw_cmds_generated_xe_hp_core.inl | 20 +++++++++---------- .../blit_commands_helper_xehp_and_later.inl | 16 +++++++-------- ...st_blit_commands_helper_xehp_and_later.cpp | 2 +- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp index bd3736304f..ff32d35150 100644 --- a/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp @@ -189,10 +189,10 @@ XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenS auto bltCmd = genCmdCast(*(hwParser.cmdList.begin())); EXPECT_NE(nullptr, bltCmd); - auto mocsIndex = clDevice->getRootDeviceEnvironment().getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); + auto mocs = clDevice->getRootDeviceEnvironment().getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); - EXPECT_EQ(mocsIndex, bltCmd->getDestinationMOCSvalue()); - EXPECT_EQ(mocsIndex, bltCmd->getSourceMOCS()); + EXPECT_EQ(mocs, bltCmd->getDestinationMOCS()); + EXPECT_EQ(mocs, bltCmd->getSourceMOCS()); } XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenSetMocsToValueOfDebugKey) { @@ -218,7 +218,7 @@ XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenS auto bltCmd = genCmdCast(*(hwParser.cmdList.begin())); EXPECT_NE(nullptr, bltCmd); - EXPECT_EQ(0u, bltCmd->getDestinationMOCSvalue()); + EXPECT_EQ(0u, bltCmd->getDestinationMOCS()); EXPECT_EQ(0u, bltCmd->getSourceMOCS()); } diff --git a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl index 8ac27e1a00..40021e5937 100644 --- a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl +++ b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl @@ -5594,7 +5594,7 @@ typedef struct tagXY_BLOCK_COPY_BLT { // DWORD 1 uint32_t DestinationPitch : BITFIELD_RANGE(0, 17); uint32_t Reserved_50 : BITFIELD_RANGE(18, 20); - uint32_t DestinationMocsValue : BITFIELD_RANGE(21, 27); + uint32_t DestinationMOCS : BITFIELD_RANGE(21, 27); uint32_t Reserved_60 : BITFIELD_RANGE(28, 29); uint32_t DestinationTiling : BITFIELD_RANGE(30, 31); // DWORD 2 @@ -5699,12 +5699,12 @@ typedef struct tagXY_BLOCK_COPY_BLT { inline uint32_t getDestinationPitch(void) const { return TheStructure.Common.DestinationPitch + 1; } - inline void setDestinationMocsValue(const uint32_t value) { + inline void setDestinationMOCS(const uint32_t value) { UNRECOVERABLE_IF(value > 0x7f); - TheStructure.Common.DestinationMocsValue = value; + TheStructure.Common.DestinationMOCS = value; } - inline uint32_t getDestinationMocsValue(void) const { - return TheStructure.Common.DestinationMocsValue; + inline uint32_t getDestinationMOCS(void) const { + return TheStructure.Common.DestinationMOCS; } inline void setDestinationTiling(const DESTINATION_TILING value) { TheStructure.Common.DestinationTiling = value; @@ -5829,7 +5829,7 @@ typedef struct tagXY_FAST_COLOR_BLT { // DWORD 1 uint32_t DestinationPitch : BITFIELD_RANGE(0, 17); uint32_t Reserved_50 : BITFIELD_RANGE(18, 20); - uint32_t DestinationMocsValue : BITFIELD_RANGE(21, 27); + uint32_t DestinationMOCS : BITFIELD_RANGE(21, 27); uint32_t Reserved_60 : BITFIELD_RANGE(28, 29); uint32_t DestinationTiling : BITFIELD_RANGE(30, 31); // DWORD 2 @@ -5914,12 +5914,12 @@ typedef struct tagXY_FAST_COLOR_BLT { inline uint32_t getDestinationPitch(void) const { return TheStructure.Common.DestinationPitch + 1; } - inline void setDestinationMocsValue(const uint32_t value) { + inline void setDestinationMOCS(const uint32_t value) { UNRECOVERABLE_IF(value > 0x7f); - TheStructure.Common.DestinationMocsValue = value; + TheStructure.Common.DestinationMOCS = value; } - inline uint32_t getDestinationMocsValue(void) const { - return TheStructure.Common.DestinationMocsValue; + inline uint32_t getDestinationMOCS(void) const { + return TheStructure.Common.DestinationMOCS; } inline void setDestinationTiling(const DESTINATION_TILING value) { TheStructure.Common.DestinationTiling = value; diff --git a/shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl b/shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl index b4fffd4ac4..e7e9731aaa 100644 --- a/shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl +++ b/shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl @@ -3621,7 +3621,7 @@ struct XY_BLOCK_COPY_BLT { /// DWORD 1 uint32_t DestinationPitch : BITFIELD_RANGE(0, 17); uint32_t DestinationAuxiliarysurfacemode : BITFIELD_RANGE(18, 20); - uint32_t DestinationMOCSvalue : BITFIELD_RANGE(21, 27); + uint32_t DestinationMOCS : BITFIELD_RANGE(21, 27); uint32_t DestinationCompressionType : BITFIELD_RANGE(28, 28); uint32_t DestinationCompressionEnable : BITFIELD_RANGE(29, 29); uint32_t DestinationTiling : BITFIELD_RANGE(30, 31); @@ -3882,12 +3882,12 @@ struct XY_BLOCK_COPY_BLT { return static_cast(TheStructure.Common.DestinationAuxiliarysurfacemode); } - inline void setDestinationMOCSvalue(const uint32_t value) { - TheStructure.Common.DestinationMOCSvalue = value; + inline void setDestinationMOCS(const uint32_t value) { + TheStructure.Common.DestinationMOCS = value; } - inline uint32_t getDestinationMOCSvalue(void) const { - return (TheStructure.Common.DestinationMOCSvalue); + inline uint32_t getDestinationMOCS(void) const { + return (TheStructure.Common.DestinationMOCS); } inline void setDestinationCompressionType(const COMPRESSION_TYPE value) { @@ -4353,7 +4353,7 @@ struct XY_FAST_COLOR_BLT { /// DWORD 1 uint32_t DestinationPitch : BITFIELD_RANGE(0, 17); uint32_t DestinationAuxiliarysurfacemode : BITFIELD_RANGE(18, 20); - uint32_t DestinationMOCSvalue : BITFIELD_RANGE(21, 27); + uint32_t DestinationMOCS : BITFIELD_RANGE(21, 27); uint32_t DestinationCompressionType : BITFIELD_RANGE(28, 28); uint32_t DestinationCompressionEnable : BITFIELD_RANGE(29, 29); uint32_t DestinationTiling : BITFIELD_RANGE(30, 31); @@ -4560,12 +4560,12 @@ struct XY_FAST_COLOR_BLT { return static_cast(TheStructure.Common.DestinationAuxiliarysurfacemode); } - inline void setDestinationMOCSvalue(const uint32_t value) { - TheStructure.Common.DestinationMOCSvalue = value; + inline void setDestinationMOCS(const uint32_t value) { + TheStructure.Common.DestinationMOCS = value; } - inline uint32_t getDestinationMOCSvalue(void) const { - return (TheStructure.Common.DestinationMOCSvalue); + inline uint32_t getDestinationMOCS(void) const { + return (TheStructure.Common.DestinationMOCS); } inline void setDestinationCompressionType(const DESTINATION_COMPRESSION_TYPE value) { diff --git a/shared/source/helpers/blit_commands_helper_xehp_and_later.inl b/shared/source/helpers/blit_commands_helper_xehp_and_later.inl index bdcd3cfbe1..2294d319ba 100644 --- a/shared/source/helpers/blit_commands_helper_xehp_and_later.inl +++ b/shared/source/helpers/blit_commands_helper_xehp_and_later.inl @@ -99,12 +99,12 @@ void BlitCommandsHelper::appendBlitCommandsForBuffer(const BlitProper DEBUG_BREAK_IF((AuxTranslationDirection::None != blitProperties.auxTranslationDirection) && (dstAllocation != srcAllocation || !dstAllocationisCompressionEnabled)); - auto mocsIndex = rootDeviceEnvironment.getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); + auto mocs = rootDeviceEnvironment.getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); + blitCmd.setDestinationMOCS(mocs); + blitCmd.setSourceMOCS(mocs); - blitCmd.setDestinationMOCSvalue(mocsIndex); - blitCmd.setSourceMOCS(mocsIndex); if (DebugManager.flags.OverrideBlitterMocs.get() != -1) { - blitCmd.setDestinationMOCSvalue(DebugManager.flags.OverrideBlitterMocs.get()); + blitCmd.setDestinationMOCS(DebugManager.flags.OverrideBlitterMocs.get()); blitCmd.setSourceMOCS(DebugManager.flags.OverrideBlitterMocs.get()); } if (DebugManager.flags.OverrideBlitterTargetMemory.get() != -1) { @@ -147,12 +147,12 @@ void BlitCommandsHelper::appendBlitCommandsForFillBuffer(NEO::Graphic appendExtraMemoryProperties(blitCmd, rootDeviceEnvironment); - auto mocsIndex = rootDeviceEnvironment.getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); - - blitCmd.setDestinationMOCSvalue(mocsIndex); + auto mocs = rootDeviceEnvironment.getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); + blitCmd.setDestinationMOCS(mocs); if (DebugManager.flags.OverrideBlitterMocs.get() != -1) { - blitCmd.setDestinationMOCSvalue(DebugManager.flags.OverrideBlitterMocs.get()); + blitCmd.setDestinationMOCS(DebugManager.flags.OverrideBlitterMocs.get()); } + if (DebugManager.flags.OverrideBlitterTargetMemory.get() != -1) { if (DebugManager.flags.OverrideBlitterTargetMemory.get() == 0u) { blitCmd.setDestinationTargetMemory(XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_SYSTEM_MEM); diff --git a/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp b/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp index 295f4017a4..780984a096 100644 --- a/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp +++ b/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp @@ -221,7 +221,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForFillBuffer reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); - EXPECT_EQ(blitCmd.getDestinationMOCSvalue(), mockValue); + EXPECT_EQ(blitCmd.getDestinationMOCS(), mockValue); } HWTEST2_F(BlitTests, givenOverridedBliterTargetToZeroWhenAppendBlitCommandsForFillBufferThenUseSystemMem, BlitPlatforms) {