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>
This commit is contained in:
parent
95c71d1626
commit
cfa0c6162b
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue