[Xquartz-changes] xserver: Branch 'for-keith' - 22 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Tue Oct 4 19:46:41 PDT 2011


 config/Makefile.am                        |    6 
 config/config-backends.h                  |    5 
 config/config.c                           |    5 
 config/wscons.c                           |  268 ++++++++++++++++++++++++++++++
 configure.ac                              |   16 +
 dix/dixfonts.c                            |   30 +--
 doc/Xinput.xml                            |   26 +-
 doc/Xserver-spec.xml                      |   23 +-
 fb/fbpict.c                               |    3 
 hw/xfree86/Makefile.am                    |    2 
 hw/xfree86/common/xf86Config.c            |   19 --
 hw/xfree86/common/xf86Globals.c           |    4 
 hw/xfree86/common/xf86Privstr.h           |    3 
 hw/xfree86/common/xf86Xinput.c            |    3 
 hw/xfree86/doc/ddxDesign.xml              |   10 -
 hw/xfree86/man/xorg.conf.man              |   12 -
 hw/xfree86/os-support/bsd/alpha_video.c   |    2 
 hw/xfree86/os-support/bsd/arm_video.c     |    6 
 hw/xfree86/os-support/bsd/bsd_bell.c      |    4 
 hw/xfree86/os-support/bsd/bsd_init.c      |   51 +----
 hw/xfree86/os-support/bsd/i386_video.c    |    2 
 hw/xfree86/os-support/bsd/ppc_video.c     |    4 
 hw/xfree86/os-support/bsd/sparc64_video.c |    2 
 hw/xfree86/os-support/xf86_OSlib.h        |   42 +---
 hw/xfree86/parser/xf86tokens.h            |    2 
 25 files changed, 382 insertions(+), 168 deletions(-)

New commits:
commit 8eef995d9c10a5f1135c7b7a9d56c3c0020b6f8f
Author: Kirill Elagin <kirelagin at gmail.com>
Date:   Tue Oct 4 23:02:20 2011 +0400

    Fix server crash due to invalid images
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=39383
    
    Signed-off-by: Kirill Elagin <kirelagin at gmail.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/fb/fbpict.c b/fb/fbpict.c
index d1fd0cb..d3b63ed 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -163,6 +163,9 @@ create_bits_picture (PicturePtr pict,
 	(pixman_format_code_t)pict->format,
 	pixmap->drawable.width, pixmap->drawable.height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
+
+    if (!image)
+        return NULL
     
     
 #ifdef FB_ACCESS_WRAPPER
commit 7a33c5b934382b5554f41ab1502514e91c9bc52e
Author: Alan Hourihane <alanh at vmware.com>
Date:   Tue Oct 4 19:42:46 2011 -0700

    dixfonts: Don't overwrite local c variable until new_closure is safely initialized.
    
    Signed-off-by: Alan Hourihane <alanh at vmware.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index fbac124..d2bcb84 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1302,31 +1302,30 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 			goto bail;
 		    }
 		    *new_closure = *c;
-		    c = new_closure;
 
-		    len = c->endReq - c->pElt;
-		    c->data = malloc(len);
-		    if (!c->data)
+		    len = new_closure->endReq - new_closure->pElt;
+		    new_closure->data = malloc(len);
+		    if (!new_closure->data)
 		    {
-			free(c);
+			free(new_closure);
 			err = BadAlloc;
 			goto bail;
 		    }
-		    memmove(c->data, c->pElt, len);
-		    c->pElt = c->data;
-		    c->endReq = c->pElt + len;
+		    memmove(new_closure->data, new_closure->pElt, len);
+		    new_closure->pElt = new_closure->data;
+		    new_closure->endReq = new_closure->pElt + len;
 
 		    /* Step 2 */
 
-		    pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
+		    pGC = GetScratchGC(new_closure->pGC->depth, new_closure->pGC->pScreen);
 		    if (!pGC)
 		    {
-			free(c->data);
-			free(c);
+			free(new_closure->data);
+			free(new_closure);
 			err = BadAlloc;
 			goto bail;
 		    }
-		    if ((err = CopyGC(c->pGC, pGC, GCFunction |
+		    if ((err = CopyGC(new_closure->pGC, pGC, GCFunction |
 				      GCPlaneMask | GCForeground |
 				      GCBackground | GCFillStyle |
 				      GCTile | GCStipple |
@@ -1337,15 +1336,16 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 				      Success)
 		    {
 			FreeScratchGC(pGC);
-			free(c->data);
-			free(c);
+			free(new_closure->data);
+			free(new_closure);
 			err = BadAlloc;
 			goto bail;
 		    }
+		    c = new_closure;
 		    origGC = c->pGC;
 		    c->pGC = pGC;
 		    ValidateGC(c->pDraw, c->pGC);
-		    
+
 		    ClientSleep(client, (ClientSleepProcPtr)doPolyText, c);
 
 		    /* Set up to perform steps 3 and 4 */
commit 6378d0233d21088b6429755627b4253859892c72
Merge: 6e965d8... 98b2306...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Oct 3 13:56:06 2011 -0700

    Merge remote-tracking branch 'herrb/master'

commit 6e965d8a185087a55b2100b817e18f05b3ce5a00
Merge: 466e4b3... ac5881d...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Oct 3 13:47:49 2011 -0700

    Merge remote-tracking branch 'koba/reviewed'

commit 466e4b3f174bdd7a69a76eb06e6c3e3344b8adc2
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Sep 30 07:21:57 2011 -0400

    Xserver-spec: use appropriate copyright markup
    
    Use docbook copyright markup for year and holder.
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index aabd262..37fd2b2 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -44,8 +44,9 @@
     <publisher><publishername>The X.Org Foundation</publishername></publisher>
     <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
     <releaseinfo>X server version &xserver.version;</releaseinfo>
+    <copyright><year>1994</year><holder>X Consortium, Inc.</holder></copyright>
+    <copyright><year>2004</year><holder>X.org Foundation, Inc.</holder></copyright>
     <legalnotice>
-      <para>Copyright &#xA9; 1994 X Consortium, Inc., 2004 X.org Foundation, Inc.</para>
       <para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</para>
       <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
       <para>THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</para>
commit 62940bf38f70e3d9fb80521de40d6361548a0ea5
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Sep 30 07:21:56 2011 -0400

    Xserver-spec: re-order markup to follow outpout order
    
    No content change, no layout/ordering change.
    It is easier to find <title> at the top.
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index 30c6127..aabd262 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -7,6 +7,8 @@
 
 <article>
   <articleinfo>
+    <title>Definition of the Porting Layer for the X v11 Sample Server</title>
+    <titleabbrev>X Porting Layer</titleabbrev>
     <author>
       <firstname>Susan</firstname><surname>Angebranndt</surname>
       <affiliation><orgname>Digital Equipment Corporation</orgname></affiliation>
@@ -40,11 +42,16 @@
       <affiliation><orgname>X.org Foundation and Hewlett Packard</orgname></affiliation>
     </author>
     <publisher><publishername>The X.Org Foundation</publishername></publisher>
-    <pubdate>&xserver.reldate;</pubdate>
     <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
     <releaseinfo>X server version &xserver.version;</releaseinfo>
-    <title>Definition of the Porting Layer for the X v11 Sample Server</title>
-    <titleabbrev>X Porting Layer</titleabbrev>
+    <legalnotice>
+      <para>Copyright &#xA9; 1994 X Consortium, Inc., 2004 X.org Foundation, Inc.</para>
+      <para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</para>
+      <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
+      <para>THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</para>
+      <para>LK201 and DEC are trademarks of Digital Equipment Corporation.  Macintosh and Apple are trademarks of Apple Computer, Inc.  PostScript is a trademark of Adobe Systems, Inc.  Ethernet is a trademark of Xerox Corporation.  X Window System is a trademark of the X.org Foundation, Inc.  Cray is a trademark of Cray Research, Inc.</para>
+    </legalnotice>
+    <pubdate>&xserver.reldate;</pubdate>
     <revhistory>
       <revision>
 	<revnumber>1.0</revnumber>
@@ -102,13 +109,6 @@
 	  and 1.8 CreateNewResourceType changes</revremark>
       </revision>
     </revhistory>
-    <legalnotice>
-      <para>Copyright &#xA9; 1994 X Consortium, Inc., 2004 X.org Foundation, Inc.</para>
-      <para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</para>
-      <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
-      <para>THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</para>
-      <para>LK201 and DEC are trademarks of Digital Equipment Corporation.  Macintosh and Apple are trademarks of Apple Computer, Inc.  PostScript is a trademark of Adobe Systems, Inc.  Ethernet is a trademark of Xerox Corporation.  X Window System is a trademark of the X.org Foundation, Inc.  Cray is a trademark of Cray Research, Inc.</para>
-    </legalnotice>
     <abstract>
       <para>The following document explains the structure of the X Window System display server and the interfaces among the larger pieces.  It is intended as a reference for programmers who are implementing an X Display Server on their workstation hardware.  It is included with the X Window System source tape, along with the document "Strategies for Porting the X v11 Sample Server."  The order in which you should read these documents is:
       <orderedlist>
commit 365bc2f5b132ac76a1f827923a99a75b33b158ac
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Sep 30 07:21:55 2011 -0400

    Xserver-spec: add release information
    
    It has been added in all docs (X Version 11, Release 7.6)
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index b14e489..30c6127 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+ <!ENTITY % xorg-defs SYSTEM "defs.ent"> %xorg-defs;
  <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
 ]>
 
@@ -40,6 +41,7 @@
     </author>
     <publisher><publishername>The X.Org Foundation</publishername></publisher>
     <pubdate>&xserver.reldate;</pubdate>
+    <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
     <releaseinfo>X server version &xserver.version;</releaseinfo>
     <title>Definition of the Porting Layer for the X v11 Sample Server</title>
     <titleabbrev>X Porting Layer</titleabbrev>
commit ee3e26079e120bf9914cc27871d50501b35e75df
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Sep 30 07:16:34 2011 -0400

    ddxDesign: drop the url in the coporate authors list
    
    It was such an eyesore once rendered in html.
    Now it looks like other authors.
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index af8f901..a4baad5 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -23,10 +23,8 @@
     <title>XFree86 DDX Design</title>
 
     <authorgroup>
-      <corpauthor><ulink url="http://www.xfree86.org/">
-	The XFree86 Project, Inc.</ulink></corpauthor>
-      <corpauthor><ulink url="http://www.x.org/">
-	The X.Org Foundation, Inc.</ulink></corpauthor>
+      <corpauthor>The XFree86 Project</corpauthor>
+      <corpauthor>The X.Org Foundation</corpauthor>
 
       <othercredit>
 	<firstname>Jim</firstname><surname>Gettys</surname>
commit 0ed71b48c0c7bd65cd05eda6c06b9c29b4e3f607
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Sep 30 07:16:33 2011 -0400

    ddxDesign: remove server version from the document title
    
    Such version information is already written in the appropriate location
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index a564716..af8f901 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -20,7 +20,7 @@
 <article id="ddxDesign">
   <articleinfo>
 
-    <title>XFree86 DDX Design (Xorg server version &xserver.version;)</title>
+    <title>XFree86 DDX Design</title>
 
     <authorgroup>
       <corpauthor><ulink url="http://www.xfree86.org/">
commit 83ec3bf1aa72848421660c44c4503fec655f5924
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Sep 30 07:16:32 2011 -0400

    ddx-Design: add X Version and Release information
    
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index bc25c56..a564716 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+ <!ENTITY % xorg-defs SYSTEM "defs.ent"> %xorg-defs;
  <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
  <!-- config file keyword markup -->
  <!-- specific config file keywords -->
@@ -34,6 +35,7 @@
     </authorgroup>
 
     <pubdate>&xserver.reldate;</pubdate>
+    <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
     <releaseinfo>Xorg server version &xserver.version;</releaseinfo>
 
   </articleinfo>
commit 2f09f6e3f610e585aeb5bd1023323a909d1ba20d
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Thu Sep 29 07:53:16 2011 -0400

    Xinput: use appropriate copyright markup for a multi licensed doc
    
    Removed a duplicate paragraph.
    
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/doc/Xinput.xml b/doc/Xinput.xml
index 87c6d7f..0a7ec8d 100644
--- a/doc/Xinput.xml
+++ b/doc/Xinput.xml
@@ -16,16 +16,9 @@
       </author>
    </authorgroup>
    <releaseinfo>X server version &xserver.version;</releaseinfo>
-   <corpname>X Consortium Standard</corpname>
-   <copyright><year>1989</year><holder>Hewlett-Packard Company</holder></copyright>
-   <copyright><year>1990</year><holder>Hewlett-Packard Company</holder></copyright>
-   <copyright><year>1991</year><holder>Hewlett-Packard Company</holder></copyright>
-
-   <copyright><year>1989</year><holder>X Consortium</holder></copyright>
-   <copyright><year>1990</year><holder>X Consortium</holder></copyright>
-   <copyright><year>1991</year><holder>X Consortium</holder></copyright>
-   <affiliation><orgname>X Consortium</orgname></affiliation>
-   <productnumber>X Version 11, Release 6.7</productnumber>
+   <copyright><year>1989</year><year>1990</year><year>1991</year>
+     <holder>Hewlett-Packard Company</holder>
+   </copyright>
 
 <legalnotice>
 
@@ -37,11 +30,11 @@ Hewlett-Packard makes no representations about the suitability for any purpose o
 document. It is provided "as is" without express or implied warranty. This document is only a draft stan-
 dard of the X Consortium and is therefore subject to change.
 </para>
+</legalnotice>
 
+<legalnotice>
+<para role="multiLicensing">Copyright © 1989, 1990, 1991 X Consortium</para>
 <para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</para>
-
-<para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</para>
-
 <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
 
 <para>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</para>
commit 597348e969bf78dc2de4cf9bae7b76c110144266
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Thu Sep 29 07:53:15 2011 -0400

    Xinput: replace hard coded X11 version with X server version
    
    Which is more useful.
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/doc/Xinput.xml b/doc/Xinput.xml
index 1ae7afe..87c6d7f 100644
--- a/doc/Xinput.xml
+++ b/doc/Xinput.xml
@@ -1,20 +1,21 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
-                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-
+                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"[
+ <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
+]>
 
 <!-- lifted from troff+ms+XMan by doclifter -->
 <book id="porting">
 
 <bookinfo>
    <title>X11 Input Extension Porting Document</title>
-   <releaseinfo>X Version 11, Release 6.7</releaseinfo>
    <authorgroup>
       <author>
          <firstname>George</firstname><surname>Sachs</surname>
          <affiliation><orgname>Hewlett-Packard</orgname></affiliation>
       </author>
    </authorgroup>
+   <releaseinfo>X server version &xserver.version;</releaseinfo>
    <corpname>X Consortium Standard</corpname>
    <copyright><year>1989</year><holder>Hewlett-Packard Company</holder></copyright>
    <copyright><year>1990</year><holder>Hewlett-Packard Company</holder></copyright>
commit 98b230669f591bf5b8b8764db3b287d91857ee9e
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Sun Jul 31 20:43:39 2011 +0200

    sdksyms.sh may not be executable.
    
    Use $(SHELL) to run it. Someone may want to build out of a source tree
    in a filesystem with the noexec mount flag set.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Reviewed-by: Gaetan Nadon <memsize at videotron.ca>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index e3ef14f..4f08772 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -111,7 +111,7 @@ CLEANFILES = sdksyms.c sdksyms.dep
 EXTRA_DIST += sdksyms.sh
 
 sdksyms.dep sdksyms.c: sdksyms.sh
-	CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES)
+	CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES)
 
 SDKSYMS_DEP = sdksyms.dep
 include $(SDKSYMS_DEP)
commit f54852edc35a2831a4cd91906188101ea19904e1
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Sun Sep 18 12:46:52 2011 +0200

    Add a 'wscons' autoconf mechanism to configure input devices on BSD.
    
    This does not really handle hotplug (it's handled inside the kernel,
    by the 'mux' devices), but uses the wscons console driver
    configuration to figure out the keyboard layout and the list of
    pointing devices found by the kernel.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/config/Makefile.am b/config/Makefile.am
index 4a2e873..69bdcf7 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -34,6 +34,12 @@ libconfig_la_SOURCES += hal.c
 libconfig_la_LIBADD += $(HAL_LIBS)
 endif
 
+else
+
+if CONFIG_WSCONS
+libconfig_la_SOURCES += wscons.c
+endif # CONFIG_WSCONS
+
 endif # CONFIG_NEED_DBUS
 
 endif # !CONFIG_UDEV
diff --git a/config/config-backends.h b/config/config-backends.h
index 35ab8a0..10743c3 100644
--- a/config/config-backends.h
+++ b/config/config-backends.h
@@ -68,3 +68,8 @@ int config_hal_init(void);
 void config_hal_fini(void);
 # endif
 #endif
+
+#ifdef CONFIG_WSCONS
+int config_wscons_init(void);
+void config_wscons_fini(void);
+#endif
diff --git a/config/config.c b/config/config.c
index 9c28785..0dae3ad 100644
--- a/config/config.c
+++ b/config/config.c
@@ -52,6 +52,9 @@ config_init(void)
     else {
 	ErrorF("[config] failed to initialise D-Bus core\n");
     }
+#elif defined(CONFIG_WSCONS)
+    if (!config_wscons_init())
+	ErrorF("[config] failed to initialise wscons\n");
 #endif
 }
 
