Beginnings of multiple monitor

Allocate the CRTCs from a bit mask to avoid the multiple monitor black
screen problem.
This commit is contained in:
Marty Jack 2011-02-09 19:01:42 -05:00 committed by Kristian Høgsberg
parent 58dc6dd3c5
commit 13d9db2095
1 changed files with 4 additions and 1 deletions

View File

@ -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;