From 13d9db20952eeb66ab783315bb0112fc279393c2 Mon Sep 17 00:00:00 2001 From: Marty Jack Date: Wed, 9 Feb 2011 19:01:42 -0500 Subject: [PATCH] Beginnings of multiple monitor Allocate the CRTCs from a bit mask to avoid the multiple monitor black screen problem. --- compositor/compositor-drm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compositor/compositor-drm.c b/compositor/compositor-drm.c index e55c5f20..135e1cb9 100644 --- a/compositor/compositor-drm.c +++ b/compositor/compositor-drm.c @@ -43,6 +43,7 @@ struct drm_compositor { struct { int fd; } drm; + uint32_t crtc_allocator; struct tty *tty; }; @@ -204,7 +205,8 @@ create_output_for_connector(struct drm_compositor *ec, } for (i = 0; i < resources->count_crtcs; i++) { - if (encoder->possible_crtcs & (1 << i)) + if (encoder->possible_crtcs & (1 << i) && + !(ec->crtc_allocator & (1 << i))) break; } if (i == resources->count_crtcs) { @@ -216,6 +218,7 @@ create_output_for_connector(struct drm_compositor *ec, wlsc_output_init(&output->base, &ec->base, 0, 0, mode->hdisplay, mode->vdisplay, 0); + ec->crtc_allocator |= (1 << i); output->crtc_id = resources->crtcs[i]; output->connector_id = connector->connector_id; output->mode = *mode;