@@ -68,6 +71,8 @@ config_fini(void)
     config_dbus_fini();
 # endif
     config_dbus_core_fini();
+#elif defined(CONFIG_WSCONS)
+    config_wscons_fini();
 #endif
 }
 
diff --git a/config/wscons.c b/config/wscons.c
new file mode 100644
index 0000000..27c1f63
--- /dev/null
+++ b/config/wscons.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2011 Matthieu Herrb
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wsksymdef.h>
+
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "input.h"
+#include "inputstr.h"
+#include "os.h"
+#include "config-backends.h"
+
+#define WSCONS_KBD_DEVICE "/dev/wskbd"
+#define WSCONS_MOUSE_PREFIX "/dev/wsmouse"
+
+#define KB_OVRENC \
+	{ KB_UK,	"gb" }, \
+	{ KB_SV,	"se" }, \
+	{ KB_SG,	"ch" }, \
+	{ KB_SF,	"ch" }, \
+	{ KB_LA,	"latam" }, \
+	{ KB_CF,	"ca" }
+
+struct nameint {
+  int val;
+  char *name;
+} kbdenc[] = { KB_OVRENC, KB_ENCTAB, { 0 } };
+
+struct nameint kbdvar[] = {
+	{ KB_NODEAD | KB_SG,	"de_nodeadkeys" },
+	{ KB_NODEAD | KB_SF,	"fr_nodeadkeys" },
+	{ KB_SF,		"fr" },
+	{ KB_DVORAK | KB_CF,	"fr-dvorak" },
+	{ KB_DVORAK | KB_FR,	"bepo" },
+	{ KB_DVORAK,		"dvorak" },
+	{ KB_CF,		"fr-legacy" },
+	{ KB_NODEAD,		"nodeadkeys" },
+	{ 0 }
+};
+
+struct nameint kbdopt[] = {
+	{ KB_SWAPCTRLCAPS, "ctrl:swapcaps" },
+	{ 0 }
+};
+
+struct nameint kbdmodel[] = {
+	{ WSKBD_TYPE_ZAURUS,	"zaurus" },
+	{ 0 }
+};
+
+static void
+wscons_add_keyboard(void)
+{
+	InputAttributes attrs = {};
+	DeviceIntPtr dev = NULL;
+	InputOption *input_options = NULL;
+	char *config_info = NULL;
+	int fd, i, rc;
+	unsigned int type;
+	kbd_t wsenc = 0;
+
+	/* Find keyboard configuration */
+	fd = open(WSCONS_KBD_DEVICE, O_RDWR | O_NONBLOCK | O_EXCL);
+	if (fd == -1) {
+		LogMessage(X_ERROR, "wskbd: open %s: %s\n",
+		    WSCONS_KBD_DEVICE, strerror(errno));
+		return;
+	}
+	if (ioctl(fd, WSKBDIO_GETENCODING, &wsenc) == -1) {
+		LogMessage(X_WARNING, "wskbd: ioctl(WSKBDIO_GETENCODING) "
+		    "failed: %s\n", strerror(errno));
+		close(fd);
+		return;
+	}
+	if (ioctl(fd, WSKBDIO_GTYPE, &type) == -1) {
+		LogMessage(X_WARNING, "wskbd: ioctl(WSKBDIO_GTYPE) "
+		    "failed: %s\n", strerror(errno));
+		close(fd);
+		return;
+	}
+	close (fd);
+
+	input_options = input_option_new(input_options, "_source",
+	    "server/wscons");
+	if (input_options == NULL)
+		return;
+
+	LogMessage(X_INFO, "config/wscons: checking input device %s\n",
+	    WSCONS_KBD_DEVICE);
+	input_options = input_option_new(input_options, "name",
+	    WSCONS_KBD_DEVICE);
+	input_options = input_option_new(input_options, "driver", "kbd");
+
+	config_info = Xprintf("wscons:%s", WSCONS_KBD_DEVICE);
+	if (!config_info)
+		goto unwind;
+	if (KB_ENCODING(wsenc) == KB_USER) {
+		/* Ignore wscons "user" layout */
+		LogMessageVerb(X_INFO, 3, "wskbd: ignoring \"user\" layout\n");
+		goto kbd_config_done;
+	}
+	for  (i = 0; kbdenc[i].val; i++)
+		if(KB_ENCODING(wsenc) == kbdenc[i].val) {
+			LogMessageVerb(X_INFO, 3, "wskbd: using layout %s\n",
+			    kbdenc[i].name);
+			input_options = input_option_new(input_options,
+			    "xkb_layout", kbdenc[i].name);
+			break;
+		}
+	for (i = 0; kbdvar[i].val; i++)
+		if (wsenc == kbdvar[i].val ||
+		    KB_VARIANT(wsenc) == kbdvar[i].val) {
+			LogMessageVerb(X_INFO, 3, "wskbd: using variant %s\n",
+			    kbdvar[i].name);
+			input_options = input_option_new(input_options,
+			    "xkb_variant", kbdvar[i].name);
+			break;
+		}
+	for (i = 0; kbdopt[i].val; i++)
+		if (KB_VARIANT(wsenc) == kbdopt[i].val) {
+			LogMessageVerb(X_INFO, 3, "wskbd: using option %s\n",
+			    kbdopt[i].name);
+			input_options = input_option_new(input_options,
+			    "xkb_options", kbdopt[i].name);
+			break;
+		}
+	for (i = 0; kbdmodel[i].val; i++)
+		if (type == kbdmodel[i].val) {
+			LogMessageVerb(X_INFO, 3, "wskbd: using model %s\n",
+			    kbdmodel[i].name);
+			input_options = input_option_new(input_options,
+			    "xkb_model", kbdmodel[i].name);
+			break;
+		}
+
+kbd_config_done:
+	attrs.flags |= ATTR_KEYBOARD;
+	rc = NewInputDeviceRequest(input_options, &attrs, &dev);
+	if (rc != Success)
+		goto unwind;
+
+	for (; dev; dev = dev->next) {
+		free(dev->config_info);
+		dev->config_info = strdup(config_info);
+	}
+unwind:
+	input_option_free_list(&input_options);
+}
+
+static void
+wscons_add_pointer(const char *path, const char *driver, int flags)
+{
+	InputAttributes attrs = {};
+	DeviceIntPtr dev = NULL;
+	InputOption *input_options = NULL;
+	char *config_info = NULL;
+	int rc;
+
+	config_info = Xprintf("wscons:%s", path);
+	if (!config_info)
+		return;
+
+	input_options = input_option_new(input_options, "_source",
+	    "server/wscons");
+	if (input_options == NULL)
+		return;
+
+	input_options = input_option_new(input_options, "name",
+	    strdup(path));
+	input_options = input_option_new(input_options, "driver",
+	    strdup(driver));
+	input_options = input_option_new(input_options, "device",
+	    strdup(path));
+	LogMessage(X_INFO, "config/wscons: checking input device %s\n", path);
+	attrs.flags |= flags;
+	rc = NewInputDeviceRequest(input_options, &attrs, &dev);
+	if (rc != Success)
+		goto unwind;
+
+	for (; dev; dev = dev->next) {
+		free(dev->config_info);
+		dev->config_info = strdup(config_info);
+	}
+unwind:
+	input_option_free_list(&input_options);
+}
+
+static void
+wscons_add_pointers(void)
+{
+	char devname[256];
+	int fd, i, wsmouse_type;
+
+	/* Check pointing devices */
+	for (i = 0; i < 4; i++) {
+		snprintf(devname, sizeof(devname), "%s%d",
+		    WSCONS_MOUSE_PREFIX, i);
+		LogMessageVerb(X_INFO, 10, "wsmouse: checking %s\n", devname);
+		fd = open_device(devnamem O_RDWR | O_NONBLOCK | O_EXCL);
+		if (fd == -1) {
+			LogMessageVerb(X_WARNING, 10, "%s: %s\n", devname,
+			    strerror(errno));
+			continue;
+		}
+		if (ioctl(fd, WSMOUSEIO_GTYPE, &wsmouse_type) != 0) {
+			LogMessageVerb(X_WARNING, 10,
+			    "%s: WSMOUSEIO_GTYPE failed\n", devname);
+			close(fd);
+			continue;
+		}
+		close(fd);
+		switch (wsmouse_type) {
+		case WSMOUSE_TYPE_SYNAPTICS:
+			wscons_add_pointer(devname, "synaptics",
+			    ATTR_TOUCHPAD);
+			break;
+		case WSMOUSE_TYPE_TPANEL:
+			wscons_add_pointer(devname, "ws", ATTR_TOUCHSCREEN);
+			break;
+		default:
+			break;
+		}
+	}
+	/* Add a default entry catching all other mux elements as "mouse" */
+	wscons_add_pointer(WSCONS_MOUSE_PREFIX, "mouse", ATTR_POINTER);
+}
+
+int
+config_wscons_init(void)
+{
+	wscons_add_keyboard();
+	wscons_add_pointers();
+	return 1;
+}
+
+void
+config_wscons_fini(void)
+{
+	/* Not much to do ? */
+}
diff --git a/configure.ac b/configure.ac
index b0d2643..ac5e887 100644
--- a/configure.ac
+++ b/configure.ac
@@ -629,6 +629,7 @@ AC_ARG_ENABLE(dpms,           AS_HELP_STRING([--disable-dpms], [Build DPMS exten
 AC_ARG_ENABLE(config-udev,    AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
 AC_ARG_ENABLE(config-dbus,    AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no])
 AC_ARG_ENABLE(config-hal,     AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
+AC_ARG_ENABLE(config-wscons,  AS_HELP_STRING([--enable-config-wscons], [Build wscons config support (default: auto)]), [CONFIG_WSCONS=$enableval], [CONFIG_WSCONS=auto])
 AC_ARG_ENABLE(xfree86-utils,     AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
 AC_ARG_ENABLE(xaa,               AS_HELP_STRING([--enable-xaa], [Build XAA (default: enabled)]), [XAA=$enableval], [XAA=yes])
 AC_ARG_ENABLE(vgahw,          AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
@@ -865,6 +866,21 @@ if test "x$CONFIG_NEED_DBUS" = xyes; then
 fi
 AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes])
 
+if test "x$CONFIG_WSCONS" = xauto; then
+	case $host_os in
+		*openbsd*)
+			CONFIG_WSCONS=yes;
+			;;
+		*)
+			CONFIG_WSCONS=no;
+			;;
+	esac
+fi
+AM_CONDITIONAL(CONFIG_WSCONS, [test "x$CONFIG_WSCONS" = xyes])
+if test "x$CONFIG_WSCONS" = xyes; then
+	AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration])
+fi
+
 if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then
 	USE_SIGIO_BY_DEFAULT_VALUE=TRUE
 else
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index e6c4d8f..01b4efa 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1331,12 +1331,14 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
     }
 
     if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
