From 46ec9b0ed55d0fcade40f92206e59c02e402d870 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 31 Jul 2012 17:41:34 +0100 Subject: [PATCH] sna: Update DPMS mode on CRTC after forcing the outputs on If we forcibly update the outputs to be on, then the core will not issue its on DPMS event and we miss out on updating the CRTC bookkeeping in sna_crtc_dpms(). So we need to update the flag on the CRTC as we manipulate the outputs during modesetting. References: https://bugs.freedesktop.org/show_bug.cgi?id=52142 Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index a908596a..7754efa1 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -499,6 +499,8 @@ sna_crtc_force_outputs_on(xf86CrtcPtr crtc) output->funcs->dpms(output, DPMSModeOn); } + + to_sna_crtc(crtc)->dpms_mode = DPMSModeOn; } static bool @@ -663,14 +665,21 @@ static void update_flush_interval(struct sna *sna) int i, max_vrefresh = 0; for (i = 0; i < xf86_config->num_crtc; i++) { - if (!xf86_config->crtc[i]->enabled) - continue; + xf86CrtcPtr crtc = xf86_config->crtc[i]; - if (to_sna_crtc(xf86_config->crtc[i])->dpms_mode != DPMSModeOn) + if (!crtc->enabled) { + DBG(("%s: CRTC:%d (pipe %d) disabled\n", + __FUNCTION__,i, to_sna_crtc(crtc)->pipe)); continue; + } - max_vrefresh = max(max_vrefresh, - xf86ModeVRefresh(&xf86_config->crtc[i]->mode)); + if (to_sna_crtc(crtc)->dpms_mode != DPMSModeOn) { + DBG(("%s: CRTC:%d (pipe %d) turned off\n", + __FUNCTION__,i, to_sna_crtc(crtc)->pipe)); + continue; + } + + max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(&crtc->mode)); } if (max_vrefresh == 0)