Set PAT programming support during VmBind support query

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-05-04 13:59:12 +00:00
committed by Compute-Runtime-Automation
parent 2b55ca76b8
commit 4f7a225baf
5 changed files with 22 additions and 6 deletions

View File

@ -4444,6 +4444,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsNotSetThenReturnFa
TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThenReturnTrue) {
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
drm.queryAndSetVmBindPatIndexProgrammingSupport();
drm.cacheInfo.reset(new MockCacheInfo(drm, 32 * MemoryConstants::kiloByte, 2, 32));
MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory);
@ -4458,6 +4459,7 @@ TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThe
TEST_F(DrmAllocationTests, givenDrmAllocationWhenCacheRegionIsSetSuccessfullyThenSetRegionInBufferObject) {
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
drm.queryAndSetVmBindPatIndexProgrammingSupport();
drm.cacheInfo.reset(new MockCacheInfo(drm, 32 * MemoryConstants::kiloByte, 2, 32));
MockBufferObject bo(&drm, 3, 0, 0, 1);
@ -5479,7 +5481,11 @@ TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, givenPatIndex
auto drmAllocation = static_cast<DrmAllocation *>(allocation);
ASSERT_NE(nullptr, drmAllocation->getBO());
if (HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->isVmBindPatIndexProgrammingSupported()) {
auto isVmBindPatIndexProgrammingSupported = HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->isVmBindPatIndexProgrammingSupported();
EXPECT_EQ(isVmBindPatIndexProgrammingSupported, mock->isVmBindPatIndexProgrammingSupported());
if (isVmBindPatIndexProgrammingSupported) {
auto expectedIndex = mock->getPatIndex(allocation->getDefaultGmm(), allocation->getAllocationType(), CacheRegion::Default, CachePolicy::WriteBack, false);
EXPECT_NE(CommonConstants::unsupportedPatIndex, drmAllocation->getBO()->peekPatIndex());