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

Keith Packard keithp at kemper.freedesktop.org
Fri Dec 1 20:08:52 EET 2006


 src/i830_driver.c |   30 ++++++++++++++++++++----------
 src/i830_tv.c     |   27 +++++++++++++--------------
 2 files changed, 33 insertions(+), 24 deletions(-)

New commits:
diff-tree e603cd0c73344ef137d3276b5cfcbcf4df340778 (from ec30356d950199903978265076b8a4e3960cf84f)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Fri Dec 1 10:08:36 2006 -0800

    Leave detected TV status alone when no free CRTC is available.
    
    Yes, this means not detecting TV hotplug when two outputs are
    already running. An alternative would be to turn off one of the other
    outputs temporarily, but that would cause flashing. Something to consider.

diff --git a/src/i830_tv.c b/src/i830_tv.c
index f7d9207..f5716f8 100644
--- a/src/i830_tv.c
+++ b/src/i830_tv.c
@@ -473,7 +473,7 @@ static const DisplayModeRec tvModes[] = 
  * \return TRUE if TV is connected.
  * \return FALSE if TV is disconnected.
  */
-static int
+static void
 i830_tv_detect_type (xf86CrtcPtr    crtc,
 		     xf86OutputPtr  output)
 {
@@ -536,7 +536,6 @@ i830_tv_detect_type (xf86CrtcPtr    crtc
     }
     
     dev_priv->type = type;
-    return type;
 }
 
 /**
@@ -548,25 +547,25 @@ i830_tv_detect_type (xf86CrtcPtr    crtc
 static enum detect_status
 i830_tv_detect(xf86OutputPtr output)
 {
-    xf86CrtcPtr	    crtc;
+    xf86CrtcPtr		    crtc;
     DisplayModeRec	    mode;
     I830OutputPrivatePtr    intel_output = output->driver_private;
-    int			    type;
+    struct i830_tv_priv	    *dev_priv = intel_output->dev_priv;
 
     crtc = i830GetLoadDetectPipe (output);
-    if (!crtc)
-	return OUTPUT_STATUS_UNKNOWN;
-    
-    if (intel_output->load_detect_temp)
+    if (crtc)
     {
-	mode = tvModes[0];
-	xf86SetModeCrtc (&mode, INTERLACE_HALVE_V);
-	i830PipeSetMode (crtc, &mode, FALSE);
+	if (intel_output->load_detect_temp)
+	{
+	    mode = tvModes[0];
+	    xf86SetModeCrtc (&mode, INTERLACE_HALVE_V);
+	    i830PipeSetMode (crtc, &mode, FALSE);
+	}
+	i830_tv_detect_type (crtc, output);
+	i830ReleaseLoadDetectPipe (output);
     }
-    type = i830_tv_detect_type (crtc, output);
-    i830ReleaseLoadDetectPipe (output);
     
-    switch (type) {
+    switch (dev_priv->type) {
     case TV_TYPE_NONE:
 	return OUTPUT_STATUS_DISCONNECTED;
     case TV_TYPE_UNKNOWN:
diff-tree ec30356d950199903978265076b8a4e3960cf84f (from 7642da82781826cb3b45078750cc54d8f592893a)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Fri Dec 1 10:06:29 2006 -0800

    Do output detection before any crtc allocation.
    
    Some output detection requires a crtc for load detection, perform all of the
    output detection before allocating any crtcs so that there will be a free
    crtc for any load detection. Avoids losing TV detection when two monitors
    are connected.

diff --git a/src/i830_driver.c b/src/i830_driver.c
index c5e56e5..3aafe3a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -880,6 +880,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
 #ifdef XF86DRI
    unsigned long savedMMSize;
 #endif
+   enum detect_status output_status[MAX_OUTPUTS];
 
    if (pScrn->numEntities != 1)
       return FALSE;
@@ -1369,8 +1370,21 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
       xf86CrtcPtr	      crtc;
       int		      p;
 
+      output_status[i] = (*output->funcs->detect) (output);
+   }
+   
+   for (i = 0; i < pI830->xf86_config.num_output; i++) 
+   {
+      xf86OutputPtr	      output = pI830->xf86_config.output[i];
+      I830OutputPrivatePtr    intel_output = output->driver_private;
+      xf86CrtcPtr	      crtc;
+      int		      p;
+
       output->crtc = NULL;
 
+      if (output_status[i] == OUTPUT_STATUS_DISCONNECTED)
+	 continue;
+      
       switch (intel_output->type) {
       case I830_OUTPUT_LVDS:
 	 /* LVDS must live on pipe B for two-pipe devices */
@@ -1381,23 +1395,19 @@ I830PreInit(ScrnInfoPtr pScrn, int flags
       case I830_OUTPUT_ANALOG:
       case I830_OUTPUT_DVO:
       case I830_OUTPUT_SDVO:
-	 if ((*output->funcs->detect)(output) != OUTPUT_STATUS_DISCONNECTED) 
+	 for (p = 0; p < pI830->xf86_config.num_crtc; p++)
 	 {
-	    for (p = 0; p < pI830->xf86_config.num_crtc; p++)
+	    crtc = pI830->xf86_config.crtc[p];
+	    if (!i830PipeInUse(crtc))
 	    {
-	       crtc = pI830->xf86_config.crtc[p];
-	       if (!i830PipeInUse(crtc))
-	       {
-		  output->crtc = crtc;
-		  break;
-	       }
+	       output->crtc = crtc;
+	       break;
 	    }
 	 }
 	 break;
       case I830_OUTPUT_TVOUT:
 	 crtc = pI830->xf86_config.crtc[0];
-	 if ((*output->funcs->detect)(output) != OUTPUT_STATUS_DISCONNECTED &&
-	     !i830PipeInUse(crtc))
+	 if (!i830PipeInUse(crtc))
 	 {
 	    output->crtc = crtc;
 	 }



More information about the xorg-commit mailing list