Add gfx core helper getters to device and command stream receiver
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
0ee5310033
commit
fba5e99c48
|
@ -71,7 +71,8 @@ CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvi
|
||||||
internalAllocationStorage = std::make_unique<InternalAllocationStorage>(*this);
|
internalAllocationStorage = std::make_unique<InternalAllocationStorage>(*this);
|
||||||
const auto &hwInfo = peekHwInfo();
|
const auto &hwInfo = peekHwInfo();
|
||||||
uint32_t subDeviceCount = static_cast<uint32_t>(deviceBitfield.count());
|
uint32_t subDeviceCount = static_cast<uint32_t>(deviceBitfield.count());
|
||||||
bool platformImplicitScaling = GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily).platformSupportsImplicitScaling(hwInfo);
|
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
|
bool platformImplicitScaling = gfxCoreHelper.platformSupportsImplicitScaling(hwInfo);
|
||||||
if (NEO::ImplicitScalingHelper::isImplicitScalingEnabled(deviceBitfield, platformImplicitScaling) &&
|
if (NEO::ImplicitScalingHelper::isImplicitScalingEnabled(deviceBitfield, platformImplicitScaling) &&
|
||||||
subDeviceCount > 1 &&
|
subDeviceCount > 1 &&
|
||||||
DebugManager.flags.EnableStaticPartitioning.get() != 0) {
|
DebugManager.flags.EnableStaticPartitioning.get() != 0) {
|
||||||
|
@ -241,7 +242,8 @@ void CommandStreamReceiver::ensureCommandBufferAllocation(LinearStream &commandS
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandStreamReceiver::fillReusableAllocationsList() {
|
void CommandStreamReceiver::fillReusableAllocationsList() {
|
||||||
auto amountToFill = GfxCoreHelper::get(peekHwInfo().platform.eRenderCoreFamily).getAmountOfAllocationsToFill();
|
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
|
auto amountToFill = gfxCoreHelper.getAmountOfAllocationsToFill();
|
||||||
for (auto i = 0u; i < amountToFill; i++) {
|
for (auto i = 0u; i < amountToFill; i++) {
|
||||||
const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER,
|
const AllocationProperties commandStreamAllocationProperties{rootDeviceIndex, true, MemoryConstants::pageSize64k, AllocationType::COMMAND_BUFFER,
|
||||||
isMultiOsContextCapable(), false, deviceBitfield};
|
isMultiOsContextCapable(), false, deviceBitfield};
|
||||||
|
@ -743,9 +745,8 @@ bool CommandStreamReceiver::createWorkPartitionAllocation(const Device &device)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CommandStreamReceiver::createGlobalFenceAllocation() {
|
bool CommandStreamReceiver::createGlobalFenceAllocation() {
|
||||||
auto &rootDevicEnvironment = *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex].get();
|
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
auto &gfxCoreHelper = rootDevicEnvironment.getHelper<GfxCoreHelper>();
|
auto &hwInfo = peekHwInfo();
|
||||||
auto &hwInfo = *rootDevicEnvironment.getHardwareInfo();
|
|
||||||
if (!gfxCoreHelper.isFenceAllocationRequired(hwInfo)) {
|
if (!gfxCoreHelper.isFenceAllocationRequired(hwInfo)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -757,13 +758,14 @@ bool CommandStreamReceiver::createGlobalFenceAllocation() {
|
||||||
|
|
||||||
bool CommandStreamReceiver::createPreemptionAllocation() {
|
bool CommandStreamReceiver::createPreemptionAllocation() {
|
||||||
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||||
|
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
size_t preemptionSurfaceSize = hwInfo->capabilityTable.requiredPreemptionSurfaceSize;
|
size_t preemptionSurfaceSize = hwInfo->capabilityTable.requiredPreemptionSurfaceSize;
|
||||||
if (DebugManager.flags.OverrideCsrAllocationSize.get() > 0) {
|
if (DebugManager.flags.OverrideCsrAllocationSize.get() > 0) {
|
||||||
preemptionSurfaceSize = DebugManager.flags.OverrideCsrAllocationSize.get();
|
preemptionSurfaceSize = DebugManager.flags.OverrideCsrAllocationSize.get();
|
||||||
}
|
}
|
||||||
AllocationProperties properties{rootDeviceIndex, true, preemptionSurfaceSize, AllocationType::PREEMPTION, isMultiOsContextCapable(), false, deviceBitfield};
|
AllocationProperties properties{rootDeviceIndex, true, preemptionSurfaceSize, AllocationType::PREEMPTION, isMultiOsContextCapable(), false, deviceBitfield};
|
||||||
properties.flags.uncacheable = hwInfo->workaroundTable.flags.waCSRUncachable;
|
properties.flags.uncacheable = hwInfo->workaroundTable.flags.waCSRUncachable;
|
||||||
properties.alignment = GfxCoreHelper::get(hwInfo->platform.eRenderCoreFamily).getPreemptionAllocationAlignment();
|
properties.alignment = gfxCoreHelper.getPreemptionAllocationAlignment();
|
||||||
this->preemptionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
this->preemptionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||||
return this->preemptionAllocation != nullptr;
|
return this->preemptionAllocation != nullptr;
|
||||||
}
|
}
|
||||||
|
@ -913,6 +915,10 @@ const RootDeviceEnvironment &CommandStreamReceiver::peekRootDeviceEnvironment()
|
||||||
return *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex];
|
return *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GfxCoreHelper &CommandStreamReceiver::getGfxCoreHelper() const {
|
||||||
|
return peekRootDeviceEnvironment().getHelper<GfxCoreHelper>();
|
||||||
|
}
|
||||||
|
|
||||||
TaskCountType CommandStreamReceiver::getCompletionValue(const GraphicsAllocation &gfxAllocation) {
|
TaskCountType CommandStreamReceiver::getCompletionValue(const GraphicsAllocation &gfxAllocation) {
|
||||||
if (completionFenceValuePointer) {
|
if (completionFenceValuePointer) {
|
||||||
return *completionFenceValuePointer;
|
return *completionFenceValuePointer;
|
||||||
|
|
|
@ -52,6 +52,7 @@ class GmmHelper;
|
||||||
class TagAllocatorBase;
|
class TagAllocatorBase;
|
||||||
class LogicalStateHelper;
|
class LogicalStateHelper;
|
||||||
class KmdNotifyHelper;
|
class KmdNotifyHelper;
|
||||||
|
class GfxCoreHelper;
|
||||||
|
|
||||||
template <typename TSize>
|
template <typename TSize>
|
||||||
class TimestampPackets;
|
class TimestampPackets;
|
||||||
|
@ -332,6 +333,8 @@ class CommandStreamReceiver {
|
||||||
const HardwareInfo &peekHwInfo() const;
|
const HardwareInfo &peekHwInfo() const;
|
||||||
const RootDeviceEnvironment &peekRootDeviceEnvironment() const;
|
const RootDeviceEnvironment &peekRootDeviceEnvironment() const;
|
||||||
|
|
||||||
|
const GfxCoreHelper &getGfxCoreHelper() const;
|
||||||
|
|
||||||
MOCKABLE_VIRTUAL bool isGpuHangDetected() const;
|
MOCKABLE_VIRTUAL bool isGpuHangDetected() const;
|
||||||
MOCKABLE_VIRTUAL bool checkGpuHangDetected(TimeType currentTime, TimeType &lastHangCheckTime) const;
|
MOCKABLE_VIRTUAL bool checkGpuHangDetected(TimeType currentTime, TimeType &lastHangCheckTime) const;
|
||||||
|
|
||||||
|
|
|
@ -214,7 +214,7 @@ bool Device::createDeviceImpl() {
|
||||||
this->executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->initDebugger();
|
this->executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->initDebugger();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &gfxCoreHelper = GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily);
|
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
if (getDebugger() && gfxCoreHelper.disableL3CacheForDebug(hwInfo)) {
|
if (getDebugger() && gfxCoreHelper.disableL3CacheForDebug(hwInfo)) {
|
||||||
getGmmHelper()->forceAllResourcesUncached();
|
getGmmHelper()->forceAllResourcesUncached();
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ bool Device::createDeviceImpl() {
|
||||||
uuid.isValid = false;
|
uuid.isValid = false;
|
||||||
|
|
||||||
if (DebugManager.flags.EnableChipsetUniqueUUID.get() != 0) {
|
if (DebugManager.flags.EnableChipsetUniqueUUID.get() != 0) {
|
||||||
if (GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily).isChipsetUniqueUUIDSupported()) {
|
if (gfxCoreHelper.isChipsetUniqueUUIDSupported()) {
|
||||||
uuid.isValid = HwInfoConfig::get(hardwareInfo->platform.eProductFamily)->getUuid(this, uuid.id);
|
uuid.isValid = HwInfoConfig::get(hardwareInfo->platform.eProductFamily)->getUuid(this, uuid.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,8 @@ bool Device::createEngines() {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto &hwInfo = getHardwareInfo();
|
auto &hwInfo = getHardwareInfo();
|
||||||
auto gpgpuEngines = GfxCoreHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
|
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
|
auto gpgpuEngines = gfxCoreHelper.getGpgpuEngineInstances(hwInfo);
|
||||||
|
|
||||||
uint32_t deviceCsrIndex = 0;
|
uint32_t deviceCsrIndex = 0;
|
||||||
for (auto &engine : gpgpuEngines) {
|
for (auto &engine : gpgpuEngines) {
|
||||||
|
@ -302,7 +303,7 @@ bool Device::createEngines() {
|
||||||
|
|
||||||
void Device::addEngineToEngineGroup(EngineControl &engine) {
|
void Device::addEngineToEngineGroup(EngineControl &engine) {
|
||||||
const HardwareInfo &hardwareInfo = this->getHardwareInfo();
|
const HardwareInfo &hardwareInfo = this->getHardwareInfo();
|
||||||
const GfxCoreHelper &gfxCoreHelper = NEO::GfxCoreHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
const EngineGroupType engineGroupType = gfxCoreHelper.getEngineGroupType(engine.getEngineType(), engine.getEngineUsage(), hardwareInfo);
|
const EngineGroupType engineGroupType = gfxCoreHelper.getEngineGroupType(engine.getEngineType(), engine.getEngineUsage(), hardwareInfo);
|
||||||
|
|
||||||
if (!gfxCoreHelper.isSubDeviceEngineSupported(hardwareInfo, getDeviceBitfield(), engine.getEngineType())) {
|
if (!gfxCoreHelper.isSubDeviceEngineSupported(hardwareInfo, getDeviceBitfield(), engine.getEngineType())) {
|
||||||
|
@ -591,7 +592,7 @@ EngineControl &Device::getNextEngineForCommandQueue() {
|
||||||
const auto &defaultEngine = this->getDefaultEngine();
|
const auto &defaultEngine = this->getDefaultEngine();
|
||||||
|
|
||||||
const auto &hardwareInfo = this->getHardwareInfo();
|
const auto &hardwareInfo = this->getHardwareInfo();
|
||||||
const auto &gfxCoreHelper = NEO::GfxCoreHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
const auto &gfxCoreHelper = getGfxCoreHelper();
|
||||||
const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hardwareInfo);
|
const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hardwareInfo);
|
||||||
|
|
||||||
const auto defaultEngineGroupIndex = this->getEngineGroupIndexFromEngineGroupType(engineGroupType);
|
const auto defaultEngineGroupIndex = this->getEngineGroupIndexFromEngineGroupType(engineGroupType);
|
||||||
|
@ -746,6 +747,10 @@ void Device::getAdapterMask(uint32_t &nodeMask) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GfxCoreHelper &Device::getGfxCoreHelper() const {
|
||||||
|
return getRootDeviceEnvironment().getHelper<GfxCoreHelper>();
|
||||||
|
}
|
||||||
|
|
||||||
void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) {
|
void Device::allocateRTDispatchGlobals(uint32_t maxBvhLevels) {
|
||||||
UNRECOVERABLE_IF(rtDispatchGlobalsInfos.size() < maxBvhLevels + 1);
|
UNRECOVERABLE_IF(rtDispatchGlobalsInfos.size() < maxBvhLevels + 1);
|
||||||
UNRECOVERABLE_IF(rtDispatchGlobalsInfos[maxBvhLevels] != nullptr);
|
UNRECOVERABLE_IF(rtDispatchGlobalsInfos[maxBvhLevels] != nullptr);
|
||||||
|
|
|
@ -23,6 +23,7 @@ class OSTime;
|
||||||
class SourceLevelDebugger;
|
class SourceLevelDebugger;
|
||||||
class SubDevice;
|
class SubDevice;
|
||||||
struct PhysicalDevicePciBusInfo;
|
struct PhysicalDevicePciBusInfo;
|
||||||
|
class GfxCoreHelper;
|
||||||
|
|
||||||
struct SelectorCopyEngine : NonCopyableOrMovableClass {
|
struct SelectorCopyEngine : NonCopyableOrMovableClass {
|
||||||
std::atomic<bool> isMainUsed = false;
|
std::atomic<bool> isMainUsed = false;
|
||||||
|
@ -144,6 +145,7 @@ class Device : public ReferenceTrackedObject<Device> {
|
||||||
void getAdapterLuid(std::array<uint8_t, HwInfoConfig::luidSize> &luid);
|
void getAdapterLuid(std::array<uint8_t, HwInfoConfig::luidSize> &luid);
|
||||||
MOCKABLE_VIRTUAL bool verifyAdapterLuid();
|
MOCKABLE_VIRTUAL bool verifyAdapterLuid();
|
||||||
void getAdapterMask(uint32_t &nodeMask);
|
void getAdapterMask(uint32_t &nodeMask);
|
||||||
|
const GfxCoreHelper &getGfxCoreHelper() const;
|
||||||
|
|
||||||
std::atomic<uint32_t> debugExecutionCounter = 0;
|
std::atomic<uint32_t> debugExecutionCounter = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue