summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2012-06-06 12:16:08 +0200
committerMichel Dänzer <michel@daenzer.net>2012-06-06 12:16:08 +0200
commit1d9f1eb7e65c57c52759ccbfa51e8bdd5a10acac (patch)
treec33bb9ec3ce42b2673ce873c15cfd43d83b5e3aa
parent4603285aa8efaf2614f15a38254465cec2075f11 (diff)
Don't wait on a CRTC which has been disabled via DPMS (bug #49761).
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=49761 . Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--src/drmmode_display.c7
-rw-r--r--src/drmmode_display.h1
-rw-r--r--src/radeon_video.c13
3 files changed, 18 insertions, 3 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index fad13db9..3a08d8a2 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -179,11 +179,12 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn,
static void
drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
{
-#if 0
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
-// drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
// drmmode_ptr drmmode = drmmode_crtc->drmmode;
+ drmmode_crtc->dpms_mode = mode;
+
+#if 0
/* bonghits in the randr 1.2 - uses dpms to disable crtc - bad buzz */
if (mode == DPMSModeOff) {
// drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 44fac169..04a86882 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -73,6 +73,7 @@ typedef struct {
struct radeon_bo *cursor_bo;
struct radeon_bo *rotate_bo;
unsigned rotate_fb_id;
+ int dpms_mode;
uint16_t lut_r[256], lut_g[256], lut_b[256];
} drmmode_crtc_private_rec, *drmmode_crtc_private_ptr;
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 4eb01dc1..d6027358 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -19,6 +19,14 @@
#include "atipciids.h"
#include "xf86fbman.h"
+/* DPMS */
+#ifdef HAVE_XEXTPROTO_71
+#include <X11/extensions/dpmsconst.h>
+#else
+#define DPMS_SERVER
+#include <X11/extensions/dpms.h>
+#endif
+
#include <X11/extensions/Xv.h>
#include "fourcc.h"
@@ -160,6 +168,11 @@ 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)
+ continue;
+
radeon_crtc_box(crtc, &crtc_box);
radeon_box_intersect(&cover_box, &crtc_box, &box);
coverage = radeon_box_area(&cover_box);