Exemple #1
0
IMG_VOID RGXCheckFaultAddress(PVRSRV_RGXDEV_INFO *psDevInfo, IMG_DEV_VIRTADDR *psDevVAddr, IMG_DEV_PHYADDR *psDevPAddr)
{
	RGX_FAULT_DATA sFaultData;
	IMG_DEV_PHYADDR sPCDevPAddr;

	sFaultData.psDevVAddr = psDevVAddr;
	sFaultData.psDevPAddr = psDevPAddr;

	OSWRLockAcquireRead(psDevInfo->hMemoryCtxListLock);

	dllist_foreach_node(&psDevInfo->sMemoryContextList,
						_RGXCheckFaultAddress,
						&sFaultData);

	/* Lastly check for fault in the kernel allocated memory */
	if (MMU_AcquireBaseAddr(psDevInfo->psKernelMMUCtx, &sPCDevPAddr) != PVRSRV_OK)
	{
		PVR_LOG(("Failed to get PC address for kernel memory context"));
	}

	if (sFaultData.psDevPAddr->uiAddr == sPCDevPAddr.uiAddr)
	{
		MMU_CheckFaultAddress(psDevInfo->psKernelMMUCtx, psDevVAddr);
	}

	OSWRLockReleaseRead(psDevInfo->hMemoryCtxListLock);
}
IMG_VOID CheckForStalledComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
									DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf)
{
	OSWRLockAcquireRead(psDevInfo->hComputeCtxListLock, DEVINFO_COMPUTELIST);
	dllist_foreach_node(&(psDevInfo->sComputeCtxtListHead),
						CheckForStalledComputeCtxtCommand, pfnDumpDebugPrintf);
	OSWRLockReleaseRead(psDevInfo->hComputeCtxListLock);
}
IMG_BOOL CheckForStalledClientComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo)
{
	PVRSRV_ERROR eError = PVRSRV_OK;
	OSWRLockAcquireRead(psDevInfo->hComputeCtxListLock, DEVINFO_COMPUTELIST);
	dllist_foreach_node(&(psDevInfo->sComputeCtxtListHead), 
						CheckForStalledClientComputeCtxtCommand, &eError);
	OSWRLockReleaseRead(psDevInfo->hComputeCtxListLock);
	return (PVRSRV_ERROR_CCCB_STALLED == eError)? IMG_TRUE: IMG_FALSE;
}
Exemple #4
0
IMG_VOID SyncConnectionPDumpSyncBlocks(SYNC_CONNECTION_DATA *psSyncConnectionData)
{
	OSLockAcquire(psSyncConnectionData->hLock);

	PDUMPCOMMENT("Dump client Sync Prim state");
	dllist_foreach_node(&psSyncConnectionData->sListHead,
						_PDumpSyncBlock,
						IMG_NULL);

	OSLockRelease(psSyncConnectionData->hLock);
}
Exemple #5
0
IMG_VOID ServerSyncDeinit(IMG_VOID)
{
	PVRSRVUnregisterDbgRequestNotify(g_hNotify);
	OSLockDestroy(g_hListLock);
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
	OSLockAcquire(g_hSyncRecordListLock);
	dllist_foreach_node(&g_sSyncRecordList, _SyncRecordListDestroy, IMG_NULL);
	OSLockRelease(g_hSyncRecordListLock);
	PVRSRVUnregisterDbgRequestNotify(g_hSyncRecordNotify);
	OSLockDestroy(g_hSyncRecordListLock);
#endif
}
Exemple #6
0
/* given the physical address of a page catalogue, searches for a corresponding
 * MMU context and if found, provides the caller details of the process.
 * Returns IMG_TRUE if a process is found.
 */
IMG_BOOL RGXPCAddrToProcessInfo(PVRSRV_RGXDEV_INFO *psDevInfo, IMG_DEV_PHYADDR sPCAddress,
								RGXMEM_PROCESS_INFO *psInfo)
{
	RGX_FIND_MMU_CONTEXT sData;
	IMG_BOOL bRet = IMG_FALSE;

	sData.sPCAddress = sPCAddress;
	sData.psServerMMUContext = IMG_NULL;

	dllist_foreach_node(&psDevInfo->sMemoryContextList, _RGXFindMMUContext, &sData);

	if(sData.psServerMMUContext != IMG_NULL)
	{
		psInfo->uiPID = sData.psServerMMUContext->uiPID;
		OSStringNCopy(psInfo->szProcessName, sData.psServerMMUContext->szProcessName, sizeof(psInfo->szProcessName));
		psInfo->szProcessName[sizeof(psInfo->szProcessName) - 1] = '\0';
		psInfo->bUnregistered = IMG_FALSE;
		bRet = IMG_TRUE;
	}
#if defined(SUPPORT_PAGE_FAULT_DEBUG)
	else
	{
		/* no active memory context found with the given PC address.
		 * Check the list of most recently freed memory contexts.
		 */
		 IMG_UINT32 i;

		 OSLockAcquire(psDevInfo->hMMUCtxUnregLock);

		 for(i = (gui32UnregisteredMemCtxsHead > 0) ? (gui32UnregisteredMemCtxsHead - 1) :
		 					UNREGISTERED_MEMORY_CONTEXTS_HISTORY_SIZE;
							i != gui32UnregisteredMemCtxsHead; i--)
		{
			UNREGISTERED_MEMORY_CONTEXT *psRecord = &gasUnregisteredMemCtxs[i];

			if(psRecord->sPCDevPAddr.uiAddr == sPCAddress.uiAddr)
			{
				psInfo->uiPID = psRecord->uiPID;
				OSStringNCopy(psInfo->szProcessName, psRecord->szProcessName, sizeof(psInfo->szProcessName)-1);
				psInfo->szProcessName[sizeof(psInfo->szProcessName) - 1] = '\0';
				psInfo->bUnregistered = IMG_TRUE;
				bRet = IMG_TRUE;
				break;
			}
		}

		OSLockRelease(psDevInfo->hMMUCtxUnregLock);

	}
#endif
	return bRet;
}
Exemple #7
0
static IMG_VOID _SyncRecordRequest(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle, IMG_UINT32 ui32VerbLevel)
{
	DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf = IMG_NULL;

	PVR_UNREFERENCED_PARAMETER(hDebugRequestHandle);

	pfnDumpDebugPrintf = g_pfnDumpDebugPrintf;

	if (ui32VerbLevel == DEBUG_REQUEST_VERBOSITY_HIGH)
	{
		PVR_DUMPDEBUG_LOG(("Dumping all sync records"));
		OSLockAcquire(g_hSyncRecordListLock);
		dllist_foreach_node(&g_sSyncRecordList, _SyncRecordPrint, IMG_NULL);
		OSLockRelease(g_hSyncRecordListLock);
	}
}
Exemple #8
0
IMG_VOID CheckForStalledTransferCtxt(PVRSRV_RGXDEV_INFO *psDevInfo)
{
	dllist_foreach_node(&(psDevInfo->sTransferCtxtListHead), CheckForStalledTransferCtxtCommand, IMG_NULL);
}