diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-10 10:50:03 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-10 10:52:12 +0100 |
commit | cfa0c6162bbd2f6edab1301b6aed886af7e8ab38 (patch) | |
tree | 56d0117ea9b3cf8b43d0e7d6c1e6fcdcf7d5ef70 | |
parent | 95c71d1626dfbd97733e7e7e03fdde3af833446e (diff) |
sna: Fixup possible_crtcs for ZaphodHeads
As the possible_crtcs is a bitmask of the available crtcs exposed to the
Xserver, we need to adjust it for the limited view given by Zaphod mode.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_display.c | 23 | ||||
-rw-r--r-- | src/sna/sna_driver.c | 6 |
2 files changed, 22 insertions, 7 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index be5d9834..a9c54409 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -804,8 +804,8 @@ static void update_flush_interval(struct sna *sna) continue; } - DBG(("%s: CRTC:%d (pipe %d) vrefresh=%d\n", - __FUNCTION__,i, to_sna_crtc(crtc)->pipe, + DBG(("%s: CRTC:%d (pipe %d) vrefresh=%f\n", + __FUNCTION__, i, to_sna_crtc(crtc)->pipe, xf86ModeVRefresh(&crtc->mode))); max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(&crtc->mode)); } @@ -2192,7 +2192,6 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) struct drm_mode_get_encoder enc; struct sna_output *sna_output; const char *output_name; - const char *s; char name[32]; koutput = drmModeGetConnector(sna->kgem.fd, @@ -2212,9 +2211,23 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) snprintf(name, 32, "%s%d", output_name, koutput->connector_type_id); if (xf86IsEntityShared(scrn->entityList[0])) { - s = xf86GetOptValString(sna->Options, OPTION_ZAPHOD); - if (s && !sna_zaphod_match(s, name)) + const char *str; + + str = xf86GetOptValString(sna->Options, OPTION_ZAPHOD); + if (str && !sna_zaphod_match(str, name)) + goto cleanup_connector; + + if ((enc.possible_crtcs & (1 << scrn->confScreen->device->screen)) == 0) { + if (str) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "%s is an invalid output for screen (pipe) %d\n", + name, scrn->confScreen->device->screen); + } goto cleanup_connector; + } + + enc.possible_crtcs = 1; + enc.possible_clones = 0; } output = xf86OutputCreate(scrn, &sna_output_funcs, name); diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index a5c106e3..a29227be 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -256,12 +256,15 @@ static int sna_open_drm_master(ScrnInfoPtr scrn) dev = sna_device(scrn); if (dev) { dev->open_count++; + DBG(("%s: reusing device, count=%d\n", + __FUNCTION__, dev->open_count)); return dev->fd; } snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d", pci->domain, pci->bus, pci->dev, pci->func); + DBG(("%s: opening device '%s'\n", __FUNCTION__, busid)); fd = drmOpen(NULL, busid); if (fd == -1) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, @@ -1080,6 +1083,7 @@ static Bool sna_pm_event(SCRN_ARG_TYPE arg, pmEvent event, Bool undo) Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) { + DBG(("%s: entity_num=%d\n", __FUNCTION__, entity_num)); #if defined(USE_GIT_DESCRIBE) xf86DrvMsg(scrn->scrnIndex, X_INFO, "SNA compiled from %s\n", git_version); @@ -1099,8 +1103,6 @@ Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) xf86DrvMsg(scrn->scrnIndex, X_INFO, "SNA compiled with extra pixmap/damage validation\n"); #endif - - DBG(("%s\n", __FUNCTION__)); DBG(("pixman version: %s\n", pixman_version_string())); if (sna_device_key == -1) |