summaryrefslogtreecommitdiff
path: root/src/radeon_video.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2011-08-09 19:13:26 +0200
committerMichel Dänzer <michel@daenzer.net>2011-08-09 19:13:26 +0200
commit9151f3b1c2ebcc34e63195888ba696f2183ba5e2 (patch)
tree5adba84408174fd4abc4d5d7bf40618f72e67dda /src/radeon_video.c
parent3b9fdc807dd7e52af0576299cefba596040f6f2f (diff)
Prefer the CRTC of the primary output for synchronization.
See https://bugs.freedesktop.org/show_bug.cgi?id=39696 . Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/radeon_video.c')
-rw-r--r--src/radeon_video.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/radeon_video.c b/src/radeon_video.c
index edd6d54b..66ff2ad1 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -142,19 +142,27 @@ 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;
+
+ /* Prefer the CRTC of the primary output */
+ 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;
}