xserver: Branch 'master' - 5 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Oct 28 19:00:39 PDT 2009


 glx/glapi.c                  |    7 ++++++-
 glx/unpack.h                 |    2 +-
 hw/kdrive/linux/evdev.c      |   15 ++++++++++++++-
 hw/xfree86/common/xf86Init.c |   32 +++++++++++++++++++++-----------
 hw/xfree86/common/xf86str.h  |    1 +
 hw/xfree86/i2c/fi1236.c      |   10 +++++-----
 hw/xfree86/loader/sdksyms.sh |    1 +
 hw/xfree86/parser/Flags.c    |    2 +-
 8 files changed, 50 insertions(+), 20 deletions(-)

New commits:
commit fab74d1081270fb8f1d231e6e10d10aa33e164da
Author: Jamey Sharp <jamey at minilop.net>
Date:   Wed Oct 28 17:48:19 2009 -0700

    Suppress certain GCC warnings in auto-generated code.
    
    - Don't warn for references to deprecated functions in xorg_symbols.
    - Ignore functions generated by gl_apitemp.py that are never used.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glapi.c b/glx/glapi.c
index fa3808e..d6a568e 100644
--- a/glx/glapi.c
+++ b/glx/glapi.c
@@ -114,10 +114,15 @@ warn(void)
    }
 }
 
+#if defined(__GNUC__) && (__GNUC__ > 2)
+#define possibly_unused __attribute((unused))
+#else
+#define possibly_unused
+#endif
 
 #define KEYWORD1 static
 #define KEYWORD1_ALT static
-#define KEYWORD2 GLAPIENTRY
+#define KEYWORD2 GLAPIENTRY possibly_unused
 #define NAME(func)  NoOp##func
 
 #define F NULL
diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
index 1186547..eea0240 100755
--- a/hw/xfree86/loader/sdksyms.sh
+++ b/hw/xfree86/loader/sdksyms.sh
@@ -2,6 +2,7 @@
 
 cat > sdksyms.c << EOF
 /* This file is automatically generated by sdksyms.sh. */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
commit 239435875d6a92ed31731b500a992a3af0943594
Author: Jamey Sharp <jamey at minilop.net>
Date:   Wed Oct 28 17:48:18 2009 -0700

    Don't cast double to int: use default conversions or explicitly round.
    
    GCC warns about casting a double return value to int.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/i2c/fi1236.c b/hw/xfree86/i2c/fi1236.c
index 110563e..7c39edb 100644
--- a/hw/xfree86/i2c/fi1236.c
+++ b/hw/xfree86/i2c/fi1236.c
@@ -225,7 +225,7 @@ m->f_ifbw=f_ifbw;
 m->f_step=f_step;
 
 m->f_lo1=f_rf+f_if1;
-m->LO1I=(int)floor((m->f_lo1/f_ref)+0.5);
+m->LO1I=lrint(m->f_lo1/f_ref);
 m->f_lo1=f_ref*m->LO1I;
 
 m->f_lo2=m->f_lo1-f_rf-f_if2;
@@ -258,10 +258,10 @@ if(m->f_lo1<1890.0)m->SEL=1;
 	m->SEL=0;
 
 /* calculate the rest of the registers */
-m->LO2I=(int)floor(m->f_lo2/f_ref);
-m->STEP=(int)floor(3780.0*f_step/f_ref);
-m->NUM=(int)floor(3780.0*(m->f_lo2/f_ref-m->LO2I));
-m->NUM=m->STEP*(int)floor((1.0*m->NUM)/(1.0*m->STEP)+0.5);
+m->LO2I=floor(m->f_lo2/f_ref);
+m->STEP=floor(3780.0*f_step/f_ref);
+m->NUM=floor(3780.0*(m->f_lo2/f_ref-m->LO2I));
+m->NUM=m->STEP*lrint((1.0*m->NUM)/(1.0*m->STEP));
 }
 
 static int MT2032_wait_for_lock(FI1236Ptr f)
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c
index 6865d35..699f15c 100644
--- a/hw/xfree86/parser/Flags.c
+++ b/hw/xfree86/parser/Flags.c
@@ -434,7 +434,7 @@ xf86uLongToString(unsigned long i)
 	char *s;
 	int l;
 
-	l = (int)(ceil(log10((double)i) + 2.5));
+	l = ceil(log10((double)i) + 2.5);
 	s = malloc(l);
 	if (!s)
 		return NULL;
commit e8c48fd8f7aab54327b0091cd17c60235ae27168
Author: Jamey Sharp <jamey at minilop.net>
Date:   Wed Oct 28 17:48:17 2009 -0700

    Suppress GCC warnings like "the address of `u1' will always evaluate as `true'".
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/unpack.h b/glx/unpack.h
index a1dd17d..90cb71b 100644
--- a/glx/unpack.h
+++ b/glx/unpack.h
@@ -47,7 +47,7 @@
 ** Fetch a double from potentially unaligned memory.
 */
 #ifdef __GLX_ALIGN64
-#define __GLX_MEM_COPY(dst,src,n)	if (src && dst) memcpy(dst,src,n)
+#define __GLX_MEM_COPY(dst,src,n)	if (src != NULL && dst != NULL) memcpy(dst,src,n)
 #define __GLX_GET_DOUBLE(dst,src)	__GLX_MEM_COPY(&dst,src,8)
 #else
 #define __GLX_GET_DOUBLE(dst,src)	(dst) = *((GLdouble*)(src))
