diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-14 08:13:58 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-14 08:22:20 +0100 |
commit | 2f675cf402a6d158448a9300779829a10ca991fd (patch) | |
tree | 7f868c4d29ba782d415bb66e045c9a66eb2bb103 | |
parent | 49f265915a4bca52724c345f04cddfeaca972655 (diff) |
sna: Split zaphod across the crtcs
Since we have no global resource allocator for zaphod mode, that's what
RandR-1.4 solves, we have to further constrain zaphod mode to only use
one crtc per screen. This also means that you must match the output
restrictions within the Screen definitions, noting that the crtc pipe id
corresponds with the screen number.
Reportede-by: Phillp Haddad <phillip.haddad@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_display.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 170f6927..85879229 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -345,7 +345,7 @@ sna_crtc_apply(xf86CrtcPtr crtc) struct sna *sna = to_sna(scrn); struct sna_crtc *sna_crtc = crtc->driver_private; struct sna_mode *mode = &sna->mode; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); uint32_t output_ids[16]; int output_count = 0; int fb_id, x, y; @@ -467,7 +467,7 @@ sna_crtc_dpms(xf86CrtcPtr crtc, int mode) static Bool sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, - Rotation rotation, int x, int y) + Rotation rotation, int x, int y) { ScrnInfoPtr scrn = crtc->scrn; struct sna *sna = to_sna(scrn); @@ -695,12 +695,6 @@ sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) if (sna_crtc == NULL) return; - crtc = xf86CrtcCreate(scrn, &sna_crtc_funcs); - if (crtc == NULL) { - free(sna_crtc); - return; - } - sna_crtc->mode_crtc = drmModeGetCrtc(sna->kgem.fd, mode->mode_res->crtcs[num]); get_pipe.pipe = 0; @@ -710,6 +704,18 @@ sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) &get_pipe); sna_crtc->pipe = get_pipe.pipe; + if (xf86IsEntityShared(scrn->entityList[0]) && + scrn->confScreen->device->screen != sna_crtc->pipe) { + free(sna_crtc); + return; + } + + crtc = xf86CrtcCreate(scrn, &sna_crtc_funcs); + if (crtc == NULL) { + free(sna_crtc); + return; + } + crtc->driver_private = sna_crtc; sna_crtc->cursor = gem_create(sna->kgem.fd, 64*64*4); @@ -717,6 +723,9 @@ sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) sna_crtc->sna = sna; sna_crtc->crtc = crtc; list_add(&sna_crtc->link, &mode->crtcs); + + DBG(("%s: attached crtc[%d] id=%d, pipe=%d\n", + __FUNCTION__, num, sna_crtc->mode_crtc->crtc_id, sna_crtc->pipe)); } static Bool |