summaryrefslogtreecommitdiff
path: root/src/intel_display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-05-24 11:58:46 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-05-24 12:03:14 +0100
commit3f3bde4f0c72f6f31aae322bcdc20b95eade6631 (patch)
treedac79f1ba63d2d5f8b235f8119659c0abc5a8458 /src/intel_display.c
parent11db66fedf96f158cbbac8011a8ba0b29a20ba3a (diff)
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>
Diffstat (limited to 'src/intel_display.c')
-rw-r--r--src/intel_display.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/intel_display.c b/src/intel_display.c
index abdc372e..77a1cce1 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -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;
+}