/* * Queue a flip back to the normal frame buffer */ static void intel_present_unflip(ScreenPtr screen, uint64_t event_id) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); intel_screen_private *intel = intel_get_screen_private(scrn); struct intel_present_vblank_event *event; PixmapPtr pixmap = screen->GetScreenPixmap(screen); dri_bo *bo; Bool ret; if (!intel_present_check_flip(NULL, screen->root, pixmap, true)) return; bo = intel_get_pixmap_bo(pixmap); if (!bo) return; event = calloc(1, sizeof(struct intel_present_vblank_event)); if (!event) return; event->event_id = event_id; ret = intel_do_pageflip(intel, bo, -1, FALSE, event, intel_present_flip_event, intel_present_flip_abort); if (!ret) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present unflip failed\n"); } }
/* * Queue a flip back to the normal frame buffer */ static void intel_present_unflip(ScreenPtr screen, uint64_t event_id) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); intel_screen_private *intel = intel_get_screen_private(scrn); PixmapPtr pixmap = screen->GetScreenPixmap(screen); struct intel_present_vblank_event *event = NULL; dri_bo *bo; if (!intel_present_check_flip(NULL, screen->root, pixmap, true)) goto fail; bo = intel_get_pixmap_bo(pixmap); if (!bo) goto fail; event = calloc(1, sizeof(struct intel_present_vblank_event)); if (!event) goto fail; event->event_id = event_id; if (!intel_do_pageflip(intel, bo, -1, FALSE, event, intel_present_flip_event, intel_present_flip_abort)) goto fail; return; fail: xf86SetDesiredModes(scrn); present_event_notify(event_id, 0, 0); free(event); }
/* * Queue a flip on 'crtc' to 'pixmap' at 'target_msc'. If 'sync_flip' is true, * then wait for vblank. Otherwise, flip immediately */ static Bool intel_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc, PixmapPtr pixmap, Bool sync_flip) { ScreenPtr screen = crtc->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); intel_screen_private *intel = intel_get_screen_private(scrn); struct intel_present_vblank_event *event; int pipe = intel_present_crtc_pipe(screen, crtc); dri_bo *bo; Bool ret; if (!intel_present_check_flip(crtc, screen->root, pixmap, sync_flip)) return FALSE; bo = intel_get_pixmap_bo(pixmap); if (!bo) return FALSE; event = calloc(1, sizeof(struct intel_present_vblank_event)); if (!event) return FALSE; event->event_id = event_id; ret = intel_do_pageflip(intel, bo, pipe, !sync_flip, event, intel_present_flip_event, intel_present_flip_abort); if (!ret) xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n"); return ret; }