xf86-video-intel: src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Jul 2 02:15:02 PDT 2013


 src/sna/sna_display.c |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

New commits:
commit c361b449cc3ec15819883afc220aad8823c0072d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jul 2 09:49:48 2013 +0100

    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 at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index d22eeaa..27dda3e 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;
 


More information about the xorg-commit mailing list