+#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
 	const char *config_backend;
 #if defined(CONFIG_HAL)
 	config_backend = "HAL";
-#else
+#elif defined(CONFIG_UDEV)
 	config_backend = "udev";
+#else
+	config_backend = "wscons";
 #endif
 	xf86Msg(X_INFO, "The server relies on %s to provide the list of "
 	                "input devices.\n\tIf no devices become available, "
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 93533ec..5370e4c 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -125,7 +125,7 @@ xf86InfoRec xf86Info = {
     .log                        = LogNone,
     .disableRandR               = FALSE,
     .randRFrom                  = X_DEFAULT,
-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
+#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
     .forceInputDevices          = FALSE,
     .autoAddDevices             = TRUE,
     .autoEnableDevices          = TRUE
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 9fbcba9..41c9340 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -936,7 +936,8 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
 
         if (strcmp(input_option_get_key(option), "_source") == 0 &&
             (strcmp(input_option_get_value(option), "server/hal") == 0 ||
-             strcmp(input_option_get_value(option), "server/udev") == 0)) {
+             strcmp(input_option_get_value(option), "server/udev") == 0 ||
+             strcmp(input_option_get_value(option), "server/wscons") == 0)) {
             is_auto = 1;
             if (!xf86Info.autoAddDevices) {
                 rval = BadMatch;
commit ac5881d6d0bcf4bcc66a5d6ddde4eca950db1a5b
Author: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
Date:   Thu Sep 15 23:05:24 2011 +0600

    Remove unused vtSysreq
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Tested-by: Matthieu Herrb <matthieu.herrb at laas.fr>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index e6c4d8f..d195399 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -670,7 +670,6 @@ typedef enum {
     FLAG_DISABLEVIDMODE,
     FLAG_ALLOWNONLOCAL,
     FLAG_ALLOWMOUSEOPENFAIL,
-    FLAG_VTSYSREQ,
     FLAG_SAVER_BLANKTIME,
     FLAG_DPMS_STANDBYTIME,
     FLAG_DPMS_SUSPENDTIME,
@@ -711,8 +710,6 @@ static OptionInfoRec FlagOptions[] = {
 	{0}, FALSE },
   { FLAG_ALLOWMOUSEOPENFAIL,	"AllowMouseOpenFail",		OPTV_BOOLEAN,
 	{0}, FALSE },
-  { FLAG_VTSYSREQ,		"VTSysReq",			OPTV_BOOLEAN,
-	{0}, FALSE },
   { FLAG_SAVER_BLANKTIME,	"BlankTime"		,	OPTV_INTEGER,
 	{0}, FALSE },
   { FLAG_DPMS_STANDBYTIME,	"StandbyTime",			OPTV_INTEGER,
@@ -850,16 +847,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWMOUSEOPENFAIL, &value))
 	xf86Info.allowMouseOpenFail = value;
 
-    if (xf86GetOptValBool(FlagOptions, FLAG_VTSYSREQ, &value)) {
-#ifdef USE_VT_SYSREQ
-	xf86Info.vtSysreq = value;
-	xf86Msg(X_CONFIG, "VTSysReq %s\n", value ? "enabled" : "disabled");
-#else
-	if (value)
-	    xf86Msg(X_WARNING, "VTSysReq is not supported on this OS\n");
-#endif
-    }
-
     xf86Info.pmFlag = TRUE;
     if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value)) 
 	xf86Info.pmFlag = !value;
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 9a42bb9..e0c3da2 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -96,7 +96,6 @@ InputInfoPtr xf86InputDevs = NULL;
 xf86InfoRec xf86Info = {
     .consoleFd                  = -1,
     .vtno                       = -1,
-    .vtSysreq                   = FALSE,
     .lastEventTime              = -1,
     .vtRequestsPending          = FALSE,
 #ifdef sun
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index feab5c1..79bc8a0 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -57,7 +57,6 @@ typedef enum {
 typedef struct {
     int			consoleFd;
     int			vtno;
-    Bool		vtSysreq;
 
     /* event handler part */
     int			lastEventTime;
diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 62c491c..7f98851 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -560,18 +560,6 @@ drivers to not report failure if the mouse device can't be opened/initialised.
 It has no effect on the evdev(__drivermansuffix__) or other drivers.
 Default: false.
 .TP 7
-.BI "Option \*qVTSysReq\*q  \*q" boolean \*q
-enables the SYSV\-style VT switch sequence for non\-SYSV systems
-which support VT switching.
-This sequence is
-.B Alt\-SysRq
-followed by a function key
-.RB ( Fn ).
-This prevents the __xservername__ server trapping the
-keys used for the default VT switch sequence, which means that clients can
-access them.
-Default: off.
-.TP 7
 .BI "Option \*qBlankTime\*q  \*q" time \*q
 sets the inactivity timeout for the
 .B blank
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index fddde8a..1d59060 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -168,11 +168,6 @@
 #  define POSIX_TTY
 # endif /* SVR4 */
 
-
-# if defined(sun) && defined(HAS_USL_VTS)
-#  define USE_VT_SYSREQ
-# endif
-
 #endif /* (SYSV || SVR4) */
 
 /**************************************************************************/
@@ -207,7 +202,6 @@
 #  define LDSMAP PIO_SCRNMAP
 #  define LDNMAP LDSMAP
 #  define CLEARDTR_SUPPORT
-#  define USE_VT_SYSREQ
 # endif
 
 # define POSIX_TTY
@@ -343,10 +337,6 @@
 
 # define CLEARDTR_SUPPORT
 
-# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
-#  define USE_VT_SYSREQ
-# endif
-
 #endif
 /* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
 
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
index abcafcf..a985606 100644
--- a/hw/xfree86/parser/xf86tokens.h
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -207,8 +207,6 @@ typedef enum {
     XKBLAYOUT,
     XKBVARIANT,
     XKBOPTIONS,
-    /* The next two have become ServerFlags options */
-    VTSYSREQ,
     /* Obsolete keyboard tokens */
     SERVERNUM,
     LEFTALT,
commit 0be1640dbbdd072f26d937de2e49f5ed58d54ef9
Author: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
Date:   Sat Aug 27 02:02:36 2011 +0600

    bsd: ioctl KDENABIO/KDDISABIO do not matter for OpenBSD
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
    Tested-by: Matthieu Herrb <matthieu.herrb at laas.fr>

diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index f4c0302..8446179 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -291,13 +291,13 @@ acquire_vt:
 		    {
 			FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed");
 		    }
-	#if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
+#if !defined(__OpenBSD__) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
 		    if (ioctl(xf86Info.consoleFd, KDENABIO, 0) < 0)
 		    {
 			FatalError("xf86OpenConsole: KDENABIO failed (%s)",
 				   strerror(errno));
 		    }
-	#endif
+#endif
 		    if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
 		    {
 			FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
@@ -648,7 +648,7 @@ xf86CloseConsole()
 	    VT.mode = VT_AUTO;
 	    ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* dflt vt handling */
         }
-#if !defined(OpenBSD) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
+#if !defined(__OpenBSD__) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
         if (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0)
         {
             xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
commit 91042b98afdc6cecc746e101a88f79e56db1c0d0
Author: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
Date:   Sat Aug 27 00:47:34 2011 +0600

    bsd: OpenBSD and NetBSD not need extra headers in PCVT_SUPPORT
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
    Tested-by: Matthieu Herrb <matthieu.herrb at laas.fr>

diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index cf92821..fddde8a 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -277,20 +277,14 @@
 #     include <sys/console.h>
 #    endif
 #   endif /* SYSCONS_SUPPORT */
-#   if defined(PCVT_SUPPORT)
+#   if defined(PCVT_SUPPORT) && !defined(__NetBSD__) && !defined(__OpenBSD__)
 #    if !defined(SYSCONS_SUPPORT)
       /* no syscons, so include pcvt specific header file */
 #     if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #      include <machine/pcvt_ioctl.h>
 #     else
-#      if defined(__NetBSD__) || defined(__OpenBSD__)
-#       if !defined(WSCONS_SUPPORT)
-#        include <machine/pcvt_ioctl.h>
-#       endif /* WSCONS_SUPPORT */
-#      else
-#       include <sys/pcvt_ioctl.h>
-#      endif /* __NetBSD__ */
-#     endif /* __FreeBSD_kernel__ || __OpenBSD__ */
+#      include <sys/pcvt_ioctl.h>
+#     endif /* __FreeBSD_kernel__ */
 #    else /* pcvt and syscons: hard-code the ID magic */
 #     define VGAPCVTID _IOWR('V',113, struct pcvtid)
       struct pcvtid {
commit 86eaa9bbe4ed59f89d6509d5e13211ab7f5a8038
Author: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
Date:   Sat Aug 27 01:03:28 2011 +0600

    bsd: Some clean up
    
    OpenBSD and NetBSD does not support syscons
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
    Tested-by: Matthieu Herrb <matthieu.herrb at laas.fr>

diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index 0f92ace..f4c0302 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -446,11 +446,7 @@ xf86OpenSyscons()
 	    }
 
 	    close(fd);
-#ifndef __OpenBSD__
 	    sprintf(vtname, "/dev/ttyv%01x", xf86Info.vtno - 1);
-#else 
-	    sprintf(vtname, "/dev/ttyC%01x", xf86Info.vtno - 1);
-#endif	    
 	    if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0)
 	    {
 		FatalError("xf86OpenSyscons: Cannot open %s (%s)",
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index 24c92fb..cf92821 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -266,19 +266,15 @@
 #  else /* __bsdi__ */
 #   ifdef SYSCONS_SUPPORT
 #    define COMPAT_SYSCONS
-#    if defined(__NetBSD__) || defined(__OpenBSD__)
-#     include <machine/console.h>
+#    if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#       if defined(__DragonFly__)  || (__FreeBSD_kernel_version >= 410000)
+#         include <sys/consio.h>
+#         include <sys/kbio.h>
+#       else
+#         include <machine/console.h>
+#       endif /* FreeBSD 4.1 RELEASE or lator */
 #    else
-#     if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-#        if defined(__DragonFly__)  || (__FreeBSD_kernel_version >= 410000)
-#          include <sys/consio.h>
-#          include <sys/kbio.h>
-#        else
-#          include <machine/console.h>
-#        endif /* FreeBSD 4.1 RELEASE or lator */
-#     else
-#      include <sys/console.h>
-#     endif
+#     include <sys/console.h>
 #    endif
 #   endif /* SYSCONS_SUPPORT */
 #   if defined(PCVT_SUPPORT)
commit dc864770d47fc1e4ec993e37a59e5aecb5b0a85e
Author: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
Date:   Fri Aug 26 22:40:19 2011 +0600

    bsd: Remove dead code
    
    Since OsInit closes stdin before the xfree86 DDX opens the
    console, fstat on stdin will always fail, so it's safe to delete
    code that attempts it.
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Tested-by: Matthieu Herrb <matthieu.herrb at laas.fr>

diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index 5f5008f..0f92ace 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -210,9 +210,6 @@ xf86OpenConsole()
 		"%s: No console driver found\n\tSupported drivers: %s\n\t%s",
 		"xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG);
 	}
-#if 0 /* stdin is already closed in OsInit() */
-	fclose(stdin);
-#endif
 	xf86Info.consoleFd = fd;
 
 	switch (xf86Info.consType)
@@ -372,7 +369,6 @@ xf86OpenSyscons()
     int fd = -1;
     vtmode_t vtmode;
     char vtname[12];
-    struct stat status;
     long syscons_version;
     MessageType from;
 
@@ -425,20 +421,11 @@ xf86OpenSyscons()
 		{
 		    /*
 		     * All VTs are in use.  If initialVT was found, use it.
-		     * Otherwise, if stdin is a VT, use that one.
-		     * XXX stdin is already closed, so this won't work.
 		     */
 		    if (initialVT != -1)
 		    {
 			xf86Info.vtno = initialVT;
 		    }
-		    else if ((fstat(0, &status) >= 0)
-			     && S_ISCHR(status.st_mode)
-			     && (ioctl(0, VT_GETMODE, &vtmode) >= 0))
-		    {
-			/* stdin is a VT */
-			xf86Info.vtno = minor(status.st_rdev) + 1;
-		    }
 		    else
 		    {
 			if (syscons_version >= 0x100)
@@ -508,7 +495,6 @@ xf86OpenPcvt()
     int fd = -1;
     vtmode_t vtmode;
     char vtname[12], *vtprefix;
-    struct stat status;
     struct pcvtid pcvt_version;
 
 #ifndef __OpenBSD__
@@ -554,20 +540,11 @@ xf86OpenPcvt()
 		{
 		    /*
 		     * All VTs are in use.  If initialVT was found, use it.
-		     * Otherwise, if stdin is a VT, use that one.
-		     * XXX stdin is already closed, so this won't work.
 		     */
 		    if (initialVT != -1)
 		    {
 			xf86Info.vtno = initialVT;
 		    }
-		    else if ((fstat(0, &status) >= 0)
-			     && S_ISCHR(status.st_mode)
-			     && (ioctl(0, VT_GETMODE, &vtmode) >= 0))
-		    {
-			/* stdin is a VT */
-			xf86Info.vtno = minor(status.st_rdev) + 1;
-		    }
 		    else
 		    {
 			FatalError("%s: Cannot find a free VT",
commit cbb842666fa7ff26bbdd1e89a7f41b835a677c5e
Author: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
Date:   Fri Aug 26 21:42:41 2011 +0600

    bsd: Variable devConsoleFd need only if defined PCCONS_SUPPORT
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Tested-by: Matthieu Herrb <matthieu.herrb at laas.fr>

diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index f9d546f..5f5008f 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -41,7 +41,10 @@
 #include <errno.h>
 
 static Bool KeepTty = FALSE;
+
+#ifdef PCCONS_SUPPORT
 static int devConsoleFd = -1;
+#endif
 #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
 static int VTnum = -1;
 static int initialVT = -1;
@@ -694,8 +697,10 @@ xf86CloseConsole()
     }
 
     close(xf86Info.consoleFd);
+#ifdef PCCONS_SUPPORT
     if (devConsoleFd >= 0)
 	close(devConsoleFd);
+#endif
     return;
 }
 
commit 38bd1e123d959e0a13514ec415afc8bfb5a170f2
Author: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
Date:   Fri Aug 26 18:54:01 2011 +0600

    bsd: Replacement screenFd on consoleFd because they are equivalent
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Tested-by: Matthieu Herrb <matthieu.herrb at laas.fr>

diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 93533ec..9a42bb9 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -111,7 +111,6 @@ xf86InfoRec xf86Info = {
     .caughtSignal               = FALSE,
     .currentScreen              = NULL,
 #ifdef CSRG_BASED
-    .screenFd                   = -1,
     .consType                   = -1,
 #endif
     .allowMouseOpenFail         = FALSE,
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index 14cd56a..feab5c1 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -76,8 +76,6 @@ typedef struct {
     /* graphics part */
     ScreenPtr		currentScreen;
 #if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
-    int			screenFd;	/* fd for memory mapped access to
-					 * vga card */
     int			consType;	/* Which console driver? */
 #endif
 
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index bb3a5cb..15eb2a4 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -340,7 +340,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
 	base = mmap(0, Size,
 		    (flags & VIDMEM_READONLY) ?
 		     PROT_READ : (PROT_READ | PROT_WRITE),
-		    MAP_FLAGS, xf86Info.screenFd,
+		    MAP_FLAGS, xf86Info.consoleFd,
 		    (unsigned long)Base + BUS_BASE);
 	if (base == MAP_FAILED)
 	{
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index 482d53f..eb631a7 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -213,7 +213,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
 	base = mmap(0, Size,
 		    (flags & VIDMEM_READONLY) ?
 		     PROT_READ : (PROT_READ | PROT_WRITE),
-		    MAP_FLAGS, xf86Info.screenFd,
+		    MAP_FLAGS, xf86Info.consoleFd,
 		    (unsigned long)Base - 0xA0000);
 	if (base == MAP_FAILED)
 	{
@@ -306,7 +306,7 @@ checkMapInfo(Bool warn, int Region)
     
     if(!memAccP->Checked)
     {	
-	if(ioctl(xf86Info.screenFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
+	if(ioctl(xf86Info.consoleFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
 	{
 	    if(warn)
 	    {
@@ -360,7 +360,7 @@ xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
 			 Size,
 			 PROT_READ | PROT_WRITE,
 			 MAP_SHARED,
-			 xf86Info.screenFd,
+			 xf86Info.consoleFd,
 			 (unsigned long)mapInfoP->u.map_info_mmap.map_offset))
 		   == (pointer)-1)
 		{
diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index 837a2f4..f9d546f 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -211,7 +211,6 @@ xf86OpenConsole()
 	fclose(stdin);
 #endif
 	xf86Info.consoleFd = fd;
-	xf86Info.screenFd = fd;
 
 	switch (xf86Info.consType)
 	{
@@ -688,22 +687,12 @@ xf86CloseConsole()
     case WSCONS:
       {
 	int mode = WSDISPLAYIO_MODE_EMUL;
-	ioctl(xf86Info.screenFd, WSDISPLAYIO_SMODE, &mode);
+	ioctl(xf86Info.consoleFd, WSDISPLAYIO_SMODE, &mode);
 	break;
       }
 #endif
     }
 
-    if (xf86Info.screenFd != xf86Info.consoleFd)
-    {
-	close(xf86Info.screenFd);
-	close(xf86Info.consoleFd);
-	if ((xf86Info.consoleFd = open("/dev/console",O_RDONLY,0)) <0)
-	{
-	    xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)",
-			   strerror(errno));
-	}
-    }
     close(xf86Info.consoleFd);
     if (devConsoleFd >= 0)
 	close(devConsoleFd);
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 7aef079..525bfb6 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -258,7 +258,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
 	base = mmap(0, Size,
 		    (flags & VIDMEM_READONLY) ?
 		     PROT_READ : (PROT_READ | PROT_WRITE),
-		    MAP_FLAGS, xf86Info.screenFd,
+		    MAP_FLAGS, xf86Info.consoleFd,
 		    (unsigned long)Base - 0xA0000
 	    );
 	if (base == MAP_FAILED)
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
index 7e3fcdb..aeaf183 100644
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -73,7 +73,7 @@ volatile unsigned char *ioBase = MAP_FAILED;
 static pointer
 ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
 {
-	int fd = xf86Info.screenFd;
+	int fd = xf86Info.consoleFd;
 	pointer base;
 #ifdef DEBUG
 	xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", 
@@ -125,7 +125,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
 
 Bool xf86EnableIO()
 {
-        int fd = xf86Info.screenFd;
+        int fd = xf86Info.consoleFd;
 
         xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd);
         if (ioBase == MAP_FAILED)
diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c
index c838792..a2a30c9 100644
--- a/hw/xfree86/os-support/bsd/sparc64_video.c
+++ b/hw/xfree86/os-support/bsd/sparc64_video.c
@@ -58,7 +58,7 @@ static pointer
 sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, 
 		 int flags)
 {
-	int fd = xf86Info.screenFd;
+	int fd = xf86Info.consoleFd;
 	pointer base;
 
 #ifdef DEBUG
commit f015351c73bb24ce4172911c3e95d67922de42ab
Author: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
Date:   Fri Aug 26 18:27:02 2011 +0600

    bsd: Remove unused macros KBD_FD
    
    Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Tested-by: Matthieu Herrb <matthieu.herrb at laas.fr>

diff --git a/hw/xfree86/os-support/bsd/bsd_bell.c b/hw/xfree86/os-support/bsd/bsd_bell.c
index 55eb752..fb457db 100644
--- a/hw/xfree86/os-support/bsd/bsd_bell.c
+++ b/hw/xfree86/os-support/bsd/bsd_bell.c
@@ -37,10 +37,6 @@
 #include "xf86Priv.h"
 #include "xf86_OSlib.h"
 
-#ifdef WSCONS_SUPPORT
-#define KBD_FD(i) ((i).kbdFd != -1 ? (i).kbdFd : (i).consoleFd)
-#endif
-
 void
 xf86OSRingBell(int loudness, int pitch, int duration)
 {


More information about the Xquartz-changes mailing list