From 19de738e03df78ef678f0b747ea804b0e23b8673 Mon Sep 17 00:00:00 2001 From: Maciej Dziuban Date: Mon, 4 May 2020 16:34:13 +0200 Subject: [PATCH] Enable copy engine on GEN12LP Change-Id: Ifd82abcb830a52d0e38e83a52c095da275e671fb Signed-off-by: Maciej Dziuban Related-To: NEO-4233 --- opencl/source/gen12lp/hw_helper_gen12lp.cpp | 4 + .../windows/hw_info_config_gen12lp.cpp | 1 + .../gen12lp/hw_helper_tests_gen12lp.inl | 19 ++ .../unit_test/helpers/hw_helper_tests.cpp | 24 +- .../command_stream_receiver_hw_gen12lp.cpp | 2 +- shared/source/gen12lp/hw_cmds_base.h | 4 +- .../gen12lp/hw_cmds_generated_gen12lp.inl | 249 ++++++++++++++++++ shared/source/helpers/CMakeLists.txt | 2 + shared/source/helpers/hw_helper.h | 3 + shared/source/helpers/hw_helper_bdw_plus.inl | 5 + .../helpers/hw_info_config_common_helper.cpp | 24 ++ .../helpers/hw_info_config_common_helper.h | 16 ++ shared/source/sku_info/definitions/sku_info.h | 8 +- 13 files changed, 356 insertions(+), 5 deletions(-) create mode 100644 shared/source/helpers/hw_info_config_common_helper.cpp create mode 100644 shared/source/helpers/hw_info_config_common_helper.h diff --git a/opencl/source/gen12lp/hw_helper_gen12lp.cpp b/opencl/source/gen12lp/hw_helper_gen12lp.cpp index 4bdbabb298..632a73b57f 100644 --- a/opencl/source/gen12lp/hw_helper_gen12lp.cpp +++ b/opencl/source/gen12lp/hw_helper_gen12lp.cpp @@ -130,6 +130,10 @@ const HwHelper::EngineInstancesContainer HwHelperHw::getGpgpuEngineInsta engines.push_back(aub_stream::ENGINE_CCS); } + if (hwInfo.featureTable.ftrBcsInfo.test(0)) { + engines.push_back(aub_stream::ENGINE_BCS); + } + return engines; }; diff --git a/opencl/source/gen12lp/windows/hw_info_config_gen12lp.cpp b/opencl/source/gen12lp/windows/hw_info_config_gen12lp.cpp index a334079b7c..0a4386941b 100644 --- a/opencl/source/gen12lp/windows/hw_info_config_gen12lp.cpp +++ b/opencl/source/gen12lp/windows/hw_info_config_gen12lp.cpp @@ -7,6 +7,7 @@ #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/helpers/hw_info.h" +#include "shared/source/helpers/hw_info_config_common_helper.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.inl" #include "shared/source/os_interface/hw_info_config_bdw_plus.inl" diff --git a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl index 8eb8c112f9..da7143d221 100644 --- a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl @@ -107,9 +107,26 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenDifferentSizesOfAllocationWhenCheckingCo } } +GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetAndBcsInfoSetWhenGetGpgpuEnginesThenReturnThreeRcsEnginesAndOneBcsEngine) { + HardwareInfo hwInfo = *defaultHwInfo; + hwInfo.featureTable.ftrCCSNode = false; + hwInfo.featureTable.ftrBcsInfo = 1; + hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; + + auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); + EXPECT_EQ(4u, device->engines.size()); + auto &engines = HwHelperHw::get().getGpgpuEngineInstances(hwInfo); + EXPECT_EQ(4u, engines.size()); + EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0]); + EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1]); + EXPECT_EQ(aub_stream::ENGINE_RCS, engines[2]); + EXPECT_EQ(aub_stream::ENGINE_BCS, engines[3]); +} + GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetWhenGetGpgpuEnginesThenReturnThreeRcsEngines) { HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrCCSNode = false; + hwInfo.featureTable.ftrBcsInfo = 0; hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); @@ -124,6 +141,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetWhenGetGpgpuEnginesThenR GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetWhenGetGpgpuEnginesThenReturnTwoRcsAndCcsEngines) { HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrCCSNode = true; + hwInfo.featureTable.ftrBcsInfo = 0; hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS; auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); @@ -139,6 +157,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetWhenGetGpgpuEnginesThenRetu GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetAndDefaultRcsWhenGetGpgpuEnginesThenReturnThreeRcsAndCcsEngines) { HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrCCSNode = true; + hwInfo.featureTable.ftrBcsInfo = 0; hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 48a3808c10..f51982e03e 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -11,6 +11,7 @@ #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/gmm_helper/resource_info.h" #include "shared/source/helpers/aligned_memory.h" +#include "shared/source/helpers/hw_info_config_common_helper.h" #include "shared/source/helpers/string.h" #include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/os_interface/hw_info_config.h" @@ -744,7 +745,7 @@ HWTEST_F(HwHelperTest, givenDebugVariableSetWhenAskingForAuxTranslationModeThenR if (HwHelperHw::getAuxTranslationMode() == AuxTranslationMode::Blit) { auto hwInfoConfig = HwInfoConfig::get(productFamily); - HardwareInfo hwInfo = {}; + HardwareInfo hwInfo = *defaultHwInfo; hwInfoConfig->configureHardwareCustom(&hwInfo, nullptr); EXPECT_TRUE(hwInfo.capabilityTable.blitterOperationsSupported); } @@ -872,3 +873,24 @@ HWTEST_F(PipeControlHelperTests, WhenProgrammingCacheFlushThenExpectBasicFieldsS EXPECT_TRUE(pipeControl->getPipeControlFlushEnable()); EXPECT_TRUE(pipeControl->getStateCacheInvalidationEnable()); } + +TEST(HwInfoConfigCommonHelperTest, givenBlitterPreferenceWhenEnablingBlitterOperationsSupportThenHonorThePreference) { + HardwareInfo hardwareInfo = *defaultHwInfo; + + HwInfoConfigCommonHelper::enableBlitterOperationsSupport(hardwareInfo); + const auto expectedBlitterSupport = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily).obtainBlitterPreference(hardwareInfo); + EXPECT_EQ(expectedBlitterSupport, hardwareInfo.capabilityTable.blitterOperationsSupported); +} + +TEST(HwInfoConfigCommonHelperTest, givenDebugFlagSetWhenEnablingBlitterOperationsSupportThenHonorTheFlag) { + DebugManagerStateRestore restore{}; + HardwareInfo hardwareInfo = *defaultHwInfo; + + DebugManager.flags.EnableBlitterOperationsSupport.set(1); + HwInfoConfigCommonHelper::enableBlitterOperationsSupport(hardwareInfo); + EXPECT_TRUE(hardwareInfo.capabilityTable.blitterOperationsSupported); + + DebugManager.flags.EnableBlitterOperationsSupport.set(0); + HwInfoConfigCommonHelper::enableBlitterOperationsSupport(hardwareInfo); + EXPECT_FALSE(hardwareInfo.capabilityTable.blitterOperationsSupported); +} diff --git a/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp b/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp index c53026a0a5..692d84fc03 100644 --- a/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp +++ b/shared/source/gen12lp/command_stream_receiver_hw_gen12lp.cpp @@ -90,7 +90,7 @@ const Family::GPGPU_CSR_BASE_ADDRESS Family::cmdInitGpgpuCsrBaseAddress = Family const Family::STATE_SIP Family::cmdInitStateSip = Family::STATE_SIP::sInit(); const Family::BINDING_TABLE_STATE Family::cmdInitBindingTableState = Family::BINDING_TABLE_STATE::sInit(); const Family::MI_USER_INTERRUPT Family::cmdInitUserInterrupt = Family::MI_USER_INTERRUPT::sInit(); -const Family::XY_SRC_COPY_BLT Family::cmdInitXyCopyBlt = Family::XY_SRC_COPY_BLT::sInit(); +const Family::XY_COPY_BLT Family::cmdInitXyCopyBlt = Family::XY_COPY_BLT::sInit(); const Family::MI_FLUSH_DW Family::cmdInitMiFlushDw = Family::MI_FLUSH_DW::sInit(); const Family::XY_COLOR_BLT Family::cmdInitXyColorBlt = Family::XY_COLOR_BLT::sInit(); } // namespace NEO diff --git a/shared/source/gen12lp/hw_cmds_base.h b/shared/source/gen12lp/hw_cmds_base.h index 595714e84a..8245654704 100644 --- a/shared/source/gen12lp/hw_cmds_base.h +++ b/shared/source/gen12lp/hw_cmds_base.h @@ -53,7 +53,7 @@ struct TGLLPFamily : public GEN12LP { using GfxFamily = TGLLPFamily; using WALKER_TYPE = GPGPU_WALKER; using VFE_STATE_TYPE = MEDIA_VFE_STATE; - using XY_COPY_BLT = typename GfxFamily::XY_SRC_COPY_BLT; + using XY_COPY_BLT = typename GfxFamily::XY_BLOCK_COPY_BLT; using MI_STORE_REGISTER_MEM_CMD = typename GfxFamily::MI_STORE_REGISTER_MEM; static const GPGPU_WALKER cmdInitGpgpuWalker; static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData; @@ -83,7 +83,7 @@ struct TGLLPFamily : public GEN12LP { static const STATE_SIP cmdInitStateSip; static const BINDING_TABLE_STATE cmdInitBindingTableState; static const MI_USER_INTERRUPT cmdInitUserInterrupt; - static const XY_SRC_COPY_BLT cmdInitXyCopyBlt; + static const XY_COPY_BLT cmdInitXyCopyBlt; static const MI_FLUSH_DW cmdInitMiFlushDw; static const XY_COLOR_BLT cmdInitXyColorBlt; diff --git a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl index 238cd786c5..e84fa17034 100644 --- a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl +++ b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl @@ -5392,4 +5392,253 @@ typedef struct tagGPGPU_CSR_BASE_ADDRESS { } GPGPU_CSR_BASE_ADDRESS; STATIC_ASSERT(12 == sizeof(GPGPU_CSR_BASE_ADDRESS)); +typedef struct tagXY_BLOCK_COPY_BLT { + union tagTheStructure { + struct tagCommon { + // DWORD 0 + uint32_t DwordLength : BITFIELD_RANGE(0, 7); + uint32_t Reserved_8 : BITFIELD_RANGE(8, 18); + uint32_t ColorDepth : BITFIELD_RANGE(19, 21); + uint32_t InstructionTarget_Opcode : BITFIELD_RANGE(22, 28); + uint32_t Client : BITFIELD_RANGE(29, 31); + // 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 Reserved_60 : BITFIELD_RANGE(28, 29); + uint32_t DestinationTiling : BITFIELD_RANGE(30, 31); + // DWORD 2 + uint32_t DestinationX1Coordinate_Left : BITFIELD_RANGE(0, 15); + uint32_t DestinationY1Coordinate_Top : BITFIELD_RANGE(16, 31); + // DWORD 3 + uint32_t DestinationX2Coordinate_Right : BITFIELD_RANGE(0, 15); + uint32_t DestinationY2Coordinate_Bottom : BITFIELD_RANGE(16, 31); + // DWORD 4 + uint64_t DestinationBaseAddress; + // DWORD 6 + uint32_t DestinationXOffset : BITFIELD_RANGE(0, 13); + uint32_t Reserved_206 : BITFIELD_RANGE(14, 15); + uint32_t DestinationYOffset : BITFIELD_RANGE(16, 29); + uint32_t Reserved_222 : BITFIELD_RANGE(30, 31); + // DWORD 7 + uint32_t SourceX1Coordinate_Left : BITFIELD_RANGE(0, 15); + uint32_t SourceY1Coordinate_Top : BITFIELD_RANGE(16, 31); + // DWORD 8 + uint32_t SourcePitch : BITFIELD_RANGE(0, 17); + uint32_t Reserved_274 : BITFIELD_RANGE(18, 20); + uint32_t SourceMocs : BITFIELD_RANGE(21, 27); + uint32_t Reserved_284 : BITFIELD_RANGE(28, 29); + uint32_t SourceTiling : BITFIELD_RANGE(30, 31); + // DWORD 9 + uint64_t SourceBaseAddress; + // DWORD 11 + uint32_t SourceXOffset : BITFIELD_RANGE(0, 13); + uint32_t Reserved_366 : BITFIELD_RANGE(14, 15); + uint32_t SourceYOffset : BITFIELD_RANGE(16, 29); + uint32_t Reserved_382 : BITFIELD_RANGE(30, 31); + } Common; + uint32_t RawData[12]; + } TheStructure; + typedef enum tagDWORD_LENGTH { + DWORD_LENGTH_EXCLUDES_DWORD_0_1 = 0xa, + } DWORD_LENGTH; + typedef enum tagCOLOR_DEPTH { + COLOR_DEPTH_8_BIT_COLOR = 0x0, + COLOR_DEPTH_16_BIT_COLOR = 0x1, + COLOR_DEPTH_32_BIT_COLOR = 0x2, + COLOR_DEPTH_64_BIT_COLOR = 0x3, + COLOR_DEPTH_96_BIT_COLOR_ONLY_LINEAR_CASE_IS_SUPPORTED = 0x4, + COLOR_DEPTH_128_BIT_COLOR = 0x5, + } COLOR_DEPTH; + typedef enum tagCLIENT { + CLIENT_2D_PROCESSOR = 0x2, + } CLIENT; + typedef enum tagDESTINATION_TILING { + DESTINATION_TILING_LINEAR = 0x0, + DESTINATION_TILING_YMAJOR = 0x1, + } DESTINATION_TILING; + typedef enum tagSOURCE_TILING { + SOURCE_TILING_LINEAR = 0x0, + SOURCE_TILING_YMAJOR = 0x1, + } SOURCE_TILING; + enum INSTRUCTIONTARGET_OPCODE { + INSTRUCTIONTARGET_OPCODE_OPCODE = 0x41, + }; + inline void init(void) { + memset(&TheStructure, 0, sizeof(TheStructure)); + TheStructure.Common.DwordLength = DWORD_LENGTH_EXCLUDES_DWORD_0_1; + TheStructure.Common.ColorDepth = COLOR_DEPTH_8_BIT_COLOR; + TheStructure.Common.InstructionTarget_Opcode = INSTRUCTIONTARGET_OPCODE_OPCODE; + TheStructure.Common.Client = CLIENT_2D_PROCESSOR; + TheStructure.Common.DestinationTiling = DESTINATION_TILING_LINEAR; + TheStructure.Common.SourceTiling = SOURCE_TILING_LINEAR; + } + static tagXY_BLOCK_COPY_BLT sInit(void) { + XY_BLOCK_COPY_BLT state; + state.init(); + return state; + } + inline uint32_t &getRawData(const uint32_t index) { + 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; + } + inline COLOR_DEPTH getColorDepth(void) const { + return static_cast(TheStructure.Common.ColorDepth); + } + inline void setInstructionTargetOpcode(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x7f); + TheStructure.Common.InstructionTarget_Opcode = value; + } + inline uint32_t getInstructionTargetOpcode(void) const { + return TheStructure.Common.InstructionTarget_Opcode; + } + inline void setClient(const CLIENT value) { + TheStructure.Common.Client = value; + } + inline CLIENT getClient(void) const { + return static_cast(TheStructure.Common.Client); + } + inline void setDestinationPitch(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x3ffff); + TheStructure.Common.DestinationPitch = value - 1; + } + inline uint32_t getDestinationPitch(void) const { + return TheStructure.Common.DestinationPitch + 1; + } + inline void setDestinationMocsValue(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x7f); + TheStructure.Common.DestinationMocsValue = value; + } + inline uint32_t getDestinationMocsValue(void) const { + return TheStructure.Common.DestinationMocsValue; + } + inline void setDestinationTiling(const DESTINATION_TILING value) { + TheStructure.Common.DestinationTiling = value; + } + inline DESTINATION_TILING getDestinationTiling(void) const { + return static_cast(TheStructure.Common.DestinationTiling); + } + inline void setDestinationX1CoordinateLeft(const uint32_t value) { + UNRECOVERABLE_IF(value > 0xffff); + TheStructure.Common.DestinationX1Coordinate_Left = value; + } + inline uint32_t getDestinationX1CoordinateLeft(void) const { + return TheStructure.Common.DestinationX1Coordinate_Left; + } + inline void setDestinationY1CoordinateTop(const uint32_t value) { + UNRECOVERABLE_IF(value > 0xffff); + TheStructure.Common.DestinationY1Coordinate_Top = value; + } + inline uint32_t getDestinationY1CoordinateTop(void) const { + return TheStructure.Common.DestinationY1Coordinate_Top; + } + inline void setDestinationX2CoordinateRight(const uint32_t value) { + UNRECOVERABLE_IF(value > 0xffff); + TheStructure.Common.DestinationX2Coordinate_Right = value; + } + inline uint32_t getDestinationX2CoordinateRight(void) const { + return TheStructure.Common.DestinationX2Coordinate_Right; + } + inline void setDestinationY2CoordinateBottom(const uint32_t value) { + UNRECOVERABLE_IF(value > 0xffff); + TheStructure.Common.DestinationY2Coordinate_Bottom = value; + } + inline uint32_t getDestinationY2CoordinateBottom(void) const { + return TheStructure.Common.DestinationY2Coordinate_Bottom; + } + inline void setDestinationBaseAddress(const uint64_t value) { + TheStructure.Common.DestinationBaseAddress = value; + } + inline uint64_t getDestinationBaseAddress(void) const { + return TheStructure.Common.DestinationBaseAddress; + } + inline void setDestinationXOffset(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x3fff); + TheStructure.Common.DestinationXOffset = value; + } + inline uint32_t getDestinationXOffset(void) const { + return TheStructure.Common.DestinationXOffset; + } + inline void setDestinationYOffset(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x3fff); + TheStructure.Common.DestinationYOffset = value; + } + inline uint32_t getDestinationYOffset(void) const { + return TheStructure.Common.DestinationYOffset; + } + inline void setSourceX1CoordinateLeft(const uint32_t value) { + UNRECOVERABLE_IF(value > 0xffff); + TheStructure.Common.SourceX1Coordinate_Left = value; + } + inline uint32_t getSourceX1CoordinateLeft(void) const { + return TheStructure.Common.SourceX1Coordinate_Left; + } + inline void setSourceY1CoordinateTop(const uint32_t value) { + UNRECOVERABLE_IF(value > 0xffff); + TheStructure.Common.SourceY1Coordinate_Top = value; + } + inline uint32_t getSourceY1CoordinateTop(void) const { + return TheStructure.Common.SourceY1Coordinate_Top; + } + inline void setSourcePitch(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x3ffff); + TheStructure.Common.SourcePitch = value - 1; + } + inline uint32_t getSourcePitch(void) const { + return TheStructure.Common.SourcePitch + 1; + } + inline void setSourceMocs(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x7f); + TheStructure.Common.SourceMocs = value; + } + inline uint32_t getSourceMocs(void) const { + return TheStructure.Common.SourceMocs; + } + inline void setSourceTiling(const SOURCE_TILING value) { + TheStructure.Common.SourceTiling = value; + } + inline SOURCE_TILING getSourceTiling(void) const { + return static_cast(TheStructure.Common.SourceTiling); + } + inline void setSourceBaseAddress(const uint64_t value) { + TheStructure.Common.SourceBaseAddress = value; + } + inline uint64_t getSourceBaseAddress(void) const { + return TheStructure.Common.SourceBaseAddress; + } + inline void setSourceXOffset(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x3fff); + TheStructure.Common.SourceXOffset = value; + } + inline uint32_t getSourceXOffset(void) const { + return TheStructure.Common.SourceXOffset; + } + inline void setSourceYOffset(const uint32_t value) { + UNRECOVERABLE_IF(value > 0x3fff); + TheStructure.Common.SourceYOffset = value; + } + inline uint32_t getSourceYOffset(void) const { + return TheStructure.Common.SourceYOffset; + } +} XY_BLOCK_COPY_BLT; +STATIC_ASSERT(48 == sizeof(XY_BLOCK_COPY_BLT)); + #pragma pack() diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index 00fa1f4fac..5ee6daf249 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -52,6 +52,8 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tgllp_plus.inl ${CMAKE_CURRENT_SOURCE_DIR}/hw_info.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info.h + ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_common_helper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_common_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/interlocked_max.h ${CMAKE_CURRENT_SOURCE_DIR}/kernel_helpers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel_helpers.h diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index 03b5026da0..54abd3d242 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -50,6 +50,7 @@ class HwHelper { virtual const AubMemDump::LrcaHelper &getCsTraits(aub_stream::EngineType engineType) const = 0; virtual bool hvAlign4Required() const = 0; virtual bool obtainRenderBufferCompressionPreference(const HardwareInfo &hwInfo, const size_t size) const = 0; + virtual bool obtainBlitterPreference(const HardwareInfo &hwInfo) const = 0; virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) = 0; static bool renderCompressedBuffersSupported(const HardwareInfo &hwInfo); static bool renderCompressedImagesSupported(const HardwareInfo &hwInfo); @@ -174,6 +175,8 @@ class HwHelperHw : public HwHelper { bool obtainRenderBufferCompressionPreference(const HardwareInfo &hwInfo, const size_t size) const override; + bool obtainBlitterPreference(const HardwareInfo &hwInfo) const override; + bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) override; bool timestampPacketWriteSupported() const override; diff --git a/shared/source/helpers/hw_helper_bdw_plus.inl b/shared/source/helpers/hw_helper_bdw_plus.inl index 61fe1186c1..22f287e30b 100644 --- a/shared/source/helpers/hw_helper_bdw_plus.inl +++ b/shared/source/helpers/hw_helper_bdw_plus.inl @@ -40,6 +40,11 @@ bool HwHelperHw::timestampPacketWriteSupported() const { return false; } +template +bool HwHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { + return false; +} + template const HwHelper::EngineInstancesContainer HwHelperHw::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const { return {aub_stream::ENGINE_RCS, diff --git a/shared/source/helpers/hw_info_config_common_helper.cpp b/shared/source/helpers/hw_info_config_common_helper.cpp new file mode 100644 index 0000000000..2402fd3bdc --- /dev/null +++ b/shared/source/helpers/hw_info_config_common_helper.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/hw_info_config_common_helper.h" + +#include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/helpers/hw_helper.h" +#include "shared/source/helpers/hw_info.h" + +namespace NEO { +namespace HwInfoConfigCommonHelper { +void enableBlitterOperationsSupport(HardwareInfo &hardwareInfo) { + hardwareInfo.capabilityTable.blitterOperationsSupported = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily).obtainBlitterPreference(hardwareInfo); + + if (DebugManager.flags.EnableBlitterOperationsSupport.get() != -1) { + hardwareInfo.capabilityTable.blitterOperationsSupported = !!DebugManager.flags.EnableBlitterOperationsSupport.get(); + } +} +} // namespace HwInfoConfigCommonHelper +} // namespace NEO diff --git a/shared/source/helpers/hw_info_config_common_helper.h b/shared/source/helpers/hw_info_config_common_helper.h new file mode 100644 index 0000000000..8dfe354364 --- /dev/null +++ b/shared/source/helpers/hw_info_config_common_helper.h @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +namespace NEO { +struct HardwareInfo; + +namespace HwInfoConfigCommonHelper { +void enableBlitterOperationsSupport(HardwareInfo &hardwareInfo); +} +} // namespace NEO diff --git a/shared/source/sku_info/definitions/sku_info.h b/shared/source/sku_info/definitions/sku_info.h index 44461da26a..752ed02ea3 100644 --- a/shared/source/sku_info/definitions/sku_info.h +++ b/shared/source/sku_info/definitions/sku_info.h @@ -8,8 +8,14 @@ #pragma once #include "shared/source/sku_info/sku_info_base.h" +#include + namespace NEO { -struct FeatureTable : FeatureTableBase {}; +using BcsInfoMask = std::bitset<1>; + +struct FeatureTable : FeatureTableBase { + BcsInfoMask ftrBcsInfo = 0; +}; struct WorkaroundTable : WorkaroundTableBase {}; } // namespace NEO