Beispiel #1
0
static PVRSRV_ERROR BM_DestroyContext_AnyCb(BM_HEAP *psBMHeap)
{
	if(psBMHeap->ui32Attribs
	& 	(PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG
		|PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG))
	{
		if (psBMHeap->pImportArena)
		{
			IMG_BOOL bTestDelete = RA_TestDelete(psBMHeap->pImportArena);
			if (!bTestDelete)
			{
				PVR_DPF ((PVR_DBG_ERROR, "BM_DestroyContext_AnyCb: RA_TestDelete failed"));
				return PVRSRV_ERROR_UNABLE_TO_DESTROY_BM_HEAP;
			}
		}
	}
	return PVRSRV_OK;
}
void BM_DestroyContext(void *hBMContext)
{
	struct BM_CONTEXT *pBMContext = (struct BM_CONTEXT *)hBMContext;
	struct BM_HEAP *psBMHeap;

	PVR_DPF(PVR_DBG_MESSAGE, "BM_DestroyContext");

	for (psBMHeap = pBMContext->psBMHeap;
	     psBMHeap != NULL; psBMHeap = psBMHeap->psNext)
		if (psBMHeap->ui32Attribs &
		    (PVRSRV_BACKINGSTORE_SYSMEM_NONCONTIG |
		      PVRSRV_BACKINGSTORE_LOCALMEM_CONTIG))
			if (psBMHeap->pImportArena) {
				IMG_BOOL bTestDelete =
				    RA_TestDelete(psBMHeap->pImportArena);
				BUG_ON(!bTestDelete);
			}

	ResManFreeResByPtr(pBMContext->hResItem);
}