xserver: Branch 'server-1.8-branch' - 7 commits

Peter Hutterer whot at kemper.freedesktop.org
Tue May 25 03:06:35 PDT 2010


 dix/devices.c                            |    7 --
 doc/Xserver.man.pre                      |   26 ++-----
 hw/xfree86/common/xf86Xinput.c           |    6 -
 hw/xfree86/doc/Makefile.am               |    1 
 hw/xfree86/os-support/solaris/sun_init.c |  102 ++++++++++++++++++++++++-------
 mi/midispcur.c                           |    2 
 6 files changed, 96 insertions(+), 48 deletions(-)

New commits:
commit 1b71e0a8b9e915c806f6c3596b6ee5913d62fdc3
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon May 24 12:25:15 2010 +1000

    xfree86: fix multiple InputAttributes tag matching.
    
    attr->tags is an array of strings (null-terminated). When matching, match
    against each string instead of each [i,end] substring in the first tag.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit b5e0f6d8f45c5b24eb50b305c66fa80c783ef488)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index a1a5527..bfa8dc0 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -551,9 +551,9 @@ InputClassMatches(XF86ConfInputClassPtr iclass, InputAttributes *attrs)
             return FALSE;
 
         for (cur = iclass->match_tag, match = FALSE; *cur && !match; cur++) {
-            const char *tag;
-            for(tag = *attrs->tags; *tag; tag++) {
-                if (!strcmp(tag, *cur)) {
+            char * const *tag;
+            for(tag = attrs->tags; *tag; tag++) {
+                if (!strcmp(*tag, *cur)) {
                     match = TRUE;
                     break;
                 }
commit f7a2da6df80044bf2d92b0bee94a13f7d76960ad
Merge: 2ab11e0... 354e4ce...
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue May 25 15:52:53 2010 +1000

    Merge branch 'server-1.8-branch' of git://people.freedesktop.org/~alanc/xserver into server-1.8-branch

commit 354e4ce3774d6b7f0c571f426bd2db1c8ab272ea
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat May 22 10:29:00 2010 -0700

    Add RandR 1.2 README.modes doc to EXTRA_DIST
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    (cherry picked from commit 1805c74d9b0ed46802481bcd6beea5feeb60212c)

diff --git a/hw/xfree86/doc/Makefile.am b/hw/xfree86/doc/Makefile.am
index 5809fa0..72bc5d9 100644
--- a/hw/xfree86/doc/Makefile.am
+++ b/hw/xfree86/doc/Makefile.am
@@ -6,4 +6,5 @@ endif
 
 EXTRA_DIST = \
 	README.DRI \
+	README.modes \
 	README.rapidaccess
commit 9a71d21cc27c7b0d35bae9d6dc4eed591dea99a4
Author: Aaron Zang <Aaron.Zang at Sun.COM>
Date:   Thu May 20 17:56:28 2010 -0700

    Solaris: Use VT_SET_CONSUSER ioctl to set Console User rights profile
    
    When Xorg is started on display :0, this ioctl is called to grant the
    user the rights traditionally associated with /dev/console (before VT
    support was added), such as access to local peripheral devices.
    
    Also adds a Solaris-specific -C flag to force starting on /dev/console
    instead of /dev/vt*, allowing programs like xterm -C to access the
    console device.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 989db930d739483759087b13b8d9a043299feafb)

diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
index 5846866..edcc60b 100644
--- a/hw/xfree86/os-support/solaris/sun_init.c
+++ b/hw/xfree86/os-support/solaris/sun_init.c
@@ -33,8 +33,21 @@
 # include <sys/kd.h>
 #endif
 
+/*
+ * Applications see VT number as consecutive integers starting from 1.
+ * VT number			VT device
+ * -------------------------------------------------------
+ *     1             :          /dev/vt/0 (Alt + Ctrl + F1)
+ *     2             :          /dev/vt/2 (Alt + Ctrl + F2)
+ *     3             :          /dev/vt/3 (Alt + Ctrl + F3)
+ *  ... ...
+ */
+#define	CONSOLE_VTNO	1
+#define	SOL_CONSOLE_DEV	"/dev/console"
+
 static Bool KeepTty = FALSE;
 static Bool Protect0 = FALSE;
+static Bool UseConsole = FALSE;
 #ifdef HAS_USL_VTS
 static int VTnum = -1;
 static int xf86StartVT = -1;
@@ -112,8 +125,30 @@ xf86OpenConsole(void)
 		vtEnabled = 0;
 	    }
 	}
+#endif /*  HAS_USL_VTS */
 
+	if (UseConsole)
+	{
+	    strlcpy(consoleDev, SOL_CONSOLE_DEV, sizeof(consoleDev));
+
+#ifdef HAS_USL_VTS
+	    xf86Info.vtno = CONSOLE_VTNO;
 
+	    if (vtEnabled == 0)
+	    {
+		xf86StartVT = 0;
+	    }
+	    else
+	    {
+		if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
+		    FatalError("xf86OpenConsole: Cannot determine current VT\n");
+		xf86StartVT = vtinfo.v_active;
+	    }
+#endif /*  HAS_USL_VTS */
+	    goto OPENCONSOLE;
+	}
+
+#ifdef HAS_USL_VTS
 	if (vtEnabled == 0)
 	{
 	    /* VT not enabled - kernel too old or Sparc platforms
@@ -123,32 +158,31 @@ xf86OpenConsole(void)
 	    xf86StartVT = 0;
 	    xf86Info.vtno = 0;
 	    strlcpy(consoleDev, xf86SolarisFbDev, sizeof(consoleDev));
+	    goto OPENCONSOLE;
 	}
-	else
-	{
-	    if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
-		FatalError("xf86OpenConsole: Cannot determine current VT\n");
 
-	    xf86StartVT = vtinfo.v_active;
+	if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
+	    FatalError("xf86OpenConsole: Cannot determine current VT\n");
 
-	    if (VTnum != -1)
-	    {
-		xf86Info.vtno = VTnum;
-		from = X_CMDLINE;
-	    }
-	    else
+	xf86StartVT = vtinfo.v_active;
+
+	if (VTnum != -1)
+	{
+	    xf86Info.vtno = VTnum;
+	    from = X_CMDLINE;
+	}
+	else
+	{
+	    if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
+		(xf86Info.vtno == -1))
 	    {
-		if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
-		    (xf86Info.vtno == -1))
-		{
-		    FatalError("xf86OpenConsole: Cannot find a free VT\n");
-		}
+		FatalError("xf86OpenConsole: Cannot find a free VT\n");
 	    }
-
-	    xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
-	    snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno);
 	}
 
+	xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
+	snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno);
+
 	if (fd != -1)
 	{
 	    close(fd);
@@ -156,6 +190,7 @@ xf86OpenConsole(void)
 
 #endif /* HAS_USL_VTS */
 
+OPENCONSOLE:
 	if (!KeepTty)
 	    setpgrp();
 
@@ -163,11 +198,10 @@ xf86OpenConsole(void)
 	    FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
 		       consoleDev, strerror(errno));
 
-#ifdef HAS_USL_VTS
-
-	/* Change ownership of the vt */
+	/* Change ownership of the vt or console */
 	chown(consoleDev, getuid(), getgid());
 
+#ifdef HAS_USL_VTS
 	if (vtEnabled)
 	{
 	    /*
@@ -179,6 +213,13 @@ xf86OpenConsole(void)
 	    if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
 		xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
 
+#ifdef VT_SET_CONSUSER /* added in snv_139 */
+	    if (strcmp(display, "0") == 0)
+		if (ioctl(xf86Info.consoleFd, VT_SET_CONSUSER) != 0)
+		    xf86Msg(X_WARNING,
+			"xf86OpenConsole: VT_SET_CONSUSER failed\n");
+#endif
+
 	    if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
 		FatalError("xf86OpenConsole: VT_GETMODE failed\n");
 
@@ -220,6 +261,13 @@ xf86OpenConsole(void)
 	    if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
 		xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
 
+#ifdef VT_SET_CONSUSER /* added in snv_139 */
+	    if (strcmp(display, "0") == 0)
+		if (ioctl(xf86Info.consoleFd, VT_SET_CONSUSER) != 0)
+		    xf86Msg(X_WARNING,
+			"xf86OpenConsole: VT_SET_CONSUSER failed\n");
+#endif
+
 	    /*
 	     * If the server doesn't have the VT when the reset occurs,
 	     * this is to make sure we don't continue until the activate
@@ -330,6 +378,15 @@ xf86ProcessArgument(int argc, char **argv, int i)
 	return 1;
     }
 
+    /*
+     * Use /dev/console as the console device.
+     */
+    if (!strcmp(argv[i], "-C"))
+    {
+	UseConsole = TRUE;
+	return 1;
+    }
+
 #ifdef HAS_USL_VTS
 
     if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
@@ -364,4 +421,5 @@ void xf86UseMsg()
     ErrorF("-dev <fb>              Framebuffer device\n");
     ErrorF("-keeptty               Don't detach controlling tty\n");
     ErrorF("                       (for debugging only)\n");
+    ErrorF("-C                     Use /dev/console as the console device\n");
 }
commit a8d40f61bf42a55fbd4fcd6468c94cb595e490cc
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Thu May 20 17:56:26 2010 -0700

    Xserver(1) man page updates
    
    - Note that -br is now default.
    - Move -bs after -br for alphabetical ordering.
    - Remove -config option that's been hidden in "ignore" section,
      since ajax removed the -config code a couple years back.
    - Add -nocursor option.
    - Add xinput & xrandr to list of runtime server control programs
    - Replace XDarwin with Xquartz in list of Xservers
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 7b09335a46f9428141811230c69eef7968531359)

diff --git a/doc/Xserver.man.pre b/doc/Xserver.man.pre
index 8144c8a..ce3b3a1 100644
--- a/doc/Xserver.man.pre
+++ b/doc/Xserver.man.pre
@@ -100,12 +100,12 @@ specifies a file which contains a collection of authorization records used
 to authenticate access.  See also the \fIxdm\fP(1) and 
 \fIXsecurity\fP(__miscmansuffix__) manual pages.
 .TP 8
-.B \-bs
-disables backing store support on all screens.
-.TP 8
 .B \-br
 sets the default root window to solid black instead of the standard root weave
-pattern.
+pattern.   This is the default unless -retro or -wr is specified.
+.TP 8
+.B \-bs
+disables backing store support on all screens.
 .TP 8
 .B \-c
 turns off key-click.
@@ -117,17 +117,6 @@ sets key-click volume (allowable range: 0-100).
 sets the visual class for the root window of color screens.
 The class numbers are as specified in the X protocol.
 Not obeyed by all servers.
-.ig
-.TP 8
-.B \-config \fIfilename\fP
-reads more options from the given file.  Options in the file may be separated
-by newlines if desired.  If a '#' character appears on a line, all characters
-between it and the next newline are ignored, providing a simple commenting
-facility.  The \fB\-config\fP option itself may appear in the file.
-.BR NOTE :
-This option is disabled when the Xserver is run with an effective uid
-different from the user's real uid.
-..
 .TP 8
 .B \-core
 causes the server to generate a core dump on fatal errors.
