Esempio n. 1
0
/*!
******************************************************************************

 @Function	PVRSRVTimeTraceDeinit

 @Description

  De-initialise the timed trace subsystem.

 @Return Error

******************************************************************************/
IMG_VOID PVRSRVTimeTraceDeinit(IMG_VOID)
{
	PVRSRVTimeTraceBufferDestroy(KERNEL_ID);
	/* Free any buffers the where created at alloc item time */
	HASH_Iterate(g_psBufferTable, _PVRSRVTimeTraceBufferDestroy);
	HASH_Delete(g_psBufferTable);
	OSFuncHighResTimerDestroy(g_psTimer);
}
Esempio n. 2
0
static PVRSRV_ERROR _PVRSRVTimeTraceBufferDestroy(IMG_UINTPTR_T hKey, IMG_UINTPTR_T hData)
{
	PVR_UNREFERENCED_PARAMETER(hData);
	PVR_DPF((PVR_DBG_MESSAGE, "_PVRSRVTimeTraceBufferDestroy: Destroying buffer for PID %u", (IMG_UINT32) hKey));

	PVRSRVTimeTraceBufferDestroy(hKey);
	return PVRSRV_OK;
}
Esempio n. 3
0
/*!
******************************************************************************

 @Function	PVRSRVPerProcessDataDisconnect

 @Description	Decrement refcount for per-process data area,
 				and free the resources if necessary.

 @Input		ui32PID - process ID

 @Return	IMG_VOID

******************************************************************************/
IMG_VOID PVRSRVPerProcessDataDisconnect(IMG_UINT32	ui32PID)
{
	PVRSRV_ERROR eError;
	PVRSRV_PER_PROCESS_DATA *psPerProc;

	PVR_ASSERT(psHashTab != IMG_NULL);

	psPerProc = (PVRSRV_PER_PROCESS_DATA *)HASH_Retrieve(psHashTab, (IMG_UINTPTR_T)ui32PID);
	if (psPerProc == IMG_NULL)
	{
		PVR_DPF((PVR_DBG_ERROR, "PVRSRVPerProcessDataDealloc: Couldn't locate per-process data for PID %u", ui32PID));
	}
	else
	{
		psPerProc->ui32RefCount--;
		if (psPerProc->ui32RefCount == 0)
		{
			PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVPerProcessDataDisconnect: "
					"Last close from process 0x%x received", ui32PID));

			/* Close the Resource Manager connection */
			PVRSRVResManDisconnect(psPerProc->hResManContext, IMG_FALSE);

#if defined (TTRACE)
			PVRSRVTimeTraceBufferDestroy(ui32PID);
#endif

			/* Free the per-process data */
			eError = FreePerProcessData(psPerProc);
			if (eError != PVRSRV_OK)
			{
				PVR_DPF((PVR_DBG_ERROR, "PVRSRVPerProcessDataDisconnect: Error freeing per-process data"));
			}
		}
	}

	eError = PVRSRVPurgeHandles(KERNEL_HANDLE_BASE);
	if (eError != PVRSRV_OK)
	{
		PVR_DPF((PVR_DBG_ERROR, "PVRSRVPerProcessDataDisconnect: Purge of global handle pool failed (%d)", eError));
	}
}