summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-12-18 17:58:18 -0800
committerKeith Packard <keithp@keithp.com>2014-12-25 13:39:14 -0800
commit7d1fc04d27857c999bd732d54a0b36f5079449b8 (patch)
tree641ca747a4d063fcdd08cfd789c086becb126a98 /hw
parent8affaade2c127ea08989c86e7d71cc9da3db1824 (diff)
modesetting: Check DPMS mode in ms_covering_crtc().
crtc->enabled is insufficient; we should also make sure DPMS is on. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Jason Ekstrand <jason.ekstrand@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/drivers/modesetting/vblank.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c
index 5031ef8ff..ee5e37167 100644
--- a/hw/xfree86/drivers/modesetting/vblank.c
+++ b/hw/xfree86/drivers/modesetting/vblank.c
@@ -88,6 +88,14 @@ static int ms_box_area(BoxPtr box)
return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1);
}
+static Bool
+ms_crtc_on(xf86CrtcPtr crtc)
+{
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+ return crtc->enabled && drmmode_crtc->dpms_mode == DPMSModeOn;
+}
+
/*
* Return the crtc covering 'box'. If two crtcs cover a portion of
* 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
@@ -114,7 +122,7 @@ ms_covering_crtc(ScrnInfoPtr scrn,
crtc = xf86_config->crtc[c];
/* If the CRTC is off, treat it as not covering */
- if (!crtc->enabled)
+ if (!ms_crtc_on(crtc))
continue;
ms_crtc_box(crtc, &crtc_box);