@@ -184,6 +173,9 @@ sets the maximum big request to
 .I size
 MB.
 .TP 8
+.B \-nocursor
+disable the display of the pointer cursor.
+.TP 8
 .B \-nolisten \fItrans-type\fP
 disables a transport type.  For example, TCP/IP connections can be disabled
 with
@@ -584,11 +576,11 @@ Security: \fIXsecurity\fP(__miscmansuffix__), \fIxauth\fP(1), \fIXau\fP(1),
 Starting the server: \fIstartx\fP(1), \fIxdm\fP(1), \fIxinit\fP(1)
 .PP
 Controlling the server once started: \fIxset\fP(1), \fIxsetroot\fP(1),
-\fIxhost\fP(1)
+\fIxhost\fP(1), \fIxinput\fP(1), \fIxrandr\fP(1)
 .PP
 Server-specific man pages:
 \fIXorg\fP(1), \fIXdmx\fP(1), \fIXephyr\fP(1), \fIXnest\fP(1),
-\fIXvfb\fP(1), \fIXDarwin\fP(1), \fIXWin\fP(1).
+\fIXvfb\fP(1), \fIXquartz\fP(1), \fIXWin\fP(1).
 .PP
 Server internal documentation:
 .I "Definition of the Porting Layer for the X v11 Sample Server"
