IMG_VOID PVRDPFInit(IMG_VOID)
{
	LinuxInitMutex(&gsDebugMutexNonIRQ);
#if defined(PVRSRV_DEBUG_CCB_MAX) && defined(PVRSRV_NEED_PVR_DPF)
	LinuxInitMutex(&gsDebugCCBMutex);
#endif
}
IMG_VOID PVRDPFInit(IMG_VOID)
{
#if !defined(PVR_DEBUG_ALWAYS_USE_SPINLOCK)
	LinuxInitMutex(&gsDebugMutexNonIRQ);
#endif
#if defined(PVRSRV_DEBUG_CCB_MAX)
	LinuxInitMutex(&gsDebugCCBMutex);
#endif
}
/*!
******************************************************************************

 @Function	PVRSRVTimeTraceInit

 @Description

 Initialise the timed trace subsystem.

 @Return Error

******************************************************************************/
PVRSRV_ERROR PVRSRVTimeTraceInit(IMG_VOID)
{
    LinuxInitMutex(&g_sTTraceMutex);

	g_psBufferTable = HASH_Create(TIME_TRACE_HASH_TABLE_SIZE);

	/* Create hash table to store the per process buffers in */
	if (!g_psBufferTable)
	{
		PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceInit: Error creating hash table"));
		return PVRSRV_ERROR_OUT_OF_MEMORY;
	}

	/* Create the kernel buffer */
	_PVRSRVTimeTraceBufferCreate(KERNEL_ID);

	g_psTimer = OSFuncHighResTimerCreate();

	if (!g_psTimer)
	{
		PVR_DPF((PVR_DBG_ERROR, "PVRSRVTimeTraceInit: Error creating timer"));
		return PVRSRV_ERROR_INIT_FAILURE;
	}
	return PVRSRV_OK;
}
Example #4
0
static int __init PVRCore_Init(void)
{
	int error;

	PVR_TRACE("PVRCore_Init");

	AssignedMajorNumber = register_chrdev(0, DEVNAME, &pvrsrv_fops);

	if (AssignedMajorNumber <= 0) {
		PVR_DPF(PVR_DBG_ERROR,
			 "PVRCore_Init: unable to get major number");

		return -EBUSY;
	}

	PVR_TRACE("PVRCore_Init: major device %d", AssignedMajorNumber);

	if (CreateProcEntries()) {
		unregister_chrdev(AssignedMajorNumber, DRVNAME);

		return -ENOMEM;
	}

	LinuxInitMutex(&gPVRSRVLock);

#ifdef DEBUG
	PVRDebugSetLevel(debug);
#endif

	if (LinuxMMInit() != PVRSRV_OK) {
		error = -ENOMEM;
		goto init_failed;
	}

	LinuxBridgeInit();

	PVRMMapInit();

	error = platform_driver_register(&powervr_driver);
	if (error != 0) {
		PVR_DPF(PVR_DBG_ERROR, "PVRCore_Init: "
			"unable to register platform driver (%d)", error);

		goto init_failed;
	}

	powervr_device.dev.devt = MKDEV(AssignedMajorNumber, 0);

	error = platform_device_register(&powervr_device);
	if (error != 0) {
		platform_driver_unregister(&powervr_driver);

		PVR_DPF(PVR_DBG_ERROR, "PVRCore_Init: "
			"unable to register platform device (%d)", error);

		goto init_failed;
	}


	return 0;

init_failed:

	PVRMMapCleanup();
	LinuxMMCleanup();
	RemoveProcEntries();
	unregister_chrdev(AssignedMajorNumber, DRVNAME);

	return error;

}
Example #5
0
IMG_VOID PVRDPFInit(IMG_VOID)
{
    LinuxInitMutex(&gsDebugMutexNonIRQ);
}
Example #6
0
/*!
 *******************************************************************************

 @Function  PVRMMapInit

 @Description

 MMap initialisation code

 ******************************************************************************/
IMG_VOID
PVRMMapInit(IMG_VOID)
{
    LinuxInitMutex(&g_sMMapMutex);
    return;
}