From 2cc4903ecaeb41677c57d57bc90b03de3c4546ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 9 Aug 2011 19:13:26 +0200 Subject: [PATCH] All other things being equal, sync to the CRTC of the primary output. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/radeon_video.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/radeon_video.c b/src/radeon_video.c index edd6d54..06afb5c 100644 --- a/src/radeon_video.c +++ b/src/radeon_video.c @@ -142,19 +142,26 @@ radeon_pick_best_crtc(ScrnInfoPtr pScrn, xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int coverage, best_coverage, c; BoxRec box, crtc_box, cover_box; - xf86CrtcPtr best_crtc = NULL; + RROutputPtr primary_output; + xf86CrtcPtr best_crtc = NULL, primary_crtc = NULL; box.x1 = x1; box.x2 = x2; box.y1 = y1; box.y2 = y2; best_coverage = 0; + + primary_output = RRFirstOutput(pScrn->pScreen); + if (primary_output && primary_output->crtc) + primary_crtc = primary_output->crtc->devPrivate; + for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; radeon_crtc_box(crtc, &crtc_box); radeon_box_intersect(&cover_box, &crtc_box, &box); coverage = radeon_box_area(&cover_box); - if (coverage > best_coverage) { + if (coverage > best_coverage || + (coverage == best_coverage && crtc == primary_crtc)) { best_crtc = crtc; best_coverage = coverage; } -- 1.7.5.4