}
else if (vblank_type == VBLANK_INFO_PLANE)
secLayerVBlankEventHandler (frame, tv_sec, tv_usec, data);
+ else if (vblank_type == VBLANK_INFO_PRESENT)
+ {
+ XDBG_TRACE (MDISP, "vblank handler (%p, %ld, %ld)\n",
+ pVblankInfo, pVblankInfo->time, GetTimeInMillis () - pVblankInfo->time);
+ secPresentVblankHandler(frame, tv_sec, tv_usec, data);
+ }
else
XDBG_ERROR (MDISP, "unknown the vblank type\n");
secCrtcCountFps(pCrtc);
/* Deliver cached msc, ust from reference crtc to flip event handler */
- secDri2FlipEventHandler (pCrtcPriv->fe_frame, pCrtcPriv->fe_tv_sec,
- pCrtcPriv->fe_tv_usec, pCrtcPriv->flip_info, flip->flip_failed);
+ if (flip->handler)
+ flip->handler(pCrtcPriv->fe_frame, pCrtcPriv->fe_tv_sec,
+ pCrtcPriv->fe_tv_usec, pCrtcPriv->flip_info, flip->flip_failed);
}
free (flip);
}
Bool
-secModePageFlip (ScrnInfoPtr pScrn, xf86CrtcPtr pCrtc, void* flip_info, int pipe, tbm_bo back_bo)
+secModePageFlip (ScrnInfoPtr pScrn, xf86CrtcPtr pCrtc, void* flip_info, int pipe, tbm_bo back_bo,
+ RegionPtr pFlipRegion, unsigned int client_idx, XID drawable_id,
+ SECFlipEventHandler handler)
{
SECPageFlipPtr pPageFlip = NULL;
SECFbBoDataPtr bo_data;
SECPtr pSec = SECPTR(pScrn);
int ret;
int fb_id = 0;
- DRI2FrameEventPtr pEvent = (DRI2FrameEventPtr) flip_info;
BoxRec b1;
int retBox, found=0;
pPageFlip->back_bo = secRenderBoRef (back_bo);
pPageFlip->data = flip_info;
pPageFlip->flip_failed = FALSE;
+ pPageFlip->handler = handler;
/* accessilitity */
if (pCrtcPriv->bAccessibility || pCrtcPriv->screen_rotate_degree > 0)
secCrtcTurn (pCrtcPriv->pCrtc, TRUE, FALSE, FALSE);
#if DBG_DRM_EVENT
- pPageFlip->xdbg_log_pageflip = xDbgLogDrmEventAddPageflip (pipe, pEvent->client_idx, pEvent->drawable_id);
+ pPageFlip->xdbg_log_pageflip = xDbgLogDrmEventAddPageflip (pipe, client_idx, drawable_id);
#endif
XDBG_DEBUG (MSEC, "dump_mode(%x)\n", pSec->dump_mode);
pPageFlip->time = GetTimeInMillis ();
/*Set DirtyFB*/
- if(pSec->use_partial_update && pEvent->pRegion)
+ if(pSec->use_partial_update && pFlipRegion)
{
int nBox;
BoxPtr pBox;
RegionRec new_region;
- RegionPtr pRegion = pEvent->pRegion;
+ RegionPtr pRegion = pFlipRegion;
for (nBox = RegionNumRects(pRegion),
pBox = RegionRects(pRegion); nBox--; pBox++)
if (pCrtcPriv->screen_rotate_degree > 0)
{
- RegionCopy (&new_region, pEvent->pRegion);
+ RegionCopy (&new_region, pFlipRegion);
secUtilRotateRegion (pCrtc->mode.HDisplay, pCrtc->mode.VDisplay,
&new_region, pCrtcPriv->screen_rotate_degree);
pRegion = &new_region;
pPageFlip->flip_failed = FALSE;
pPageFlip->xdbg_log_pageflip = NULL;
pPageFlip->time = GetTimeInMillis ();
+ pPageFlip->handler = secDri2FlipEventHandler;
/* accessilitity */
if (pCrtcPriv->bAccessibility || pCrtcPriv->screen_rotate_degree > 0)