Remove fallback path for PAT index programming
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
parent
e0a0868bff
commit
fad7f10b7b
|
@ -1456,12 +1456,6 @@ HWTEST_F(HwHelperTest, GivenHwInfoWhenGetBatchBufferEndReferenceCalledThenCorrec
|
|||
EXPECT_EQ(hwHelper.getBatchBufferEndReference(), reinterpret_cast<const void *>(&FamilyType::cmdInitBatchBufferEnd));
|
||||
}
|
||||
|
||||
HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForPatIndexWaThenReturnFalse) {
|
||||
const auto &hwHelper = HwHelper::get(renderCoreFamily);
|
||||
|
||||
EXPECT_FALSE(hwHelper.isPatIndexFallbackWaRequired());
|
||||
}
|
||||
|
||||
HWTEST_F(HwHelperTest, givenHwHelperWhenPassingCopyEngineTypeThenItsCopyOnly) {
|
||||
EXPECT_TRUE(EngineHelper::isCopyOnlyEngineType(EngineGroupType::Copy));
|
||||
}
|
||||
|
|
|
@ -52,4 +52,3 @@ HWTEST_EXCLUDE_PRODUCT(CommandStreamReceiverFlushTaskTests, givenOverrideThreadA
|
|||
HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterAubCommandStreamReceiverWithoutFixtureTests, GivenCopyHostPtrAndHostNoAccessAndReadOnlyFlagsWhenAllocatingBufferThenAllocationIsCopiedToEveryTile, IGFX_XE_HPC_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet, IGFX_XE_HPC_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet, IGFX_XE_HPC_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwHelperTest, givenHwHelperWhenAskingForPatIndexWaThenReturnFalse, IGFX_XE_HPC_CORE);
|
||||
|
|
|
@ -826,9 +826,3 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenCommandBufferAllocationWhenSetExt
|
|||
XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIpVersion) {
|
||||
EXPECT_EQ(ClHwHelperMock::makeDeviceIpVersion(12, 8, 1), ClHwHelper::get(renderCoreFamily).getDeviceIpVersion(*defaultHwInfo));
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenHwHelperWhenAskingForPatIndexWaThenReturnTrue) {
|
||||
const auto &hwHelper = HwHelper::get(renderCoreFamily);
|
||||
|
||||
EXPECT_TRUE(hwHelper.isPatIndexFallbackWaRequired());
|
||||
}
|
||||
|
|
|
@ -157,7 +157,6 @@ class HwHelper {
|
|||
virtual size_t getBatchBufferEndSize() const = 0;
|
||||
virtual const void *getBatchBufferEndReference() const = 0;
|
||||
virtual bool isPlatformFlushTaskEnabled(const NEO::HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isPatIndexFallbackWaRequired() const = 0;
|
||||
virtual uint32_t getMinimalScratchSpaceSize() const = 0;
|
||||
virtual bool copyThroughLockedPtrEnabled() const = 0;
|
||||
virtual uint32_t getAmountOfAllocationsToFill() const = 0;
|
||||
|
@ -402,7 +401,6 @@ class HwHelperHw : public HwHelper {
|
|||
size_t getBatchBufferEndSize() const override;
|
||||
const void *getBatchBufferEndReference() const override;
|
||||
bool isPlatformFlushTaskEnabled(const NEO::HardwareInfo &hwInfo) const override;
|
||||
bool isPatIndexFallbackWaRequired() const override;
|
||||
uint32_t getMinimalScratchSpaceSize() const override;
|
||||
bool copyThroughLockedPtrEnabled() const override;
|
||||
uint32_t getAmountOfAllocationsToFill() const override;
|
||||
|
|
|
@ -713,11 +713,6 @@ uint64_t HwHelperHw<GfxFamily>::getPatIndex(CacheRegion cacheRegion, CachePolicy
|
|||
return -1;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::isPatIndexFallbackWaRequired() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename gfxProduct>
|
||||
bool HwHelperHw<gfxProduct>::copyThroughLockedPtrEnabled() const {
|
||||
if (DebugManager.flags.ExperimentalCopyThroughLock.get() != -1) {
|
||||
|
|
|
@ -1325,11 +1325,13 @@ uint64_t Drm::getPatIndex(Gmm *gmm, AllocationType allocationType, CacheRegion c
|
|||
|
||||
uint64_t patIndex = rootDeviceEnvironment.getGmmClientContext()->cachePolicyGetPATIndex(resourceInfo, usageType, compressed, cachable);
|
||||
|
||||
UNRECOVERABLE_IF(patIndex == static_cast<uint64_t>(GMM_PAT_ERROR));
|
||||
|
||||
if (DebugManager.flags.ClosEnabled.get() != -1) {
|
||||
closEnabled = !!DebugManager.flags.ClosEnabled.get();
|
||||
}
|
||||
|
||||
if (patIndex == static_cast<uint64_t>(GMM_PAT_ERROR) || closEnabled || hwHelper.isPatIndexFallbackWaRequired()) {
|
||||
if (closEnabled) {
|
||||
patIndex = hwHelper.getPatIndex(cacheRegion, cachePolicy);
|
||||
}
|
||||
|
||||
|
|
|
@ -437,11 +437,6 @@ uint64_t HwHelperHw<Family>::getPatIndex(CacheRegion cacheRegion, CachePolicy ca
|
|||
return (static_cast<uint32_t>(cachePolicy) + (static_cast<uint16_t>(cacheRegion) * 2));
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwHelperHw<Family>::isPatIndexFallbackWaRequired() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwHelperHw<Family>::copyThroughLockedPtrEnabled() const {
|
||||
if (DebugManager.flags.ExperimentalCopyThroughLock.get() != -1) {
|
||||
|
|
|
@ -833,9 +833,6 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexProgrammingEnabledWhen
|
|||
|
||||
if (debugFlag == 0 || !closSupported || debugFlag == -1) {
|
||||
auto expectedIndex = static_cast<uint64_t>(MockGmmClientContextBase::MockPatIndex::cached);
|
||||
if (hwHelper.isPatIndexFallbackWaRequired()) {
|
||||
expectedIndex = hwHelper.getPatIndex(CacheRegion::Default, CachePolicy::WriteBack);
|
||||
}
|
||||
|
||||
EXPECT_EQ(expectedIndex, mock->context.receivedVmBindPatIndex.value());
|
||||
|
||||
|
@ -850,89 +847,29 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexProgrammingEnabledWhen
|
|||
}
|
||||
}
|
||||
|
||||
HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexErrorWhenVmBindCalledThenSetDefaultPatIndexExtension) {
|
||||
DebugManager.flags.UseVmBind.set(1);
|
||||
mock->bindAvailable = true;
|
||||
|
||||
auto csr = std::make_unique<UltCommandStreamReceiver<FamilyType>>(*executionEnvironment, 0, DeviceBitfield(1));
|
||||
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor());
|
||||
csr->setupContext(*osContext);
|
||||
|
||||
auto &hwHelper = HwHelper::get(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eRenderCoreFamily);
|
||||
auto hwInfoConfig = HwInfoConfig::get(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eProductFamily);
|
||||
|
||||
bool closSupported = (hwHelper.getNumCacheRegions() > 0);
|
||||
bool patIndexProgrammingSupported = hwInfoConfig->isVmBindPatIndexProgrammingSupported();
|
||||
|
||||
if (!closSupported || !patIndexProgrammingSupported) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
uint64_t gpuAddress = 0x123000;
|
||||
size_t size = 1;
|
||||
BufferObject bo(mock, static_cast<uint64_t>(MockGmmClientContextBase::MockPatIndex::cached), 0, 1, 1);
|
||||
DrmAllocation allocation(0, 1, AllocationType::BUFFER, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages);
|
||||
|
||||
auto allocationPtr = static_cast<GraphicsAllocation *>(&allocation);
|
||||
|
||||
static_cast<MockGmmClientContextBase *>(executionEnvironment->rootDeviceEnvironments[0]->getGmmClientContext())->returnErrorOnPatIndexQuery = true;
|
||||
|
||||
for (int32_t debugFlag : {-1, 0, 1}) {
|
||||
DebugManager.flags.ClosEnabled.set(debugFlag);
|
||||
|
||||
mock->context.receivedVmBindPatIndex.reset();
|
||||
mock->context.receivedVmUnbindPatIndex.reset();
|
||||
|
||||
bo.setPatIndex(mock->getPatIndex(allocation.getDefaultGmm(), allocation.getAllocationType(), CacheRegion::Default, CachePolicy::WriteBack, false));
|
||||
|
||||
operationHandler->makeResident(device, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1));
|
||||
|
||||
EXPECT_EQ(3u, mock->context.receivedVmBindPatIndex.value());
|
||||
|
||||
operationHandler->evict(device, allocation);
|
||||
EXPECT_EQ(3u, mock->context.receivedVmUnbindPatIndex.value());
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexErrorAndUncachedDebugFlagSetWhenVmBindCalledThenSetDefaultPatIndexExtension) {
|
||||
HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexErrorAndUncachedDebugFlagSetWhenGetPatIndexCalledThenAbort) {
|
||||
DebugManager.flags.UseVmBind.set(1);
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(1);
|
||||
mock->bindAvailable = true;
|
||||
|
||||
auto csr = std::make_unique<UltCommandStreamReceiver<FamilyType>>(*executionEnvironment, 0, DeviceBitfield(1));
|
||||
auto osContext = memoryManager->createAndRegisterOsContext(csr.get(), EngineDescriptorHelper::getDefaultDescriptor());
|
||||
csr->setupContext(*osContext);
|
||||
|
||||
auto &hwHelper = HwHelper::get(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eRenderCoreFamily);
|
||||
auto hwInfoConfig = HwInfoConfig::get(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eProductFamily);
|
||||
|
||||
bool closSupported = (hwHelper.getNumCacheRegions() > 0);
|
||||
bool patIndexProgrammingSupported = hwInfoConfig->isVmBindPatIndexProgrammingSupported();
|
||||
|
||||
if (!closSupported || !patIndexProgrammingSupported) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
static_cast<MockGmmClientContextBase *>(executionEnvironment->rootDeviceEnvironments[0]->getGmmClientContext())->returnErrorOnPatIndexQuery = true;
|
||||
|
||||
mock->context.receivedVmBindPatIndex.reset();
|
||||
mock->context.receivedVmUnbindPatIndex.reset();
|
||||
|
||||
uint64_t gpuAddress = 0x123000;
|
||||
size_t size = 1;
|
||||
BufferObject bo(mock, static_cast<uint64_t>(MockGmmClientContextBase::MockPatIndex::cached), 0, 1, 1);
|
||||
DrmAllocation allocation(0, 1, AllocationType::BUFFER, &bo, nullptr, gpuAddress, size, MemoryPool::System4KBPages);
|
||||
|
||||
bo.setPatIndex(mock->getPatIndex(allocation.getDefaultGmm(), allocation.getAllocationType(), CacheRegion::Default, CachePolicy::WriteBack, false));
|
||||
|
||||
auto allocationPtr = static_cast<GraphicsAllocation *>(&allocation);
|
||||
|
||||
operationHandler->makeResident(device, ArrayRef<GraphicsAllocation *>(&allocationPtr, 1));
|
||||
|
||||
EXPECT_EQ(0u, mock->context.receivedVmBindPatIndex.value());
|
||||
|
||||
operationHandler->evict(device, allocation);
|
||||
EXPECT_EQ(0u, mock->context.receivedVmUnbindPatIndex.value());
|
||||
EXPECT_ANY_THROW(mock->getPatIndex(allocation.getDefaultGmm(), allocation.getAllocationType(), CacheRegion::Default, CachePolicy::WriteBack, false));
|
||||
}
|
||||
|
||||
HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenUncachedDebugFlagSetWhenVmBindCalledThenSetCorrectPatIndexExtension) {
|
||||
|
@ -946,7 +883,6 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenUncachedDebugFlagSetWhenVmBind
|
|||
|
||||
auto timestampStorageAlloc = csr->getTimestampPacketAllocator()->getTag()->getBaseGraphicsAllocation()->getDefaultGraphicsAllocation();
|
||||
|
||||
auto &hwHelper = HwHelper::get(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eRenderCoreFamily);
|
||||
auto hwInfoConfig = HwInfoConfig::get(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eProductFamily);
|
||||
|
||||
if (!hwInfoConfig->isVmBindPatIndexProgrammingSupported()) {
|
||||
|
@ -959,9 +895,6 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenUncachedDebugFlagSetWhenVmBind
|
|||
operationHandler->makeResident(device, ArrayRef<GraphicsAllocation *>(×tampStorageAlloc, 1));
|
||||
|
||||
auto expectedIndex = static_cast<uint64_t>(MockGmmClientContextBase::MockPatIndex::uncached);
|
||||
if (hwHelper.isPatIndexFallbackWaRequired()) {
|
||||
expectedIndex = hwHelper.getPatIndex(CacheRegion::Default, CachePolicy::Uncached);
|
||||
}
|
||||
|
||||
EXPECT_EQ(expectedIndex, mock->context.receivedVmBindPatIndex.value());
|
||||
|
||||
|
|
Loading…
Reference in New Issue