xserver: Branch 'master' - 9 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Oct 3 13:50:15 PDT 2011


 hw/xfree86/common/xf86Config.c            |   13 -------
 hw/xfree86/common/xf86Globals.c           |    2 -
 hw/xfree86/common/xf86Privstr.h           |    3 -
 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 -
 13 files changed, 28 insertions(+), 117 deletions(-)

New commits:
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 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 xorg-commit mailing list