commit 2ab11e09734dec4f119166fa6512eb25b4572e48
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri May 21 13:30:25 2010 +1000

    dix: remove obsolete comment.from EnableDevice.
    
    The code this comment was referring to was removed in
    8b5086250aa5dae8de8b763408ff480d7beac819 "Eliminate bogus event resizing."
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit cf4f3d051858aadedd6e333bb317a1daa3987ad7)

diff --git a/dix/devices.c b/dix/devices.c
index 042f12f..b55df16 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -318,10 +318,6 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
         }
     }
 
-    /* Before actually enabling the device, we need to make sure the event
-     * list's events have enough memory for a ClassesChangedEvent from the
-     * device
-     */
     if ((*prev != dev) || !dev->inited ||
 	((ret = (*dev->deviceProc)(dev, DEVICE_ON)) != Success)) {
         ErrorF("[dix] couldn't enable device %d\n", dev->id);
commit 869d37721425d219c50962b694c3326407d1d2e6
Author: Jamey Sharp <jamey at minilop.net>
Date:   Wed May 19 10:44:33 2010 -0700

    Device init: Don't crash when CreateGC fails.
    
    ActivateDevice was ignoring errors from DeviceCursorInitialize, so
    cursor-related calls failed later. Jeremy Huddleston saw that crash in
    miPointerConstrainCursor, while with Xvfb I saw it in
    miSpriteRealizeCursor.
    
    miDCDeviceCleanup frees any non-NULL GCs. miDCDeviceInitialize calls
    Cleanup on any failure, but if it failed early then some of the pointers
    in the miDCBufferPtr were garbage. Switch from malloc to calloc to
    ensure everything's initialized safely first.
    
    With these two fixes, if CreateGC fails then the server gracefully fails
    in FatalError instead of segfaulting.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Cc: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    
    (cherry-picked from commit b9f48d60bc0c839bd323c582231e8e7e2b810af6)

diff --git a/dix/devices.c b/dix/devices.c
index 32e067b..042f12f 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -474,7 +474,8 @@ ActivateDevice(DeviceIntPtr dev, BOOL sendevent)
 
     /* Initialize memory for sprites. */
     if (IsMaster(dev) && dev->spriteInfo->spriteOwner)
-        pScreen->DeviceCursorInitialize(dev, pScreen);
+        if (!pScreen->DeviceCursorInitialize(dev, pScreen))
+            ret = BadAlloc;
 
     SendDevicePresenceEvent(dev->id, DeviceAdded);
     if (sendevent)
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 9041630..54a6787 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -780,7 +780,7 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
     {
         pScreen = screenInfo.screens[i];
 
-        pBuffer = xalloc(sizeof(miDCBufferRec));
+        pBuffer = xcalloc(1, sizeof(miDCBufferRec));
         if (!pBuffer)
             goto failure;
 


More information about the xorg-commit mailing list