xf86-video-intel: Branch 'modesetting' - 2 commits - src/i830_display.c src/i830_display.h src/i830_driver.c

Eric Anholt anholt at kemper.freedesktop.org
Thu Nov 9 05:39:43 EET 2006


 src/i830_display.c |    8 ++++----
 src/i830_display.h |    1 +
 src/i830_driver.c  |   24 ++++++++++++++++++------
 3 files changed, 23 insertions(+), 10 deletions(-)

New commits:
diff-tree 9b267014b55f49d9362c1d432d6ba19ddd0ad95d (from 35ab689bbde5f74752598cd743d735640486b639)
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Nov 8 19:39:18 2006 -0800

    Go back to only setting up outputs that have a display connected.

diff --git a/src/i830_display.c b/src/i830_display.c
index 893b9b0..72037c4 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -723,7 +723,7 @@ i830DisableUnusedFunctions(ScrnInfoPtr p
  * Return whether any outputs are connected to the specified pipe
  */
 
-static Bool
+Bool
 i830PipeInUse (ScrnInfoPtr pScrn, int pipe)
 {
     I830Ptr pI830 = I830PTR(pScrn);
diff --git a/src/i830_display.h b/src/i830_display.h
index 5c0f133..67f3c7b 100644
--- a/src/i830_display.h
+++ b/src/i830_display.h
@@ -35,3 +35,4 @@ void i830WaitForVblank(ScrnInfoPtr pScrn
 void i830DescribeOutputConfiguration(ScrnInfoPtr pScrn);
 int i830GetLoadDetectPipe(ScrnInfoPtr pScrn, I830OutputPtr output);
 void i830ReleaseLoadDetectPipe(ScrnInfoPtr pScrn, I830OutputPtr output);
+Bool i830PipeInUse(ScrnInfoPtr pScrn, int pipe);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index e6cd9bc..75c3b0e 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1355,19 +1355,27 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
     * we have better configuration support in the generic RandR code
     */
    for (i = 0; i < pI830->num_outputs; i++) {
-      pI830->output[i].disabled = FALSE;
+      pI830->output[i].disabled = TRUE;
 
       switch (pI830->output[i].type) {
       case I830_OUTPUT_LVDS:
-	 /* LVDS must live on pipe B for two-pipe devices */
-	 pI830->output[i].pipe = pI830->availablePipes - 1;
+	 /* LVDS must always be on pipe B. */
+	 pI830->output[i].pipe = 1;
+	 pI830->output[i].disabled = FALSE;
 	 break;
       case I830_OUTPUT_ANALOG:
-	 pI830->output[i].pipe = 0;
-	 break;
       case I830_OUTPUT_DVO:
       case I830_OUTPUT_SDVO:
-	 pI830->output[i].pipe = 0;
+	 if (pI830->output[i].detect(pScrn, &pI830->output[i]) !=
+	     OUTPUT_STATUS_DISCONNECTED) {
+	    if (!i830PipeInUse(pScrn, 0)) {
+	       pI830->output[i].pipe = 0;
+	       pI830->output[i].disabled = FALSE;
+	    } else if (!i830PipeInUse(pScrn, 1)) {
+	       pI830->output[i].pipe = 1;
+	       pI830->output[i].disabled = FALSE;
+	    }
+	 }
 	 break;
       default:
 	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unhandled output type\n");
@@ -1375,6 +1383,10 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
       }
    }
 
+   for (i = 0; i < pI830->availablePipes; i++) {
+      pI830->pipes[i].planeEnabled = i830PipeInUse(pScrn, i);
+   }
+
 #if 0
    pI830->CloneRefresh = 60; /* default to 60Hz */
    if (xf86GetOptValInteger(pI830->Options, OPTION_CLONE_REFRESH,
diff-tree 35ab689bbde5f74752598cd743d735640486b639 (from f1ff01e31eb8e9dc05190bf1a8b318d4f587f64a)
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Nov 8 19:35:49 2006 -0800

    Fix i830DisableUnusedFunctions after pipe structure change.
    
    Using "pipe" instead of the index "i" meant pipe(3) got referenced instead of
    a nice small integer.  Oops.

diff --git a/src/i830_display.c b/src/i830_display.c
index c1fc562..893b9b0 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -666,7 +666,7 @@ void
 i830DisableUnusedFunctions(ScrnInfoPtr pScrn)
 {
     I830Ptr pI830 = I830PTR(pScrn);
-    int i;
+    int i, pipe;
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling unused functions\n");
 
@@ -679,8 +679,8 @@ i830DisableUnusedFunctions(ScrnInfoPtr p
      * internal TV) should have no outputs trying to pull data out of it, so
      * we're ready to turn those off.
      */
-    for (i = 0; i < pI830->availablePipes; i++) {
-	I830PipePtr pI830Pipe = &pI830->pipes[i];
+    for (pipe = 0; pipe < pI830->availablePipes; pipe++) {
+	I830PipePtr pI830Pipe = &pI830->pipes[pipe];
 	int	    dspcntr_reg = pipe == 0 ? DSPACNTR : DSPBCNTR;
 	int	    pipeconf_reg = pipe == 0 ? PIPEACONF : PIPEBCONF;
 	int	    dpll_reg = pipe == 0 ? DPLL_A : DPLL_B;



More information about the xorg-commit mailing list