diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 778d035..271a0ec 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -177,11 +177,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 dff0392..14cf9d3 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_dri2.c b/src/radeon_dri2.c index 56a7c4b..d7d296f 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -767,6 +772,7 @@ can_flip(ScrnInfoPtr pScrn, DrawablePtr draw, { return draw->type == DRAWABLE_WINDOW && RADEONPTR(pScrn)->allowPageFlip && + pScrn->vtSema && DRI2CanFlip(draw) && can_exchange(pScrn, draw, front, back); } diff --git a/src/radeon_video.c b/src/radeon_video.c index 0e2c127..bdcf0d7 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 +#else +#define DPMS_SERVER +#include +#endif + #include #include "fourcc.h" @@ -145,6 +153,9 @@ radeon_pick_best_crtc(ScrnInfoPtr pScrn, RROutputPtr primary_output = NULL; xf86CrtcPtr best_crtc = NULL, primary_crtc = NULL; + if (!pScrn->vtSema) + return NULL; + box.x1 = x1; box.x2 = x2; box.y1 = y1; @@ -160,6 +171,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);