fix: don't create page table manager in Drm path

Page table manager is needed only for gen12 and xe-lpg
when compression is enabled. However, above platforms have
compression disabled in drm path

Related-To: NEO-11080
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-10-22 10:36:34 +00:00
committed by Compute-Runtime-Automation
parent 19eb4e50a1
commit ff200e94ab
7 changed files with 2 additions and 70 deletions

View File

@@ -85,10 +85,6 @@ uint8_t GmmClientContext::getMediaSurfaceStateCompressionFormat(GMM_RESOURCE_FOR
return clientContext->GetMediaSurfaceStateCompressionFormat(format);
}
void GmmClientContext::setGmmDeviceInfo(GMM_DEVICE_INFO *deviceInfo) {
clientContext->GmmSetDeviceInfo(deviceInfo);
}
uint32_t GmmClientContext::cachePolicyGetPATIndex(GMM_RESOURCE_INFO *gmmResourceInfo, GMM_RESOURCE_USAGE_TYPE usage, bool compressed, bool cacheable) {
bool outValue = compressed;
uint32_t patIndex = clientContext->CachePolicyGetPATIndex(gmmResourceInfo, usage, &outValue, cacheable);

View File

@@ -47,8 +47,6 @@ class GmmClientContext {
void setHandleAllocator(std::unique_ptr<GmmHandleAllocator> allocator);
MOCKABLE_VIRTUAL void setGmmDeviceInfo(GMM_DEVICE_INFO *deviceInfo);
GmmHandleAllocator *getHandleAllocator() {
return handleAllocator.get();
}

View File

@@ -51,7 +51,6 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily> {
bool isKmdWaitOnTaskCountAllowed() const override;
DrmMemoryManager *getMemoryManager() const;
GmmPageTableMngr *createPageTableManager() override;
SubmissionStatus printBOsForSubmit(ResidencyContainer &allocationsForResidency, GraphicsAllocation &cmdBufferAllocation);

View File

@@ -289,23 +289,6 @@ DrmMemoryManager *DrmCommandStreamReceiver<GfxFamily>::getMemoryManager() const
return static_cast<DrmMemoryManager *>(CommandStreamReceiver::getMemoryManager());
}
template <typename GfxFamily>
GmmPageTableMngr *DrmCommandStreamReceiver<GfxFamily>::createPageTableManager() {
auto rootDeviceEnvironment = this->executionEnvironment.rootDeviceEnvironments[this->rootDeviceIndex].get();
auto gmmClientContext = rootDeviceEnvironment->getGmmClientContext();
GMM_DEVICE_INFO deviceInfo{};
GMM_DEVICE_CALLBACKS_INT deviceCallbacks{};
deviceInfo.pDeviceCb = &deviceCallbacks;
gmmClientContext->setGmmDeviceInfo(&deviceInfo);
auto gmmPageTableMngr = GmmPageTableMngr::create(gmmClientContext, TT_TYPE::AUXTT, nullptr);
this->pageTableManager.reset(gmmPageTableMngr);
return gmmPageTableMngr;
}
template <typename GfxFamily>
bool DrmCommandStreamReceiver<GfxFamily>::waitForFlushStamp(FlushStamp &flushStamp) {
auto waitValue = static_cast<uint32_t>(flushStamp);

View File

@@ -34,12 +34,6 @@ uint8_t MockGmmClientContextBase::getMediaSurfaceStateCompressionFormat(GMM_RESO
return compressionFormatToReturn;
}
void MockGmmClientContextBase::setGmmDeviceInfo(GMM_DEVICE_INFO *deviceInfo) {
EXPECT_NE(deviceInfo, nullptr);
GMM_DEVICE_CALLBACKS_INT emptyStruct{};
EXPECT_EQ(0, memcmp(deviceInfo->pDeviceCb, &emptyStruct, sizeof(GMM_DEVICE_CALLBACKS_INT)));
}
uint64_t MockGmmClientContextBase::freeGpuVirtualAddress(FreeGpuVirtualAddressGmm *pFreeGpuVa) {
freeGpuVirtualAddressCalled++;
return 0;

View File

@@ -27,7 +27,6 @@ class MockGmmClientContextBase : public GmmClientContext {
long deallocate2(DeallocateGmm *deallocateGmm) override;
uint8_t getSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT format) override;
uint8_t getMediaSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT format) override;
void setGmmDeviceInfo(GMM_DEVICE_INFO *deviceInfo) override;
uint64_t mapGpuVirtualAddress(MapGpuVirtualAddressGmm *pMapGpuVa) override;
uint64_t freeGpuVirtualAddress(FreeGpuVirtualAddressGmm *pMapGpuVa) override;

View File

@@ -1071,15 +1071,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBlitterDirectSubmissionTest, givenEnabledDire
EXPECT_EQ(nullptr, static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->directSubmission.get());
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreatePageTableManagerIsCalledThenCreatePageTableManager) {
executionEnvironment.prepareRootDeviceEnvironments(2);
executionEnvironment.rootDeviceEnvironments[1]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[1]->initGmm();
executionEnvironment.rootDeviceEnvironments[1]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[1]->osInterface->setDriverModel(DrmMockCustom::create(*executionEnvironment.rootDeviceEnvironments[0]));
auto csr = std::make_unique<MockDrmCsr<FamilyType>>(executionEnvironment, 1, 1);
auto pageTableManager = csr->createPageTableManager();
EXPECT_EQ(csr->pageTableManager.get(), pageTableManager);
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreatePageTableManagerIsCalledThenNullptrIsReturned) {
EXPECT_EQ(nullptr, csr->createPageTableManager());
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenLocalMemoryEnabledWhenCreatingDrmCsrThenEnableBatching) {
@@ -1108,36 +1101,6 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenLocalMemoryEnabledWhenCreatingDrmC
}
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenPageTableManagerAndMapTrueWhenUpdateAuxTableIsCalledThenItReturnsTrue) {
auto mockMngr = new MockGmmPageTableMngr();
csr->pageTableManager.reset(mockMngr);
executionEnvironment.rootDeviceEnvironments[0]->initGmm();
auto gmm = std::make_unique<MockGmm>(executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper());
auto result = csr->pageTableManager->updateAuxTable(0, gmm.get(), true);
EXPECT_EQ(0ull, mockMngr->updateAuxTableParamsPassed[0].ddiUpdateAuxTable.BaseGpuVA);
EXPECT_EQ(gmm->gmmResourceInfo->peekHandle(), mockMngr->updateAuxTableParamsPassed[0].ddiUpdateAuxTable.BaseResInfo);
EXPECT_EQ(true, mockMngr->updateAuxTableParamsPassed[0].ddiUpdateAuxTable.DoNotWait);
EXPECT_EQ(1u, mockMngr->updateAuxTableParamsPassed[0].ddiUpdateAuxTable.Map);
EXPECT_TRUE(result);
EXPECT_EQ(1u, mockMngr->updateAuxTableCalled);
}
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenPageTableManagerAndMapFalseWhenUpdateAuxTableIsCalledThenItReturnsTrue) {
auto mockMngr = new MockGmmPageTableMngr();
csr->pageTableManager.reset(mockMngr);
executionEnvironment.rootDeviceEnvironments[0]->initGmm();
auto gmm = std::make_unique<MockGmm>(executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper());
auto result = csr->pageTableManager->updateAuxTable(0, gmm.get(), false);
EXPECT_EQ(0ull, mockMngr->updateAuxTableParamsPassed[0].ddiUpdateAuxTable.BaseGpuVA);
EXPECT_EQ(gmm->gmmResourceInfo->peekHandle(), mockMngr->updateAuxTableParamsPassed[0].ddiUpdateAuxTable.BaseResInfo);
EXPECT_EQ(true, mockMngr->updateAuxTableParamsPassed[0].ddiUpdateAuxTable.DoNotWait);
EXPECT_EQ(0u, mockMngr->updateAuxTableParamsPassed[0].ddiUpdateAuxTable.Map);
EXPECT_TRUE(result);
EXPECT_EQ(1u, mockMngr->updateAuxTableCalled);
}
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenPrintBOsForSubmitWhenPrintThenProperValuesArePrinted) {
DebugManagerStateRestore restorer;
debugManager.flags.PrintBOsForSubmit.set(true);