Disable tlb flush WA on PVC and later

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2022-06-22 12:07:13 +00:00
committed by Compute-Runtime-Automation
parent b1a9fb886f
commit e0c87435e1
6 changed files with 33 additions and 6 deletions

View File

@@ -106,6 +106,7 @@ class HwHelper {
virtual bool isBankOverrideRequired(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getGlobalTimeStampBits() const = 0;
virtual int32_t getDefaultThreadArbitrationPolicy() const = 0;
virtual bool isFlushTlbWARequired() const = 0;
virtual bool useOnlyGlobalTimestamps() const = 0;
virtual bool useSystemMemoryPlacementForISA(const HardwareInfo &hwInfo) const = 0;
virtual bool packedFormatsSupported() const = 0;
@@ -255,6 +256,8 @@ class HwHelperHw : public HwHelper {
bool is1MbAlignmentSupported(const HardwareInfo &hwInfo, bool isCompressionEnabled) const override;
bool isFlushTlbWARequired() const override;
bool isFenceAllocationRequired(const HardwareInfo &hwInfo) const override;
void setRenderSurfaceStateForScratchResource(const RootDeviceEnvironment &rootDeviceEnvironment,

View File

@@ -521,6 +521,11 @@ size_t HwHelperHw<GfxFamily>::getSingleTimestampPacketSize() const {
return HwHelperHw<GfxFamily>::getSingleTimestampPacketSizeHw();
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isFlushTlbWARequired() const {
return true;
}
template <typename GfxFamily>
size_t HwHelperHw<GfxFamily>::getSingleTimestampPacketSizeHw() {
if (DebugManager.flags.OverrideTimestampPacketSize.get() != -1) {

View File

@@ -69,4 +69,9 @@ size_t HwHelperHw<Family>::getPaddingForISAAllocation() const {
return 0xE00;
}
template <>
bool HwHelperHw<Family>::isFlushTlbWARequired() const {
return false;
}
} // namespace NEO

View File

@@ -598,13 +598,18 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) {
}
void Drm::setNewResourceBoundToVM(uint32_t vmHandleId) {
const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines();
for (const auto &engine : engines) {
if (engine.osContext->getDeviceBitfield().test(vmHandleId)) {
auto osContextLinux = static_cast<OsContextLinux *>(engine.osContext);
auto hwInfo = this->rootDeviceEnvironment.getHardwareInfo();
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
if (&osContextLinux->getDrm() == this) {
osContextLinux->setNewResourceBound(true);
if (hwHelper.isFlushTlbWARequired()) {
const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines();
for (const auto &engine : engines) {
if (engine.osContext->getDeviceBitfield().test(vmHandleId)) {
auto osContextLinux = static_cast<OsContextLinux *>(engine.osContext);
if (&osContextLinux->getDrm() == this) {
osContextLinux->setNewResourceBound(true);
}
}
}
}

View File

@@ -103,6 +103,10 @@ struct DrmMemoryOperationsHandlerBindFixture : public ::testing::Test {
using DrmMemoryOperationsHandlerBindMultiRootDeviceTest = DrmMemoryOperationsHandlerBindFixture<2u>;
TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoundToVMThenAllContextsUsingThatVMHasSetNewResourceBound) {
if (!HwHelper::get(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eRenderCoreFamily).isFlushTlbWARequired()) {
GTEST_SKIP();
}
mock->setNewResourceBoundToVM(1u);
for (const auto &engine : device->getAllEngines()) {