mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
[PVC] Remove tlb flush
Related-To: NEO-7116 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d24f403cc4
commit
181d2021ed
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2020-2022 Intel Corporation
|
* Copyright (C) 2020-2023 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -42,5 +42,6 @@ class DrmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
|
|||||||
TagData currentTagData{};
|
TagData currentTagData{};
|
||||||
volatile TagAddressType *tagAddress;
|
volatile TagAddressType *tagAddress;
|
||||||
TaskCountType completionFenceValue{};
|
TaskCountType completionFenceValue{};
|
||||||
|
bool tlbFlushRequired = true;
|
||||||
};
|
};
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ DrmDirectSubmission<GfxFamily, Dispatcher>::DrmDirectSubmission(const DirectSubm
|
|||||||
this->completionFenceValue = static_cast<decltype(completionFenceValue)>(DebugManager.flags.OverrideUserFenceStartValue.get());
|
this->completionFenceValue = static_cast<decltype(completionFenceValue)>(DebugManager.flags.OverrideUserFenceStartValue.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->tlbFlushRequired = inputParams.rootDeviceEnvironment.getProductHelper().isTlbFlushRequired();
|
||||||
|
|
||||||
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
|
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
|
||||||
|
|
||||||
auto subDevices = osContextLinux->getDeviceBitfield();
|
auto subDevices = osContextLinux->getDeviceBitfield();
|
||||||
@@ -162,7 +164,7 @@ 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() {
|
||||||
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
|
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
|
||||||
auto newResourcesBound = osContextLinux->isTlbFlushRequired();
|
auto newResourcesBound = this->tlbFlushRequired && osContextLinux->isTlbFlushRequired();
|
||||||
|
|
||||||
if (DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get() != -1) {
|
if (DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get() != -1) {
|
||||||
newResourcesBound = DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get();
|
newResourcesBound = DebugManager.flags.DirectSubmissionNewResourceTlbFlush.get();
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ class ProductHelper {
|
|||||||
virtual bool isMidThreadPreemptionDisallowedForRayTracingKernels() const = 0;
|
virtual bool isMidThreadPreemptionDisallowedForRayTracingKernels() const = 0;
|
||||||
virtual bool isBufferPoolAllocatorSupported() const = 0;
|
virtual bool isBufferPoolAllocatorSupported() 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 isTlbFlushRequired() const = 0;
|
||||||
virtual bool getFrontEndPropertyScratchSizeSupport() const = 0;
|
virtual bool getFrontEndPropertyScratchSizeSupport() const = 0;
|
||||||
virtual bool getFrontEndPropertyPrivateScratchSizeSupport() const = 0;
|
virtual bool getFrontEndPropertyPrivateScratchSizeSupport() const = 0;
|
||||||
virtual bool getFrontEndPropertyComputeDispatchAllWalkerSupport() const = 0;
|
virtual bool getFrontEndPropertyComputeDispatchAllWalkerSupport() const = 0;
|
||||||
@@ -295,7 +296,7 @@ class ProductHelperHw : public ProductHelper {
|
|||||||
bool isMidThreadPreemptionDisallowedForRayTracingKernels() const override;
|
bool isMidThreadPreemptionDisallowedForRayTracingKernels() const override;
|
||||||
bool isBufferPoolAllocatorSupported() const override;
|
bool isBufferPoolAllocatorSupported() const override;
|
||||||
uint64_t overridePatIndex(AllocationType allocationType, uint64_t patIndex) const override;
|
uint64_t overridePatIndex(AllocationType allocationType, uint64_t patIndex) const override;
|
||||||
|
bool isTlbFlushRequired() const override;
|
||||||
bool getFrontEndPropertyScratchSizeSupport() const override;
|
bool getFrontEndPropertyScratchSizeSupport() const override;
|
||||||
bool getFrontEndPropertyPrivateScratchSizeSupport() const override;
|
bool getFrontEndPropertyPrivateScratchSizeSupport() const override;
|
||||||
bool getFrontEndPropertyComputeDispatchAllWalkerSupport() const override;
|
bool getFrontEndPropertyComputeDispatchAllWalkerSupport() const override;
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ 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() 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);
|
||||||
|
|||||||
@@ -655,6 +655,9 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Drm::setNewResourceBoundToVM(uint32_t vmHandleId) {
|
void Drm::setNewResourceBoundToVM(uint32_t vmHandleId) {
|
||||||
|
if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
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)) {
|
if (engine.osContext->getDeviceBitfield().test(vmHandleId)) {
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ std::pair<bool, bool> ProductHelperHw<gfxProduct>::isPipeControlPriorToNonPipeli
|
|||||||
return {isBasicWARequired, isExtendedWARequired};
|
return {isBasicWARequired, isExtendedWARequired};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -607,9 +607,12 @@ 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>();
|
||||||
EXPECT_TRUE(pipeControl->getTlbInvalidate());
|
if (executionEnvironment.rootDeviceEnvironments[0]->getProductHelper().isTlbFlushRequired()) {
|
||||||
EXPECT_TRUE(pipeControl->getTextureCacheInvalidationEnable());
|
auto *pipeControl = hwParse.getCommand<PIPE_CONTROL>();
|
||||||
EXPECT_FALSE(osContext->isTlbFlushRequired());
|
EXPECT_TRUE(pipeControl->getTlbInvalidate());
|
||||||
|
} else {
|
||||||
|
EXPECT_EQ(pipeControl, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
EXPECT_EQ(directSubmission.getSizeNewResourceHandler(), sizeof(PIPE_CONTROL));
|
EXPECT_EQ(directSubmission.getSizeNewResourceHandler(), sizeof(PIPE_CONTROL));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoun
|
|||||||
|
|
||||||
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)) {
|
if (osContexLinux->getDeviceBitfield().test(1u) && executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]->getProductHelper().isTlbFlushRequired()) {
|
||||||
EXPECT_TRUE(osContexLinux->isTlbFlushRequired());
|
EXPECT_TRUE(osContexLinux->isTlbFlushRequired());
|
||||||
} else {
|
} else {
|
||||||
EXPECT_FALSE(osContexLinux->isTlbFlushRequired());
|
EXPECT_FALSE(osContexLinux->isTlbFlushRequired());
|
||||||
@@ -141,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)) {
|
if (osContexLinux->getDeviceBitfield().test(0u) && executionEnvironment->rootDeviceEnvironments[1]->getProductHelper().isTlbFlushRequired()) {
|
||||||
EXPECT_TRUE(osContexLinux->isTlbFlushRequired());
|
EXPECT_TRUE(osContexLinux->isTlbFlushRequired());
|
||||||
} else {
|
} else {
|
||||||
EXPECT_FALSE(osContexLinux->isTlbFlushRequired());
|
EXPECT_FALSE(osContexLinux->isTlbFlushRequired());
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ 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_FALSE(productHelper->isTlbFlushRequired());
|
||||||
|
}
|
||||||
|
|
||||||
PVCTEST_F(PvcProductHelper, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) {
|
PVCTEST_F(PvcProductHelper, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) {
|
||||||
auto hwInfo = *defaultHwInfo;
|
auto hwInfo = *defaultHwInfo;
|
||||||
hwInfo.platform.usRevId = 3;
|
hwInfo.platform.usRevId = 3;
|
||||||
|
|||||||
Reference in New Issue
Block a user