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

Chris Wilson ickle at kemper.freedesktop.org
Wed Jan 9 19:35:43 PST 2013


 src/sna/sna_driver.c |   50 ++++++++++++++++++++++++++------------------------
 1 file changed, 26 insertions(+), 24 deletions(-)

New commits:
commit 8a8edfe4076ee08558c76eddbb68426e4563888c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 03:31:37 2013 +0000

    sna: Make sure all outputs are disabled if no CompatOutput is defined
    
    If we have to fallback and the configuration is wonky, make sure that
    all known outputs are disabled as we takeover the console.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 86c05e4..dff2901 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -148,38 +148,40 @@ static void
 sna_set_fallback_mode(ScrnInfoPtr scrn)
 {
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-	xf86OutputPtr output;
-	xf86CrtcPtr crtc;
-	DisplayModePtr mode;
+	xf86OutputPtr output = NULL;
+	xf86CrtcPtr crtc = NULL;
 	int n;
 
-	if ((unsigned)config->compat_output >= config->num_output)
-		return;
-
-	output = config->output[config->compat_output];
-	crtc = output->crtc;
+	if ((unsigned)config->compat_output < config->num_output) {
+		output = config->output[config->compat_output];
+		crtc = output->crtc;
+	}
 
 	for (n = 0; n < config->num_output; n++)
 		config->output[n]->crtc = NULL;
 	for (n = 0; n < config->num_crtc; n++)
 		config->crtc[n]->enabled = FALSE;
 
-	output->crtc = crtc;
-
-	mode = xf86OutputFindClosestMode(output, scrn->currentMode);
-	if (mode &&
-	    xf86CrtcSetModeTransform(crtc, mode, RR_Rotate_0, NULL, 0, 0)) {
-		crtc->desiredMode = *mode;
-		crtc->desiredMode.prev = crtc->desiredMode.next = NULL;
-		crtc->desiredMode.name = NULL;
-		crtc->desiredMode.PrivSize = 0;
-		crtc->desiredMode.PrivFlags = 0;
-		crtc->desiredMode.Private = NULL;
-		crtc->desiredRotation = RR_Rotate_0;
-		crtc->desiredTransformPresent = FALSE;
-		crtc->desiredX = 0;
-		crtc->desiredY = 0;
-		crtc->enabled = TRUE;
+	if (output && crtc) {
+		DisplayModePtr mode;
+
+		output->crtc = crtc;
+
+		mode = xf86OutputFindClosestMode(output, scrn->currentMode);
+		if (mode &&
+		    xf86CrtcSetModeTransform(crtc, mode, RR_Rotate_0, NULL, 0, 0)) {
+			crtc->desiredMode = *mode;
+			crtc->desiredMode.prev = crtc->desiredMode.next = NULL;
+			crtc->desiredMode.name = NULL;
+			crtc->desiredMode.PrivSize = 0;
+			crtc->desiredMode.PrivFlags = 0;
+			crtc->desiredMode.Private = NULL;
+			crtc->desiredRotation = RR_Rotate_0;
+			crtc->desiredTransformPresent = FALSE;
+			crtc->desiredX = 0;
+			crtc->desiredY = 0;
+			crtc->enabled = TRUE;
+		}
 	}
 
 	xf86DisableUnusedFunctions(scrn);


More information about the xorg-commit mailing list