xf86-video-intel: Branch 'modesetting' - src/i830_dvo.c src/i830_lvds.c src/i830_sdvo.c src/i830_xf86Crtc.c src/i830_xf86Crtc.h

Keith Packard keithp at kemper.freedesktop.org
Wed Dec 13 21:40:17 EET 2006


 src/i830_dvo.c      |    2 +-
 src/i830_lvds.c     |    2 +-
 src/i830_sdvo.c     |   10 ++++++++++
 src/i830_xf86Crtc.c |   17 +++++++++++++++++
 src/i830_xf86Crtc.h |    3 +++
 5 files changed, 32 insertions(+), 2 deletions(-)

New commits:
diff-tree df0a5a25aa72563a33731f8063602dd7faad8459 (from 4cdcaac26b3f425ec8fcc2fd3eaa9bfb7a137422)
Author: Keith Packard <keithp at bouzouki.jf.intel.com>
Date:   Wed Dec 13 11:38:18 2006 -0800

    Rename outputs to TMDS-1/TMDS-2, LVDS, TV and VGA.
    
    These names are reasonably short and describe the connector rather than the
    target media, but we don't appear to have any way to determine what is on
    the other end of the wire. More importantly, they're all unique now.

diff --git a/src/i830_dvo.c b/src/i830_dvo.c
index 25ced63..ed8d1c7 100644
--- a/src/i830_dvo.c
+++ b/src/i830_dvo.c
@@ -246,7 +246,7 @@ i830_dvo_init(ScrnInfoPtr pScrn)
     int			    ret;
 
     output = xf86OutputCreate (pScrn, &i830_dvo_output_funcs,
-				   "ADD AGP card");
+				   "TMDS");
     if (!output)
 	return;
     intel_output = xnfcalloc (sizeof (I830OutputPrivateRec), 1);
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 90f785e..4027a25 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -311,7 +311,7 @@ i830_lvds_init(ScrnInfoPtr pScrn)
 	}
    }
 
-    output = xf86OutputCreate (pScrn, &i830_lvds_output_funcs, "Built-in LCD panel");
+    output = xf86OutputCreate (pScrn, &i830_lvds_output_funcs, "LVDS");
     if (!output)
 	return;
     intel_output = xnfcalloc (sizeof (I830OutputPrivateRec), 1);
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index da4df92..90a62c0 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1053,6 +1053,9 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int ou
     int			    i;
     unsigned char	    ch[0x40];
     I2CBusPtr		    i2cbus = NULL, ddcbus;
+    char		    name[60];
+    char		    *name_prefix;
+    char		    *name_suffix;
 
     output = xf86OutputCreate (pScrn, &i830_sdvo_output_funcs,
 			       "ADD2 PCIE card");
@@ -1087,9 +1090,11 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int ou
     if (output_device == SDVOB) {
 	dev_priv->d.DevName = "SDVO Controller B";
 	dev_priv->d.SlaveAddr = 0x70;
+	name_suffix="-1";
     } else {
 	dev_priv->d.DevName = "SDVO Controller C";
 	dev_priv->d.SlaveAddr = 0x72;
+	name_suffix="-2";
     }
     dev_priv->d.pI2CBus = i2cbus;
     dev_priv->d.DriverPrivate.ptr = output;
@@ -1158,11 +1163,13 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int ou
     {
 	dev_priv->active_outputs = SDVO_OUTPUT_TMDS0;
         output->subpixel_order = SubPixelHorizontalRGB;
+	name_prefix="TMDS";
     }
     else if (dev_priv->caps.output_flags & SDVO_OUTPUT_TMDS1)
     {
 	dev_priv->active_outputs = SDVO_OUTPUT_TMDS1;
         output->subpixel_order = SubPixelHorizontalRGB;
+	name_prefix="TMDS";
     }
     else
     {
@@ -1174,6 +1181,9 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int ou
 		   SDVO_NAME(dev_priv),
 		   bytes[0], bytes[1]);
     }
+    strcpy (name, name_prefix);
+    strcat (name, name_suffix);
+    xf86OutputRename (output, name);
     
     /* Set the input timing to the screen. Assume always input 0. */
     i830_sdvo_set_target_input(output, TRUE, FALSE);
diff --git a/src/i830_xf86Crtc.c b/src/i830_xf86Crtc.c
index 6f96d44..25657e6 100644
--- a/src/i830_xf86Crtc.c
+++ b/src/i830_xf86Crtc.c
@@ -105,6 +105,21 @@ xf86OutputCreate (ScrnInfoPtr		    scrn,
 }
 
 void
+xf86OutputRename (xf86OutputPtr output, const char *name)
+{
+    int	    len = strlen(name);
+    char    *newname = xalloc (len + 1);
+    
+    if (!newname)
+	return;	/* so sorry... */
+    
+    strcpy (newname, name);
+    if (output->name != (char *) (output + 1))
+	xfree (output->name);
+    output->name = newname;
+}
+
+void
 xf86OutputDestroy (xf86OutputPtr output)
 {
     ScrnInfoPtr		scrn = output->scrn;
@@ -123,6 +138,8 @@ xf86OutputDestroy (xf86OutputPtr output)
 	    xf86_config->num_output--;
 	    break;
 	}
+    if (output->name != (char *) (output + 1))
+	xfree (output->name);
     xfree (output);
 }
 
diff --git a/src/i830_xf86Crtc.h b/src/i830_xf86Crtc.h
index 042cb2f..f2c2429 100644
--- a/src/i830_xf86Crtc.h
+++ b/src/i830_xf86Crtc.h
@@ -367,6 +367,9 @@ xf86OutputCreate (ScrnInfoPtr		scrn,
 		      const char	*name);
 
 void
+xf86OutputRename (xf86OutputPtr output, const char *name);
+
+void
 xf86OutputDestroy (xf86OutputPtr	output);
 
 void



More information about the xorg-commit mailing list