if (draw->type == DRAWABLE_PIXMAP)
return false;
- if (!sna->scrn->vtSema) {
- DBG(("%s: no, not attached to VT\n", __FUNCTION__));
+ if (!sna->mode.front_active) {
+ DBG(("%s: no, active CRTC\n", __FUNCTION__));
return false;
}
+ assert(sna->scrn->vtSema);
+
if ((sna->flags & (SNA_HAS_FLIP | SNA_HAS_ASYNC_FLIP)) == 0) {
DBG(("%s: no, pageflips disabled\n", __FUNCTION__));
return false;
check_flip__crtc(struct sna *sna,
RRCrtcPtr crtc)
{
- if (!sna->scrn->vtSema) {
- DBG(("%s: not master\n", __FUNCTION__));
- return false;
- }
-
if (!sna_crtc_is_on(crtc->devPrivate)) {
DBG(("%s: CRTC off\n", __FUNCTION__));
return false;
}
+ assert(sna->scrn->vtSema);
+
if (sna->mode.shadow_active) {
DBG(("%s: shadow buffer active\n", __FUNCTION__));
return false;
static void
sna_present_unflip(ScreenPtr screen, uint64_t event_id)
{
+ struct sna *sna = to_sna_from_screen(screen);
struct kgem_bo *bo;
DBG(("%s(event=%lld)\n", __FUNCTION__, (long long)event_id));
- bo = get_flip_bo(screen->GetScreenPixmap(screen));
- if (bo == NULL || !page_flip(screen, NULL, event_id, bo)) {
- struct sna *sna = to_sna_from_screen(screen);
+ if (sna->mode.front_active == 0) {
const struct ust_msc *swap;
- DBG(("%s: failed, trying to restore original mode\n", __FUNCTION__));
- xf86SetDesiredModes(sna->scrn);
+
+ DBG(("%s: no CRTC active, perform no-op flip\n", __FUNCTION__));
+
+notify:
swap = sna_crtc_last_swap(sna_mode_first_crtc(sna));
present_event_notify(event_id,
ust64(swap->tv_sec, swap->tv_usec),
swap->msc);
+ return;
+ }
+
+ bo = get_flip_bo(screen->GetScreenPixmap(screen));
+ if (bo == NULL || !page_flip(screen, NULL, event_id, bo)) {
+ DBG(("%s: failed, trying to restore original mode\n", __FUNCTION__));
+ xf86SetDesiredModes(sna->scrn);
+ goto notify;
}
}