2018-11-11 05:25:48 +08:00
|
|
|
/*
|
2021-02-08 19:46:03 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2018-11-11 05:25:48 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-10-16 18:10:52 +08:00
|
|
|
#include "shared/source/aub/aub_center.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2020-10-16 18:10:52 +08:00
|
|
|
#include "shared/source/aub/aub_helper.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2021-08-27 21:30:39 +08:00
|
|
|
#include "shared/source/os_interface/hw_info_config.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2019-01-19 04:44:23 +08:00
|
|
|
#include "third_party/aub_stream/headers/aub_manager.h"
|
2019-03-26 23:30:28 +08:00
|
|
|
#include "third_party/aub_stream/headers/aubstream.h"
|
2018-11-11 05:25:48 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2020-08-31 15:37:36 +08:00
|
|
|
extern aub_stream::AubManager *createAubManager(uint32_t productFamily, uint32_t devicesCount, uint64_t memoryBankSize, uint32_t stepping, bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace);
|
2019-01-19 04:44:23 +08:00
|
|
|
|
2021-03-05 19:14:21 +08:00
|
|
|
AubCenter::AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) {
|
2018-11-11 05:25:48 +08:00
|
|
|
if (DebugManager.flags.UseAubStream.get()) {
|
2020-01-20 22:46:03 +08:00
|
|
|
auto devicesCount = HwHelper::getSubDevicesCount(pHwInfo);
|
2021-12-06 19:38:24 +08:00
|
|
|
auto memoryBankSize = AubHelper::getPerTileLocalMemorySize(pHwInfo);
|
2019-02-19 15:55:11 +08:00
|
|
|
CommandStreamReceiverType type = csrType;
|
|
|
|
if (DebugManager.flags.SetCommandStreamReceiver.get() >= CommandStreamReceiverType::CSR_HW) {
|
|
|
|
type = static_cast<CommandStreamReceiverType>(DebugManager.flags.SetCommandStreamReceiver.get());
|
|
|
|
}
|
|
|
|
|
2019-02-08 22:08:35 +08:00
|
|
|
aubStreamMode = getAubStreamMode(aubFileName, type);
|
2019-02-05 21:16:37 +08:00
|
|
|
|
2021-02-08 19:46:03 +08:00
|
|
|
auto &hwHelper = HwHelper::get(pHwInfo->platform.eRenderCoreFamily);
|
2021-08-27 21:30:39 +08:00
|
|
|
const auto &hwInfoConfig = *HwInfoConfig::get(pHwInfo->platform.eProductFamily);
|
|
|
|
stepping = hwInfoConfig.getAubStreamSteppingFromHwRevId(*pHwInfo);
|
2021-02-08 19:46:03 +08:00
|
|
|
|
2021-03-05 19:14:21 +08:00
|
|
|
aub_stream::MMIOList extraMmioList = hwHelper.getExtraMmioList(*pHwInfo, gmmHelper);
|
2021-02-08 19:46:03 +08:00
|
|
|
aub_stream::MMIOList debugMmioList = AubHelper::getAdditionalMmioList();
|
|
|
|
|
|
|
|
extraMmioList.insert(extraMmioList.end(), debugMmioList.begin(), debugMmioList.end());
|
|
|
|
|
|
|
|
aub_stream::injectMMIOList(extraMmioList);
|
2020-08-22 20:12:46 +08:00
|
|
|
|
|
|
|
AubHelper::setTbxConfiguration();
|
2019-01-14 17:31:06 +08:00
|
|
|
|
2021-02-11 22:25:48 +08:00
|
|
|
aubManager.reset(createAubManager(pHwInfo->platform.eProductFamily, devicesCount, memoryBankSize, stepping, localMemoryEnabled,
|
|
|
|
aubStreamMode, pHwInfo->capabilityTable.gpuAddressSpace));
|
2018-11-11 05:25:48 +08:00
|
|
|
}
|
|
|
|
addressMapper = std::make_unique<AddressMapper>();
|
|
|
|
streamProvider = std::make_unique<AubFileStreamProvider>();
|
2019-06-03 15:57:27 +08:00
|
|
|
subCaptureCommon = std::make_unique<AubSubCaptureCommon>();
|
2019-02-20 05:50:52 +08:00
|
|
|
if (DebugManager.flags.AUBDumpSubCaptureMode.get()) {
|
2019-06-03 15:57:27 +08:00
|
|
|
this->subCaptureCommon->subCaptureMode = static_cast<AubSubCaptureCommon::SubCaptureMode>(DebugManager.flags.AUBDumpSubCaptureMode.get());
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpKernelStartIdx = static_cast<uint32_t>(DebugManager.flags.AUBDumpFilterKernelStartIdx.get());
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpKernelEndIdx = static_cast<uint32_t>(DebugManager.flags.AUBDumpFilterKernelEndIdx.get());
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpNamedKernelStartIdx = static_cast<uint32_t>(DebugManager.flags.AUBDumpFilterNamedKernelStartIdx.get());
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpNamedKernelEndIdx = static_cast<uint32_t>(DebugManager.flags.AUBDumpFilterNamedKernelEndIdx.get());
|
2019-02-20 05:50:52 +08:00
|
|
|
if (DebugManager.flags.AUBDumpFilterKernelName.get() != "unk") {
|
2019-06-03 15:57:27 +08:00
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpKernelName = DebugManager.flags.AUBDumpFilterKernelName.get();
|
2019-02-20 05:50:52 +08:00
|
|
|
}
|
|
|
|
}
|
2018-11-11 05:25:48 +08:00
|
|
|
}
|
2018-12-11 00:12:32 +08:00
|
|
|
|
|
|
|
AubCenter::AubCenter() {
|
|
|
|
addressMapper = std::make_unique<AddressMapper>();
|
|
|
|
streamProvider = std::make_unique<AubFileStreamProvider>();
|
2019-06-03 15:57:27 +08:00
|
|
|
subCaptureCommon = std::make_unique<AubSubCaptureCommon>();
|
2018-12-11 00:12:32 +08:00
|
|
|
}
|
2019-02-05 21:16:37 +08:00
|
|
|
|
|
|
|
uint32_t AubCenter::getAubStreamMode(const std::string &aubFileName, uint32_t csrType) {
|
|
|
|
uint32_t mode = aub_stream::mode::aubFile;
|
|
|
|
|
2019-02-08 22:08:35 +08:00
|
|
|
switch (csrType) {
|
|
|
|
case CommandStreamReceiverType::CSR_HW_WITH_AUB:
|
|
|
|
case CommandStreamReceiverType::CSR_AUB:
|
|
|
|
mode = aub_stream::mode::aubFile;
|
|
|
|
break;
|
|
|
|
case CommandStreamReceiverType::CSR_TBX:
|
|
|
|
mode = aub_stream::mode::tbx;
|
|
|
|
break;
|
|
|
|
case CommandStreamReceiverType::CSR_TBX_WITH_AUB:
|
|
|
|
mode = aub_stream::mode::aubFileAndTbx;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2019-02-05 21:16:37 +08:00
|
|
|
}
|
2019-02-08 22:08:35 +08:00
|
|
|
|
2019-02-05 21:16:37 +08:00
|
|
|
return mode;
|
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|