uxa: Check for DPMS off before scheduling a WAIT_ON_EVENT

Regression from commit 3f3bde4f0c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu May 24 11:58:46 2012 +0100

    uxa: Only consider an output valid if the kernel reports it attached

When backporting from SNA, a key difference that UXA does not track DPMS
state in its enabled flag and that a DPMS off CRTC is still bound to the
fb. So we do need to rescan the outputs and check that we have a
connector enabled *and* the pipe is running prior to emitting a scanline
wait.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50668
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-06-05 16:04:16 +01:00
parent 7c51cabaec
commit c4eb5528a4
1 changed files with 15 additions and 0 deletions

View File

@ -1716,13 +1716,28 @@ int intel_crtc_to_pipe(xf86CrtcPtr crtc)
Bool intel_crtc_on(xf86CrtcPtr crtc)
{
struct intel_crtc *intel_crtc = crtc->driver_private;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
drmModeCrtcPtr drm_crtc;
Bool ret;
int i;
if (!crtc->enabled)
return FALSE;
/* Kernel manages CRTC status based on output config */
ret = FALSE;
for (i = 0; i < xf86_config->num_output; i++) {
xf86OutputPtr output = xf86_config->output[i];
if (output->crtc == crtc &&
intel_output_dpms_status(output) == DPMSModeOn) {
ret = TRUE;
break;
}
}
if (!ret)
return FALSE;
/* And finally check with the kernel that the fb is bound */
drm_crtc = drmModeGetCrtc(intel_crtc->mode->fd, crtc_id(intel_crtc));
if (drm_crtc == NULL)
return FALSE;