summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2012-06-08 12:18:48 +0200
committerMichel Dänzer <michel@daenzer.net>2012-06-08 12:18:48 +0200
commit248e912c487636d7352cfad43c03fc9f19fc2215 (patch)
tree1297a27211af1382a67b64443ac639125ad4733d
parent58883711136fa6671d4f3250d4ee973e2953ebb4 (diff)
UMS: Fix CRTC DPMS state check.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--src/radeon_video.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 01703a0c..fcca5077 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -143,6 +143,22 @@ radeon_box_area(BoxPtr box)
return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
}
+static Bool
+radeon_crtc_is_enabled(xf86CrtcPtr crtc)
+{
+ RADEONCrtcPrivatePtr radeon_crtc;
+
+#ifdef XF86DRM_MODE
+ if (RADEONPTR(crtc->scrn)->cs) {
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ return drmmode_crtc->dpms_mode == DPMSModeOn;
+ }
+#endif
+
+ radeon_crtc = crtc->driver_private;
+ return radeon_crtc->enabled;
+}
+
xf86CrtcPtr
radeon_pick_best_crtc(ScrnInfoPtr pScrn,
int x1, int x2, int y1, int y2)
@@ -171,9 +187,8 @@ radeon_pick_best_crtc(ScrnInfoPtr pScrn,
for (c = 0; c < xf86_config->num_crtc; c++) {
xf86CrtcPtr crtc = xf86_config->crtc[c];
- drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
- if (drmmode_crtc->dpms_mode == DPMSModeOff)
+ if (!radeon_crtc_is_enabled(crtc))
continue;
radeon_crtc_box(crtc, &crtc_box);