From 69c33046928099efdf68d8dab786422481af8735 Mon Sep 17 00:00:00 2001 From: Maciej Dziuban Date: Thu, 9 May 2019 16:01:31 +0200 Subject: [PATCH] Extract methods to aub_command_stream_receiver_hw_base.inl Related-To: NEO-3016 Change-Id: I6efcd9cb1f2470c17b8caec2e8fb54d7ca45b448 Signed-off-by: Maciej Dziuban --- runtime/command_stream/CMakeLists.txt | 5 +-- ...> aub_command_stream_receiver_hw_base.inl} | 24 +------------ ...ub_command_stream_receiver_hw_bdw_plus.inl | 34 +++++++++++++++++++ .../aub_command_stream_receiver_gen10.cpp | 2 +- .../aub_command_stream_receiver_gen11.cpp | 3 +- .../gen8/aub_command_stream_receiver_gen8.cpp | 2 +- .../gen9/aub_command_stream_receiver_gen9.cpp | 2 +- 7 files changed, 43 insertions(+), 29 deletions(-) rename runtime/command_stream/{aub_command_stream_receiver_hw.inl => aub_command_stream_receiver_hw_base.inl} (97%) create mode 100644 runtime/command_stream/aub_command_stream_receiver_hw_bdw_plus.inl diff --git a/runtime/command_stream/CMakeLists.txt b/runtime/command_stream/CMakeLists.txt index dcbd12fe3a..b7e3c65e9f 100644 --- a/runtime/command_stream/CMakeLists.txt +++ b/runtime/command_stream/CMakeLists.txt @@ -9,10 +9,11 @@ set(RUNTIME_SRCS_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver.h ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_hw.h - ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_hw.inl + ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_hw_base.inl + ${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_hw_bdw_plus.inl ${CMAKE_CURRENT_SOURCE_DIR}/aub_stream_provider.h - ${CMAKE_CURRENT_SOURCE_DIR}/aub_subcapture.h ${CMAKE_CURRENT_SOURCE_DIR}/aub_subcapture.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/aub_subcapture.h ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver.h ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_hw.h diff --git a/runtime/command_stream/aub_command_stream_receiver_hw.inl b/runtime/command_stream/aub_command_stream_receiver_hw_base.inl similarity index 97% rename from runtime/command_stream/aub_command_stream_receiver_hw.inl rename to runtime/command_stream/aub_command_stream_receiver_hw_base.inl index 3725c116cd..4e44eeed98 100644 --- a/runtime/command_stream/aub_command_stream_receiver_hw.inl +++ b/runtime/command_stream/aub_command_stream_receiver_hw_base.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -579,11 +579,6 @@ inline void AUBCommandStreamReceiverHw::waitForTaskCountWithKmdNotify pollForCompletion(); } -template -constexpr uint32_t AUBCommandStreamReceiverHw::getMaskAndValueForPollForCompletion() { - return 0x100; -} - template void AUBCommandStreamReceiverHw::makeResidentExternal(AllocationView &allocationView) { externalAllocations.push_back(allocationView); @@ -784,12 +779,6 @@ uint32_t AUBCommandStreamReceiverHw::getDumpHandle() { return hashPtrToU32(this); } -template -void AUBCommandStreamReceiverHw::addContextToken(uint32_t dumpHandle) { - // Some simulator versions don't support adding the context token. - // This hook allows specialization for those that do. -} - template void AUBCommandStreamReceiverHw::addGUCStartMessage(uint64_t batchBufferAddress) { typedef typename GfxFamily::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START; @@ -828,15 +817,4 @@ void AUBCommandStreamReceiverHw::addGUCStartMessage(uint64_t batchBuf this->flatBatchBufferHelper->setPatchInfoData(patchInfoData); } -template -uint32_t AUBCommandStreamReceiverHw::getGUCWorkQueueItemHeader() { - uint32_t GUCWorkQueueItemHeader = 0x00030001; - return GUCWorkQueueItemHeader; -} - -template -int AUBCommandStreamReceiverHw::getAddressSpaceFromPTEBits(uint64_t entryBits) const { - return AubMemDump::AddressSpaceValues::TraceNonlocal; -} - } // namespace NEO diff --git a/runtime/command_stream/aub_command_stream_receiver_hw_bdw_plus.inl b/runtime/command_stream/aub_command_stream_receiver_hw_bdw_plus.inl new file mode 100644 index 0000000000..e84331efcd --- /dev/null +++ b/runtime/command_stream/aub_command_stream_receiver_hw_bdw_plus.inl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2019 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "runtime/command_stream/aub_command_stream_receiver_hw_base.inl" + +namespace NEO { + +template +constexpr uint32_t AUBCommandStreamReceiverHw::getMaskAndValueForPollForCompletion() { + return 0x100; +} + +template +void AUBCommandStreamReceiverHw::addContextToken(uint32_t dumpHandle) { + // Some simulator versions don't support adding the context token. + // This hook allows specialization for those that do. +} + +template +uint32_t AUBCommandStreamReceiverHw::getGUCWorkQueueItemHeader() { + uint32_t GUCWorkQueueItemHeader = 0x00030001; + return GUCWorkQueueItemHeader; +} + +template +int AUBCommandStreamReceiverHw::getAddressSpaceFromPTEBits(uint64_t entryBits) const { + return AubMemDump::AddressSpaceValues::TraceNonlocal; +} + +} // namespace NEO diff --git a/runtime/gen10/aub_command_stream_receiver_gen10.cpp b/runtime/gen10/aub_command_stream_receiver_gen10.cpp index b423fe8d4a..a99a10ea6c 100644 --- a/runtime/gen10/aub_command_stream_receiver_gen10.cpp +++ b/runtime/gen10/aub_command_stream_receiver_gen10.cpp @@ -6,7 +6,7 @@ */ #include "runtime/command_stream/aub_command_stream_receiver_hw.h" -#include "runtime/command_stream/aub_command_stream_receiver_hw.inl" +#include "runtime/command_stream/aub_command_stream_receiver_hw_bdw_plus.inl" #include "runtime/helpers/array_count.h" #include "runtime/helpers/base_object.h" diff --git a/runtime/gen11/aub_command_stream_receiver_gen11.cpp b/runtime/gen11/aub_command_stream_receiver_gen11.cpp index 9618f9e8e9..406211c8d7 100644 --- a/runtime/gen11/aub_command_stream_receiver_gen11.cpp +++ b/runtime/gen11/aub_command_stream_receiver_gen11.cpp @@ -6,11 +6,12 @@ */ #include "runtime/command_stream/aub_command_stream_receiver_hw.h" -#include "runtime/command_stream/aub_command_stream_receiver_hw.inl" +#include "runtime/command_stream/aub_command_stream_receiver_hw_bdw_plus.inl" #include "runtime/helpers/array_count.h" #include "runtime/helpers/base_object.h" namespace NEO { + typedef ICLFamily Family; static auto gfxCore = IGFX_GEN11_CORE; diff --git a/runtime/gen8/aub_command_stream_receiver_gen8.cpp b/runtime/gen8/aub_command_stream_receiver_gen8.cpp index 4f0c6da819..3faf83b5f0 100644 --- a/runtime/gen8/aub_command_stream_receiver_gen8.cpp +++ b/runtime/gen8/aub_command_stream_receiver_gen8.cpp @@ -6,7 +6,7 @@ */ #include "runtime/command_stream/aub_command_stream_receiver_hw.h" -#include "runtime/command_stream/aub_command_stream_receiver_hw.inl" +#include "runtime/command_stream/aub_command_stream_receiver_hw_bdw_plus.inl" #include "runtime/helpers/array_count.h" #include "runtime/helpers/base_object.h" diff --git a/runtime/gen9/aub_command_stream_receiver_gen9.cpp b/runtime/gen9/aub_command_stream_receiver_gen9.cpp index 26fbf2bd8e..18c602a770 100644 --- a/runtime/gen9/aub_command_stream_receiver_gen9.cpp +++ b/runtime/gen9/aub_command_stream_receiver_gen9.cpp @@ -6,7 +6,7 @@ */ #include "runtime/command_stream/aub_command_stream_receiver_hw.h" -#include "runtime/command_stream/aub_command_stream_receiver_hw.inl" +#include "runtime/command_stream/aub_command_stream_receiver_hw_bdw_plus.inl" #include "runtime/helpers/array_count.h" #include "runtime/helpers/base_object.h"