diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-02 09:49:48 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-02 10:00:51 +0100 |
commit | c361b449cc3ec15819883afc220aad8823c0072d (patch) | |
tree | 868f5686d310aab65ba8f982ba7f0e9f1b67cdfe /src | |
parent | 282507af8e932e49b31d5f20958a61c137df590d (diff) |
sna: Include connector status in the initial probe
We cannot simply rely on connector->encoder->crtc status as with the
introduction of Haswell or SDVO we may have multiple connectors using the
same encoder. So we need to explictly check the connector status first,
before determining if the output is connected to an active encoder and
CRTC.
References: https://bugs.freedesktop.org/show_bug.cgi?id=66488
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_display.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index d22eeaaa..27dda3e8 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2597,11 +2597,17 @@ sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) output->possible_clones = enc.possible_clones; output->interlaceAllowed = TRUE; - DBG(("%s: created output '%s' %d [%d] (possible crtc:%x, possible clones:%x), edid=%d, dpms=%d\n", + /* stash the active CRTC id for our probe function */ + output->crtc = NULL; + if (conn.connection == DRM_MODE_CONNECTED) + output->crtc = (void *)(uintptr_t)enc.crtc_id; + + DBG(("%s: created output '%s' %d [%d] (possible crtc:%x, possible clones:%x), edid=%d, dpms=%d, crtc=%d\n", __FUNCTION__, name, num, sna_output->id, (uint32_t)output->possible_crtcs, (uint32_t)output->possible_clones, - sna_output->edid_idx, sna_output->dpms_id)); + sna_output->edid_idx, sna_output->dpms_id, + (uintptr_t)output->crtc)); return true; @@ -3060,27 +3066,20 @@ static bool sna_probe_initial_configuration(struct sna *sna) /* Reconstruct outputs pointing to active CRTC */ for (i = 0; i < config->num_output; i++) { xf86OutputPtr output = config->output[i]; - struct sna_output *sna_output = to_sna_output(output); - struct drm_mode_get_encoder enc; + uint32_t crtc_id; Bool disable; + crtc_id = (uintptr_t)output->crtc; output->crtc = NULL; + if (xf86GetOptValBool(output->options, 8 /* OPTION_DISABLE */, &disable) && disable) continue; - VG_CLEAR(enc); - enc.encoder_id = sna->mode.kmode->encoders[sna_output->encoder_idx]; - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETENCODER, &enc)) - continue; - - if (enc.crtc_id == 0) - continue; - for (j = 0; j < config->num_crtc; j++) { xf86CrtcPtr crtc = config->crtc[j]; - if (to_sna_crtc(crtc)->id == enc.crtc_id) { + if (to_sna_crtc(crtc)->id == crtc_id) { if (crtc->desiredMode.status == MODE_OK) { DisplayModePtr M; |