Revert "[PVC] Remove tlb flush from CCS"

This reverts commit e711aa9bc7.

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2023-01-02 12:36:07 +00:00
committed by Compute-Runtime-Automation
parent aec6a42d69
commit 6255361fcf
8 changed files with 10 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2022 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -161,9 +161,8 @@ bool DrmDirectSubmission<GfxFamily, Dispatcher>::handleResidency() {
template <typename GfxFamily, typename Dispatcher> template <typename GfxFamily, typename Dispatcher>
bool DrmDirectSubmission<GfxFamily, Dispatcher>::isNewResourceHandleNeeded() { bool DrmDirectSubmission<GfxFamily, Dispatcher>::isNewResourceHandleNeeded() {
const auto &productHelper = *ProductHelper::get(this->hwInfo->platform.eProductFamily);
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext); auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
auto newResourcesBound = productHelper.isTlbFlushRequired(osContextLinux->getEngineType()) && osContextLinux->isTlbFlushRequired(); auto newResourcesBound = osContextLinux->isTlbFlushRequired();
if (DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get() != -1) { if (DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get() != -1) {
newResourcesBound = DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get(); newResourcesBound = DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get();

View File

@@ -151,7 +151,6 @@ class ProductHelper {
virtual bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ) const = 0; virtual bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ) const = 0;
virtual bool isMidThreadPreemptionDisallowedForRayTracingKernels() const = 0; virtual bool isMidThreadPreemptionDisallowedForRayTracingKernels() const = 0;
virtual bool isBufferPoolAllocatorSupported() const = 0; virtual bool isBufferPoolAllocatorSupported() const = 0;
virtual bool isTlbFlushRequired(aub_stream::EngineType engineType) const = 0;
virtual uint64_t overridePatIndex(AllocationType allocationType, uint64_t patIndex) const = 0; virtual uint64_t overridePatIndex(AllocationType allocationType, uint64_t patIndex) const = 0;
virtual bool getFrontEndPropertyScratchSizeSupport() const = 0; virtual bool getFrontEndPropertyScratchSizeSupport() const = 0;
virtual bool getFrontEndPropertyPrivateScratchSizeSupport() const = 0; virtual bool getFrontEndPropertyPrivateScratchSizeSupport() const = 0;
@@ -297,7 +296,6 @@ class ProductHelperHw : public ProductHelper {
bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ) const override; bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ) const override;
bool isMidThreadPreemptionDisallowedForRayTracingKernels() const override; bool isMidThreadPreemptionDisallowedForRayTracingKernels() const override;
bool isBufferPoolAllocatorSupported() const override; bool isBufferPoolAllocatorSupported() const override;
bool isTlbFlushRequired(aub_stream::EngineType engineType) const override;
uint64_t overridePatIndex(AllocationType allocationType, uint64_t patIndex) const override; uint64_t overridePatIndex(AllocationType allocationType, uint64_t patIndex) const override;
bool getFrontEndPropertyScratchSizeSupport() const override; bool getFrontEndPropertyScratchSizeSupport() const override;

View File

@@ -50,11 +50,6 @@ void ProductHelperHw<gfxProduct>::adjustPlatformForProductFamily(HardwareInfo *h
template <PRODUCT_FAMILY gfxProduct> template <PRODUCT_FAMILY gfxProduct>
void ProductHelperHw<gfxProduct>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) const {} void ProductHelperHw<gfxProduct>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) const {}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired(aub_stream::EngineType engineType) const {
return true;
}
template <PRODUCT_FAMILY gfxProduct> template <PRODUCT_FAMILY gfxProduct>
void ProductHelperHw<gfxProduct>::enableBlitterOperationsSupport(HardwareInfo *hwInfo) const { void ProductHelperHw<gfxProduct>::enableBlitterOperationsSupport(HardwareInfo *hwInfo) const {
hwInfo->capabilityTable.blitterOperationsSupported = obtainBlitterPreference(*hwInfo); hwInfo->capabilityTable.blitterOperationsSupported = obtainBlitterPreference(*hwInfo);

View File

@@ -657,10 +657,9 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) const {
} }
void Drm::setNewResourceBoundToVM(uint32_t vmHandleId) { void Drm::setNewResourceBoundToVM(uint32_t vmHandleId) {
const auto &productHelper = this->getRootDeviceEnvironment().getHelper<ProductHelper>();
const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines(); const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines();
for (const auto &engine : engines) { for (const auto &engine : engines) {
if (engine.osContext->getDeviceBitfield().test(vmHandleId) && productHelper.isTlbFlushRequired(engine.osContext->getEngineType())) { if (engine.osContext->getDeviceBitfield().test(vmHandleId)) {
auto osContextLinux = static_cast<OsContextLinux *>(engine.osContext); auto osContextLinux = static_cast<OsContextLinux *>(engine.osContext);
if (&osContextLinux->getDrm() == this) { if (&osContextLinux->getDrm() == this) {

View File

@@ -43,11 +43,6 @@ std::pair<bool, bool> ProductHelperHw<gfxProduct>::isPipeControlPriorToNonPipeli
return {isBasicWARequired, isExtendedWARequired}; return {isBasicWARequired, isExtendedWARequired};
} }
template <>
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired(aub_stream::EngineType engineType) const {
return EngineHelpers::isBcs(engineType);
}
template <> template <>
void ProductHelperHw<gfxProduct>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) const { void ProductHelperHw<gfxProduct>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) const {
using SAMPLER_STATE = typename XeHpcCoreFamily::SAMPLER_STATE; using SAMPLER_STATE = typename XeHpcCoreFamily::SAMPLER_STATE;

View File

@@ -566,7 +566,6 @@ HWTEST_F(DrmDirectSubmissionTest, givenNewResourceBoundWhenDispatchCommandBuffer
DebugManagerStateRestore restorer; DebugManagerStateRestore restorer;
DebugManager.flags.DirectSubmissionNewResourceTlbFlush.set(-1); DebugManager.flags.DirectSubmissionNewResourceTlbFlush.set(-1);
const auto &productHelper = device->getProductHelper();
MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device->getDefaultEngine().commandStreamReceiver); MockDrmDirectSubmission<FamilyType, Dispatcher> directSubmission(*device->getDefaultEngine().commandStreamReceiver);
@@ -585,12 +584,9 @@ HWTEST_F(DrmDirectSubmissionTest, givenNewResourceBoundWhenDispatchCommandBuffer
hwParse.parseCommands<FamilyType>(directSubmission.ringCommandStream, 0); hwParse.parseCommands<FamilyType>(directSubmission.ringCommandStream, 0);
hwParse.findHardwareCommands<FamilyType>(); hwParse.findHardwareCommands<FamilyType>();
auto *pipeControl = hwParse.getCommand<PIPE_CONTROL>(); auto *pipeControl = hwParse.getCommand<PIPE_CONTROL>();
if (productHelper.isTlbFlushRequired(osContext->getEngineType())) { EXPECT_TRUE(pipeControl->getTlbInvalidate());
auto *pipeControl = hwParse.getCommand<PIPE_CONTROL>(); EXPECT_TRUE(pipeControl->getTextureCacheInvalidationEnable());
EXPECT_TRUE(pipeControl->getTlbInvalidate()); EXPECT_FALSE(osContext->isTlbFlushRequired());
} else {
EXPECT_EQ(pipeControl, nullptr);
}
EXPECT_EQ(directSubmission.getSizeNewResourceHandler(), sizeof(PIPE_CONTROL)); EXPECT_EQ(directSubmission.getSizeNewResourceHandler(), sizeof(PIPE_CONTROL));
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Intel Corporation * Copyright (C) 2022-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -118,13 +118,12 @@ TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoun
struct MockOsContextLinux : OsContextLinux { struct MockOsContextLinux : OsContextLinux {
using OsContextLinux::lastFlushedTlbFlushCounter; using OsContextLinux::lastFlushedTlbFlushCounter;
}; };
const auto &productHelper = *ProductHelper::get(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eProductFamily);
mock->setNewResourceBoundToVM(1u); mock->setNewResourceBoundToVM(1u);
for (const auto &engine : device->getAllEngines()) { for (const auto &engine : device->getAllEngines()) {
auto osContexLinux = static_cast<MockOsContextLinux *>(engine.osContext); auto osContexLinux = static_cast<MockOsContextLinux *>(engine.osContext);
if (osContexLinux->getDeviceBitfield().test(1u) && productHelper.isTlbFlushRequired(osContexLinux->getEngineType())) { if (osContexLinux->getDeviceBitfield().test(1u)) {
EXPECT_TRUE(osContexLinux->isTlbFlushRequired()); EXPECT_TRUE(osContexLinux->isTlbFlushRequired());
} else { } else {
EXPECT_FALSE(osContexLinux->isTlbFlushRequired()); EXPECT_FALSE(osContexLinux->isTlbFlushRequired());
@@ -142,7 +141,7 @@ TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoun
for (const auto &engine : devices[1]->getAllEngines()) { for (const auto &engine : devices[1]->getAllEngines()) {
auto osContexLinux = static_cast<OsContextLinux *>(engine.osContext); auto osContexLinux = static_cast<OsContextLinux *>(engine.osContext);
if (osContexLinux->getDeviceBitfield().test(0u) && productHelper.isTlbFlushRequired(osContexLinux->getEngineType())) { if (osContexLinux->getDeviceBitfield().test(0u)) {
EXPECT_TRUE(osContexLinux->isTlbFlushRequired()); EXPECT_TRUE(osContexLinux->isTlbFlushRequired());
} else { } else {
EXPECT_FALSE(osContexLinux->isTlbFlushRequired()); EXPECT_FALSE(osContexLinux->isTlbFlushRequired());

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Intel Corporation * Copyright (C) 2022-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -27,11 +27,6 @@ PVCTEST_F(PvcProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValue
EXPECT_EQ(aub_stream::ProductFamily::Pvc, productHelper->getAubStreamProductFamily()); EXPECT_EQ(aub_stream::ProductFamily::Pvc, productHelper->getAubStreamProductFamily());
} }
PVCTEST_F(PvcProductHelper, whenCheckIsTlbFlushRequiredThenReturnProperValue) {
EXPECT_TRUE(productHelper->isTlbFlushRequired(aub_stream::EngineType::ENGINE_BCS2));
EXPECT_FALSE(productHelper->isTlbFlushRequired(aub_stream::EngineType::ENGINE_CCS1));
}
PVCTEST_F(PvcProductHelper, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) { PVCTEST_F(PvcProductHelper, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) {
auto hwInfo = *defaultHwInfo; auto hwInfo = *defaultHwInfo;
hwInfo.platform.usRevId = 3; hwInfo.platform.usRevId = 3;