diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 14d86c7..e252adf 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -313,8 +313,11 @@ drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode) drmVBlank vbl; /* Wait for any pending flip to finish */ - if (drmmode_crtc->flip_pending) + if (drmmode_crtc->flip_pending) { + ErrorF("%s: Deferring DPMS off for CRTC %d due to pending flip\n", + __func__, drmmode_crtc->mode_crtc->crtc_id); return; + } /* * On->Off transition: record the last vblank time, @@ -375,9 +378,14 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) /* Disable unused CRTCs */ if (!crtc->enabled || mode != DPMSModeOn) { /* Wait for any pending flip to finish */ - if (drmmode_crtc->flip_pending) + if (drmmode_crtc->flip_pending) { + ErrorF("%s: Deferring DPMS off for CRTC %d due to pending flip\n", + __func__, drmmode_crtc->mode_crtc->crtc_id); return; + } + ErrorF("%s: Turning off CRTC %d\n", + __func__, drmmode_crtc->mode_crtc->crtc_id); drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0, NULL, 0, NULL); } else if (drmmode_crtc->dpms_mode != DPMSModeOn) @@ -860,6 +868,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, drmHandleEvent(drmmode->fd, &drmmode->event_context) > 0); + ErrorF("%s: Setting mode for CRTC %d\n", + __func__, drmmode_crtc->mode_crtc->crtc_id); if (drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, fb_id, x, y, output_ids, @@ -1329,6 +1339,7 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) { drmmode_output_private_ptr drmmode_output = output->driver_private; xf86CrtcPtr crtc = output->crtc; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmModeConnectorPtr koutput = drmmode_output->mode_output; drmmode_ptr drmmode = drmmode_output->drmmode; @@ -1336,21 +1347,22 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) return; if (mode != DPMSModeOn && crtc) { - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - drmmode_do_crtc_dpms(crtc, mode); /* Wait for any pending flip to finish */ - if (drmmode_crtc->flip_pending) + if (drmmode_crtc->flip_pending) { + ErrorF("%s: Deferring DPMS off for CRTC %d due to pending flip\n", + __func__, drmmode_crtc->mode_crtc->crtc_id); return; + } } + ErrorF("%s: Setting DPMS mode %d for output of CRTC %d\n", + __func__, mode, drmmode_crtc->mode_crtc->crtc_id); drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, drmmode_output->dpms_enum_id, mode); if (mode == DPMSModeOn && crtc) { - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - if (drmmode_crtc->need_modeset) drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, crtc->x, crtc->y); @@ -2180,6 +2192,8 @@ drmmode_clear_pending_flip(xf86CrtcPtr crtc) drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_crtc->flip_pending = FALSE; + ErrorF("%s: flip_pending cleared for CRTC %d\n", + __func__, drmmode_crtc->mode_crtc->crtc_id); if (drmmode_crtc->pending_dpms_mode != DPMSModeOn && drmmode_crtc->dpms_mode != drmmode_crtc->pending_dpms_mode) { @@ -2192,6 +2206,9 @@ drmmode_clear_pending_flip(xf86CrtcPtr crtc) if (output->crtc != crtc) continue; + ErrorF("%s: Executing deferred DPMS off for CRTC %d\n", + __func__, drmmode_crtc->mode_crtc->crtc_id); + drmmode_output_dpms(output, drmmode_crtc->pending_dpms_mode); drmmode_crtc_dpms(crtc, drmmode_crtc->pending_dpms_mode); } @@ -2814,6 +2831,8 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client, goto error; } drmmode_crtc->flip_pending = TRUE; + ErrorF("%s: Submitted flip for CRTC %d\n", __func__, + drmmode_crtc->mode_crtc->crtc_id); drm_queue_seq = 0; } diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index c55e6ee..cbdd21f 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -733,6 +733,7 @@ radeon_dri2_schedule_flip(xf86CrtcPtr crtc, ClientPtr client, back_priv = back->driverPrivate; bo = radeon_get_pixmap_bo(back_priv->pixmap); + ErrorF("%s: Submitting flip\n", __func__); if (radeon_do_pageflip(scrn, client, bo->handle, RADEON_DRM_QUEUE_ID_DEFAULT, flip_info, ref_crtc_hw_id, diff --git a/src/radeon_present.c b/src/radeon_present.c index 93c18a8..04b9d20 100644 --- a/src/radeon_present.c +++ b/src/radeon_present.c @@ -332,6 +332,7 @@ radeon_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc, event->event_id = event_id; + ErrorF("%s: Submitting flip\n", __func__); ret = radeon_do_pageflip(scrn, RADEON_DRM_QUEUE_CLIENT_DEFAULT, handle, event_id, event, crtc_id, radeon_present_flip_event, @@ -377,6 +378,7 @@ radeon_present_unflip(ScreenPtr screen, uint64_t event_id) event->event_id = event_id; event->unflip = TRUE; + ErrorF("%s: Submitting unflip\n", __func__); if (radeon_do_pageflip(scrn, RADEON_DRM_QUEUE_CLIENT_DEFAULT, handle, event_id, event, -1, radeon_present_flip_event, radeon_present_flip_abort, FLIP_VSYNC))