@@ -37,7 +37,9 @@ OTHER DEALINGS IN THE SOFTWARE.
3737GmmLib::GmmClientContext::GmmClientContext (GMM_CLIENT ClientType)
3838 : ClientType(),
3939 pUmdAdapter(),
40- pGmmUmdContext()
40+ pGmmUmdContext(),
41+ DeviceCB(),
42+ IsDeviceCbReceived(0 )
4143{
4244 this ->ClientType = ClientType;
4345}
@@ -466,12 +468,29 @@ void GMM_STDCALL GmmLib::GmmClientContext::DestroyResInfoObject(GMM_RESOURCE_INF
466468 }
467469}
468470
471+ // ///////////////////////////////////////////////////////////////////////////////////
472+ // / Member function of ClientContext class for creation of PAgeTableMgr Object .
473+ // / @see GmmLib::GMM_PAGETABLE_MGR::GMM_PAGETABLE_MGR
474+ // /
475+ // / @param[in] TTFags
476+ // / @return Pointer to GMM_PAGETABLE_MGR class.
477+ // ///////////////////////////////////////////////////////////////////////////////////
478+ GMM_PAGETABLE_MGR* GMM_STDCALL GmmLib::GmmClientContext::CreatePageTblMgrObject (uint32_t TTFlags)
479+ {
480+ if (!IsDeviceCbReceived)
481+ {
482+ GMM_ASSERTDPF (0 , " Device_callbacks not set" );
483+ return NULL ;
484+ }
485+
486+ return CreatePageTblMgrObject (&DeviceCB, TTFlags);
487+ }
488+
469489// ///////////////////////////////////////////////////////////////////////////////////
470490// / Member function of ClientContext class for creation of PAgeTableMgr Object .
471491// / @see GmmLib::GMM_PAGETABLE_MGR::GMM_PAGETABLE_MGR
472492// /
473493// / @param[in] pDevCb: Pointer to GMM_DEVICE_CALLBACKS_INT
474- // / @param[in] pTTCB: Pointer to GMM_TRANSLATIONTABLE_CALLBACKS
475494// / @param[in] TTFags
476495// / @return Pointer to GMM_PAGETABLE_MGR class.
477496// TBD: move the code to new overloaded the API and remove this API once all clients are moved to new API.
@@ -603,12 +622,33 @@ void GMM_STDCALL GmmLib::GmmClientContext::DestroyResInfoObject(GMM_RESOURCE_INF
603622 }
604623}
605624#endif
625+
626+ // ///////////////////////////////////////////////////////////////////////////////////
627+ // / Member function of ClientContext class for creation of PAgeTableMgr Object .
628+ // / @see GmmLib::GMM_PAGETABLE_MGR::GMM_PAGETABLE_MGR
629+ // /
630+ // / @param[in] TTFags
631+ // / @return Pointer to GMM_PAGETABLE_MGR class.
632+ // ///////////////////////////////////////////////////////////////////////////////////
633+ GMM_PAGETABLE_MGR* GMM_STDCALL GmmLib::GmmClientContext::CreatePageTblMgrObject (uint32_t TTFlags,
634+ GmmClientAllocationCallbacks* pAllocCbs)
635+ {
636+ if (!IsDeviceCbReceived)
637+ {
638+ GMM_ASSERTDPF (0 , " Device_callbacks not set" );
639+ return NULL ;
640+ }
641+ return CreatePageTblMgrObject (
642+ &DeviceCB,
643+ TTFlags,
644+ pAllocCbs);
645+ }
646+
606647// ///////////////////////////////////////////////////////////////////////////////////
607648// / Member function of ClientContext class for creation of PAgeTableMgr Object .
608649// / @see GmmLib::GMM_PAGETABLE_MGR::GMM_PAGETABLE_MGR
609650// /
610651// / @param[in] pDevCb: Pointer to GMM_DEVICE_CALLBACKS_INT
611- // / @param[in] pTTCB: Pointer to GMM_TRANSLATIONTABLE_CALLBACKS
612652// / @param[in] TTFags
613653// / @return Pointer to GMM_PAGETABLE_MGR class.
614654// / TBD: move the code to new overloaded the API and remove this API once all clients are moved to new API.
@@ -646,6 +686,27 @@ void GMM_STDCALL GmmLib::GmmClientContext::DestroyPageTblMgrObject(GMM_PAGETABLE
646686 }
647687}
648688
689+ // //////////////////////////////////////////////////////////////////////////////////
690+ // / Member function of ClientContext class for doing device specific operations.
691+ // / Clients must call it before any Gfx resource (incl. svm)
692+ // / is mapped, must happen before any use of GfxPartition, or PageTableMgr init.
693+ // / @param[in] DeviceInfo : Pointer to info related to Device Operations.
694+ // / @return GMM_STATUS.
695+ // ////////////////////////////////////////////////////////////////////////////////////////
696+ GMM_STATUS GMM_STDCALL GmmLib::GmmClientContext::GmmSetDeviceInfo (GMM_DEVICE_INFO* DeviceInfo)
697+ {
698+ GMM_STATUS Status = GMM_SUCCESS;
699+
700+ if (DeviceInfo == NULL || DeviceInfo->pDeviceCb == NULL )
701+ {
702+ return GMM_INVALIDPARAM;
703+ }
704+
705+ DeviceCB = *(DeviceInfo->pDeviceCb );
706+ IsDeviceCbReceived = 1 ;
707+ return Status;
708+ }
709+
649710// ///////////////////////////////////////////////////////////////////////////////////
650711// / Gmm lib DLL exported C wrapper for creating GmmLib::GmmClientContext object
651712// / @see Class GmmLib::GmmClientContext
0 commit comments