uxa: Only consider an output valid if the kernel reports it attached
Reported-by: Kyle Hill <kyle.hill@tacomafia.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50078 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
11db66fedf
commit
3f3bde4f0c
|
|
@ -1699,3 +1699,25 @@ int intel_crtc_to_pipe(xf86CrtcPtr crtc)
|
|||
struct intel_crtc *intel_crtc = crtc->driver_private;
|
||||
return intel_crtc->pipe;
|
||||
}
|
||||
|
||||
Bool intel_crtc_on(xf86CrtcPtr crtc)
|
||||
{
|
||||
ScrnInfoPtr scrn = crtc->scrn;
|
||||
struct intel_crtc *intel_crtc = crtc->driver_private;
|
||||
drmModeCrtcPtr drm_crtc;
|
||||
Bool ret;
|
||||
|
||||
if (!crtc->enabled)
|
||||
return FALSE;
|
||||
|
||||
/* Kernel manages CRTC status based on output config */
|
||||
drm_crtc = drmModeGetCrtc(intel_crtc->mode->fd, crtc_id(intel_crtc));
|
||||
if (drm_crtc == NULL)
|
||||
return FALSE;
|
||||
|
||||
ret = (drm_crtc->mode_valid &&
|
||||
intel_crtc->mode->fb_id == drm_crtc->buffer_id);
|
||||
free(drm_crtc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -782,26 +782,6 @@ intel_init_initial_framebuffer(ScrnInfoPtr scrn)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
Bool intel_crtc_on(xf86CrtcPtr crtc)
|
||||
{
|
||||
ScrnInfoPtr scrn = crtc->scrn;
|
||||
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||
int i;
|
||||
|
||||
if (!crtc->enabled)
|
||||
return FALSE;
|
||||
|
||||
/* Kernel manages CRTC status based out output config */
|
||||
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)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
intel_flush_callback(CallbackListPtr *list,
|
||||
pointer user_data, pointer call_data)
|
||||
|
|
|
|||
Loading…
Reference in New Issue