commit 662594aeff9d1767316f08600949c73ac5060d18
Author: Mikhail Gusarov <dottedmag at dottedmag.net>
Date:   Thu Oct 29 00:40:48 2009 +0600

    kdrive: Grab evdev mouse/keyboard devices when X server is active
    
    Input events are directed to both vt and input devices by default.
    Unless input devices are grabbed, keyboard events fill it vt buffers
    and cause spontaneous wakeups in kernel tty layer when buffers are full.
    
    Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c
index f6017ba..096a2dd 100644
--- a/hw/kdrive/linux/evdev.c
+++ b/hw/kdrive/linux/evdev.c
@@ -243,7 +243,9 @@ EvdevPtrEnable (KdPointerInfo *pi)
     if (fd < 0)
         return BadMatch;
 
-        
+    if (ioctl (fd, EVIOCGRAB, 1) < 0)
+        perror ("Grabbing evdev mouse device failed");
+
     if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0)
     {
         perror ("EVIOCGBIT 0");
@@ -335,6 +337,10 @@ EvdevPtrDisable (KdPointerInfo *pi)
         return;
 
     KdUnregisterFd (pi, ke->fd, TRUE);
+
+    if (ioctl (ke->fd, EVIOCGRAB, 0) < 0)
+        perror ("Ungrabbing evdev mouse device failed");
+
     xfree (ke);
     pi->driverPrivate = 0;
 }
@@ -425,6 +431,9 @@ EvdevKbdEnable (KdKeyboardInfo *ki)
     if (fd < 0)
         return BadMatch;
 
+    if (ioctl (fd, EVIOCGRAB, 1) < 0)
+        perror ("Grabbing evdev keyboard device failed");
+
     if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0) {
         perror ("EVIOCGBIT 0");
         close (fd);
@@ -496,6 +505,10 @@ EvdevKbdDisable (KdKeyboardInfo *ki)
         return;
 
     KdUnregisterFd (ki, ke->fd, TRUE);
+
+    if (ioctl (ke->fd, EVIOCGRAB, 0) < 0)
+        perror ("Ungrabbing evdev keyboard device failed");
+
     xfree (ke);
     ki->driverPrivate = 0;
 }
commit 83d520d86c888f2c8a4abb18b7a8858d568aa18f
Author: Jamey Sharp <jamey at minilop.net>
Date:   Wed Oct 28 16:45:44 2009 -0700

    Add video driver flag to indicate that console access is not needed.
    
    Existing video drivers will get the console enabled by default.
    
    Signed-off-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index c9baff3..2d682aa 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -97,6 +97,7 @@ static Bool add_matching_devices_to_configure_list(DriverPtr drvp);
 #ifdef XF86PM
 void (*xf86OSPMClose)(void) = NULL;
 #endif
+static Bool xorgHWOpenConsole = FALSE;
 
 /* Common pixmap formats */
 
@@ -601,8 +602,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     if (xf86DoShowOptions)
         DoShowOptions();
 
-    xf86OpenConsole();
-
     /* Do a general bus probe.  This will be a PCI probe for x86 platforms */
     xf86BusProbe();
 
@@ -676,20 +675,29 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
      */
 
     for (i = 0; i < xf86NumDrivers; i++) {
-	xorgHWFlags flags;
-
 	if (xf86DriverList[i]->Identify != NULL)
 	    xf86DriverList[i]->Identify(0);
 
-	if (!xorgHWAccess
-	    && (!xf86DriverList[i]->driverFunc
+	if (!xorgHWAccess || !xorgHWOpenConsole) {
+	    xorgHWFlags flags;
+	    if(!xf86DriverList[i]->driverFunc
 		|| !xf86DriverList[i]->driverFunc(NULL,
 						  GET_REQUIRED_HW_INTERFACES,
-						  &flags)
-		|| NEED_IO_ENABLED(flags)))
-	    xorgHWAccess = TRUE;
+						  &flags))
+		flags = HW_IO;
+
+	    if(NEED_IO_ENABLED(flags))
+		xorgHWAccess = TRUE;
+	    if(!(flags & HW_SKIP_CONSOLE))
+		xorgHWOpenConsole = TRUE;
+	}
     }
 
+    if (xorgHWOpenConsole)
+	xf86OpenConsole();
+    else
+	xf86Info.dontVTSwitch = TRUE;
+
     /* Enable full I/O access */
     if (xorgHWAccess)
 	xorgHWAccess = xf86EnableIO();
@@ -966,7 +974,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     /*
      * serverGeneration != 1; some OSs have to do things here, too.
      */
-    xf86OpenConsole();
+    if (xorgHWOpenConsole)
+	xf86OpenConsole();
 
 #ifdef XF86PM
     /*
@@ -1203,7 +1212,8 @@ ddxGiveUp(void)
     DGAShutdown();
 #endif
 
-    xf86CloseConsole();
+    if (xorgHWOpenConsole)
+	xf86CloseConsole();
 
     xf86CloseLog();
 
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index b9a2e06..7b0b758 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -299,6 +299,7 @@ typedef struct {
 /* GET_REQUIRED_HW_INTERFACES */
 #define HW_IO 1
 #define HW_MMIO 2
+#define HW_SKIP_CONSOLE 4
 #define NEED_IO_ENABLED(x) (x & HW_IO)
 
 typedef CARD32 xorgHWFlags;


More information about the xorg-commit mailing list