PVRSRV_ERROR PVRSRVSyncPrimPDumpPolKM(SYNC_PRIMITIVE_BLOCK *psSyncBlk, IMG_UINT32 ui32Offset, IMG_UINT32 ui32Value, IMG_UINT32 ui32Mask, PDUMP_POLL_OPERATOR eOperator, PDUMP_FLAGS_T ui32PDumpFlags) { DevmemPDumpDevmemPol32(psSyncBlk->psMemDesc, ui32Offset, ui32Value, ui32Mask, eOperator, ui32PDumpFlags); return PVRSRV_OK; }
static PVRSRV_ERROR _RGXCCBPDumpTransition(IMG_PVOID *pvData, IMG_BOOL bInto, IMG_BOOL bContinuous) { RGX_CLIENT_CCB *psClientCCB = (RGX_CLIENT_CCB *) pvData; IMG_UINT32 ui32PDumpFlags = bContinuous ? PDUMP_FLAGS_CONTINUOUS:0; /* We're about to Transition into capture range and we've submitted new commands since the last time we entered capture range so drain the CCB as required */ if (bInto) { volatile RGXFWIF_CCCB_CTL *psCCBCtl = psClientCCB->psClientCCBCtrl; PVRSRV_ERROR eError; /* Wait for the FW to catch up (retry will get pushed back out services client where we wait on the event object and try again later) */ if (psClientCCB->psClientCCBCtrl->ui32ReadOffset != psClientCCB->ui32HostWriteOffset) { return PVRSRV_ERROR_RETRY; } /* We drain whenever capture range is entered. Even if no commands have been issued while where out of capture range we have to wait for operations that we might have issued in the last capture range to finish so the sync prim update that will happen after all the PDumpTransition callbacks have been called doesn't clobber syncs which the FW is currently working on. Although this is suboptimal, while out of capture range for every persistent operation we serialise the PDump script processing and the FW, there is no easy solution. Not all modules that work on syncs register a PDumpTransition and thus we have no way of knowing if we can skip drain and the sync prim dump or not. */ PDUMPCOMMENTWITHFLAGS(ui32PDumpFlags, "cCCB(%s@%p): Draining rgxfw_roff == woff (%d)", psClientCCB->szName, psClientCCB, psClientCCB->ui32LastPDumpWriteOffset); eError = DevmemPDumpDevmemPol32(psClientCCB->psClientCCBCtrlMemDesc, offsetof(RGXFWIF_CCCB_CTL, ui32ReadOffset), psClientCCB->ui32LastPDumpWriteOffset, 0xffffffff, PDUMP_POLL_OPERATOR_EQUAL, ui32PDumpFlags); if (eError != PVRSRV_OK) { PVR_DPF((PVR_DBG_WARNING, "_RGXCCBPDumpTransition: problem pdumping POL for cCCBCtl (%d)", eError)); } PVR_ASSERT(eError == PVRSRV_OK); /* If new command(s) have been written out of capture range then we need to fast forward past uncaptured operations. */ if (psClientCCB->ui32LastPDumpWriteOffset != psClientCCB->ui32HostWriteOffset) { /* There are commands that where not captured so after the simulation drain (above) we also need to fast-forward pass those commands so the FW can start with the 1st command which is in the new capture range */ psCCBCtl->ui32ReadOffset = psClientCCB->ui32HostWriteOffset; psCCBCtl->ui32DepOffset = psClientCCB->ui32HostWriteOffset; psCCBCtl->ui32WriteOffset = psClientCCB->ui32HostWriteOffset; PDUMPCOMMENTWITHFLAGS(ui32PDumpFlags, "cCCB(%s@%p): Fast-forward from %d to %d", psClientCCB->szName, psClientCCB, psClientCCB->ui32LastPDumpWriteOffset, psClientCCB->ui32HostWriteOffset); DevmemPDumpLoadMem(psClientCCB->psClientCCBCtrlMemDesc, 0, sizeof(RGXFWIF_CCCB_CTL), ui32PDumpFlags); /* Although we've entered capture range we might not do any work on this CCB so update the ui32LastPDumpWriteOffset to reflect where we got to for next so we start the drain from where we got to last time */ psClientCCB->ui32LastPDumpWriteOffset = psClientCCB->ui32HostWriteOffset; } } return PVRSRV_OK; }