本文整理汇总了C++中PVRSRV_DEVICE_NODE::pfnMMUAlloc方法的典型用法代码示例。如果您正苦于以下问题:C++ PVRSRV_DEVICE_NODE::pfnMMUAlloc方法的具体用法?C++ PVRSRV_DEVICE_NODE::pfnMMUAlloc怎么用?C++ PVRSRV_DEVICE_NODE::pfnMMUAlloc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PVRSRV_DEVICE_NODE
的用法示例。
在下文中一共展示了PVRSRV_DEVICE_NODE::pfnMMUAlloc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defined
static IMG_BOOL
DevMemoryAlloc (BM_CONTEXT *pBMContext,
BM_MAPPING *pMapping,
IMG_SIZE_T *pActualSize,
IMG_UINT32 uFlags,
IMG_UINT32 dev_vaddr_alignment,
IMG_DEV_VIRTADDR *pDevVAddr)
{
PVRSRV_DEVICE_NODE *psDeviceNode;
#ifdef PDUMP
IMG_UINT32 ui32PDumpSize = pMapping->uSize;
#endif
psDeviceNode = pBMContext->psDeviceNode;
if(uFlags & PVRSRV_MEM_INTERLEAVED)
{
pMapping->uSize *= 2;
}
#ifdef PDUMP
if(uFlags & PVRSRV_MEM_DUMMY)
{
ui32PDumpSize = pMapping->pBMHeap->sDevArena.ui32DataPageSize;
}
#endif
if (!psDeviceNode->pfnMMUAlloc (pMapping->pBMHeap->pMMUHeap,
pMapping->uSize,
pActualSize,
0,
dev_vaddr_alignment,
&(pMapping->DevVAddr)))
{
PVR_DPF((PVR_DBG_ERROR, "DevMemoryAlloc ERROR MMU_Alloc"));
return IMG_FALSE;
}
#ifdef SUPPORT_SGX_MMU_BYPASS
EnableHostAccess(pBMContext->psMMUContext);
#endif
#if defined(PDUMP)
PDUMPMALLOCPAGES(&psDeviceNode->sDevId,
pMapping->DevVAddr.uiAddr,
pMapping->CpuVAddr,
pMapping->hOSMemHandle,
ui32PDumpSize,
pMapping->pBMHeap->sDevArena.ui32DataPageSize,
#if defined(SUPPORT_PDUMP_MULTI_PROCESS)
psDeviceNode->pfnMMUIsHeapShared(pMapping->pBMHeap->pMMUHeap),
#else
IMG_FALSE,
#endif
(IMG_HANDLE)pMapping);
#endif
switch (pMapping->eCpuMemoryOrigin)
{
case hm_wrapped:
case hm_wrapped_virtaddr:
case hm_contiguous:
{
psDeviceNode->pfnMMUMapPages ( pMapping->pBMHeap->pMMUHeap,
pMapping->DevVAddr,
SysCpuPAddrToSysPAddr (pMapping->CpuPAddr),
pMapping->uSize,
uFlags,
(IMG_HANDLE)pMapping);
*pDevVAddr = pMapping->DevVAddr;
break;
}
case hm_env:
{
psDeviceNode->pfnMMUMapShadow ( pMapping->pBMHeap->pMMUHeap,
pMapping->DevVAddr,
pMapping->uSize,
pMapping->CpuVAddr,
pMapping->hOSMemHandle,
pDevVAddr,
uFlags,
(IMG_HANDLE)pMapping);
break;
}
case hm_wrapped_scatter:
case hm_wrapped_scatter_virtaddr:
{
psDeviceNode->pfnMMUMapScatter (pMapping->pBMHeap->pMMUHeap,
pMapping->DevVAddr,
pMapping->psSysAddr,
pMapping->uSize,
uFlags,
(IMG_HANDLE)pMapping);
*pDevVAddr = pMapping->DevVAddr;
//.........这里部分代码省略.........