xserver: Branch 'master' - 6 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Nov 4 00:31:40 PDT 2010


 Xi/listdev.c                            |    4 ++--
 dix/window.c                            |    6 +++---
 hw/kdrive/linux/tslib.c                 |   15 +++++++++++----
 hw/xfree86/os-support/hurd/hurd_mmap.c  |   12 ++++++------
 hw/xfree86/os-support/hurd/hurd_video.c |   18 +++++++++---------
 test/input.c                            |    2 ++
 6 files changed, 33 insertions(+), 24 deletions(-)

New commits:
commit a52efb096e166e325deb3d6b502671f339a4fa15
Merge: fe8d122... f72aadd...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Nov 3 06:50:45 2010 -0700

    Merge remote branch 'sthibaul/master-iopl'

commit fe8d122b133a43125cc961d2c3c811fa776f29c8
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Oct 28 16:13:09 2010 +1000

    Xi: reshuffle conditions for labeling a device as IsXExtensionKeyboard (#29046)
    
    From the original bug reporter Ezra Reeves:
    
    "I did some more digging on this today, and I found that an HP branded
    wireless USB mouse has the same issue. With this mouse (as well as the
    logitech wireless mouse), the return from:
    
    xdev = XListInputDevices(GDK_WINDOW_XDISPLAY(rootwin), &ndevices_return);
    
    lists the USB device twice, but both have xdev[num].use == 3
    (IsXExtensionKeyboard as defined in X11/XI.h).
    
    [...]
    
    Swapping the order of the test in Xi/listdev.c that determines whether a
    device is a pointer or a keyboard properly detects my devices (OEM USB
    wireless mouse/kb combo) -- one as a keyboard and one as a pointer."
    
    X.Org Bug 29046 <http://bugs.freedesktop.org/show_bug.cgi?id=29046>
    
    Reported-by: Erik Kilfoil <ekilfoil at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/listdev.c b/Xi/listdev.c
index 3b2272b..b38fbd1 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -180,10 +180,10 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
 	dev->use = IsXKeyboard;
     else if (IsMaster(d) && IsPointerDevice(d))
 	dev->use = IsXPointer;
-    else if (d->key && d->kbdfeed)
-        dev->use = IsXExtensionKeyboard;
     else if (d->valuator && d->button)
         dev->use = IsXExtensionPointer;
+    else if (d->key && d->kbdfeed)
+        dev->use = IsXExtensionKeyboard;
     else
 	dev->use = IsXExtensionDevice;
 
commit a210068c5222acbdb04db17cb8cef314735bf977
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Tue Oct 26 20:50:13 2010 +0300

    dix: advance parent window pointer when no node is found
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/window.c b/dix/window.c
index 1913030..edb146e 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3660,9 +3660,9 @@ WindowParentHasDeviceCursor(WindowPtr pWin,
                     &pParentNode, &pParentPrev))
         {
             /* if there is a node in the list, the win has a dev cursor */
-            if (!pParentNode->cursor) /* inherited. loop needs to cont. */
-            {
-            } else if (pParentNode->cursor == pCursor) /* inherit */
+            if (!pParentNode->cursor) /* inherited. */
+                pParent = pParent->parent;
+            else if (pParentNode->cursor == pCursor) /* inherit */
                 return TRUE;
             else  /* different cursor */
                 return FALSE;
commit f72aadd38b730c46c0a027dacbbb57f03068383d
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Sat Oct 23 22:42:33 2010 +0200

    hurd: Fix use of deprecated iopl device
    
    Fix Xserver on GNU/Hurd into using the "mem" device instead of
    the deprecated "iopl" device.
    
    Reviewed-by: Olaf Buddenhagen <antrik at users.sf.net>
    Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>

diff --git a/hw/xfree86/os-support/hurd/hurd_mmap.c b/hw/xfree86/os-support/hurd/hurd_mmap.c
index ccef5f2..3f942aa 100644
--- a/hw/xfree86/os-support/hurd/hurd_mmap.c
+++ b/hw/xfree86/os-support/hurd/hurd_mmap.c
@@ -39,8 +39,8 @@
 int 
 xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len)
 {
-    mach_port_t device,iopl_dev;
-    memory_object_t iopl_mem;
+    mach_port_t device,mem_dev;
+    memory_object_t mem_obj;
     vm_address_t addr = (vm_address_t)0; /* serach starting address */
     kern_return_t err;
 
@@ -51,14 +51,14 @@ xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len)
 	errno = err;
 	FatalError("xf86ReadBIOS() can't get_privileged_ports. (%s)\n",strerror(errno));
     }
-    err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev);
+    err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev);
     mach_port_deallocate (mach_task_self (), device);
     if( err )
     {
 	errno = err;
 	FatalError("xf86ReadBIOS() can't device_open. (%s)\n",strerror(errno));
     }
-    err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&iopl_mem,0);
+    err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , BIOS_SIZE ,&mem_obj,0);
     if( err )
     {
 	errno = err;
@@ -69,13 +69,13 @@ xf86ReadBIOS(unsigned long Base,unsigned long Offset,unsigned char *Buf,int Len)
 		 BIOS_SIZE,
 		 0,
 		 TRUE,
-		 iopl_mem,
+		 mem_obj,
 		 Base,
 		 FALSE,
 		 VM_PROT_READ|VM_PROT_WRITE,
 		 VM_PROT_READ|VM_PROT_WRITE,
 		 VM_INHERIT_SHARE);
-    mach_port_deallocate(mach_task_self(),iopl_mem);
+    mach_port_deallocate(mach_task_self(),mem_obj);
     if( err )
     {
 	errno = err;
diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c
index 4a99db3..3d7af40 100644
--- a/hw/xfree86/os-support/hurd/hurd_video.c
+++ b/hw/xfree86/os-support/hurd/hurd_video.c
@@ -44,8 +44,8 @@
 static pointer
 mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags)
 {
-    mach_port_t device,iopl_dev;
-    memory_object_t iopl_mem;
+    mach_port_t device,mem_dev;
+    memory_object_t mem_obj;
     kern_return_t err;
     vm_address_t addr=(vm_address_t)0;
 
@@ -55,7 +55,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags)
 	errno = err;
 	FatalError("xf86MapVidMem() can't get_privileged_ports. (%s)\n",strerror(errno));
     }
-    err = device_open(device,D_READ|D_WRITE,"iopl",&iopl_dev);
+    err = device_open(device,D_READ|D_WRITE,"mem",&mem_dev);
     mach_port_deallocate (mach_task_self(), device);
     if( err )
     {
@@ -63,7 +63,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags)
 	FatalError("xf86MapVidMem() can't device_open. (%s)\n",strerror(errno));
     }
 
-    err = device_map(iopl_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&iopl_mem,0);
+    err = device_map(mem_dev,VM_PROT_READ|VM_PROT_WRITE, Base , Size ,&mem_obj,0);
     if( err )
     {
 	errno = err;
@@ -74,23 +74,23 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags)
 		 Size,
 		 0,     /* mask */
 		 TRUE,  /* anywhere */
-		 iopl_mem,
+		 mem_obj,
 		 (vm_offset_t)Base,
 		 FALSE, /* copy on write */
 		 VM_PROT_READ|VM_PROT_WRITE,
 		 VM_PROT_READ|VM_PROT_WRITE,
 		 VM_INHERIT_SHARE);
-    mach_port_deallocate(mach_task_self(),iopl_mem);
+    mach_port_deallocate(mach_task_self(),mem_obj);
     if( err )
     {
 	errno = err;
-	FatalError("xf86MapVidMem() can't vm_map.(iopl_mem) (%s)\n",strerror(errno));
+	FatalError("xf86MapVidMem() can't vm_map.(mem_obj) (%s)\n",strerror(errno));
     }
-    mach_port_deallocate(mach_task_self(),iopl_dev);
+    mach_port_deallocate(mach_task_self(),mem_dev);
     if( err )
     {
 	errno = err;
-	FatalError("xf86MapVidMem() can't mach_port_deallocate.(iopl_dev) (%s)\n",strerror(errno));
+	FatalError("xf86MapVidMem() can't mach_port_deallocate.(mem_dev) (%s)\n",strerror(errno));
     }
     return (pointer)addr;
 }
commit 290af0418f8c94355e42ad81aa7779b90e173fc9
Author: Chase Douglas <chase.douglas at ubuntu.com>
Date:   Thu Oct 21 22:41:09 2010 -0400

    test: input - set valuators mask for event to core conversion
    
    Commit de8be07cc0a8163b6ef04455706fd5ca2cebe587 adds a requirement to
    event to core conversion that at least one of the X or Y valuators are
    set in the valuator mask. This commit fixes the event conversion test to
    be compliant.
    
    Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/test/input.c b/test/input.c
index b90d3b4..f08e13b 100644
--- a/test/input.c
+++ b/test/input.c
@@ -182,6 +182,8 @@ static void dix_event_to_core(int type)
     ev.time     = time;
     ev.root_y   = x;
     ev.root_x   = y;
+    SetBit(ev.valuators.mask, 0);
+    SetBit(ev.valuators.mask, 1);
     ev.root     = ROOT_WINDOW_ID;
     ev.corestate = state;
     ev.detail.key = detail;
commit 8990b31214bcbc08090604147287455bfde91c11
Author: Paulius Zaleckas <paulius.zaleckas at gmail.com>
Date:   Mon Oct 18 00:02:01 2010 +0300

    KDrive: Fix error handlig in tslib driver
    
    If ts_open() fails and return NULL, then next call to ts_fd()
    segfaults because of NULL dereference. There is no need to
    check output of ts_fd() as ts_open() did this internally.
    
    Signed-off-by: Paulius Zaleckas <paulius.zaleckas at gmail.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c
index 48a0842..570cbf9 100644
--- a/hw/kdrive/linux/tslib.c
+++ b/hw/kdrive/linux/tslib.c
@@ -117,15 +117,22 @@ TslibEnable (KdPointerInfo *pi)
         pi->path = strdup("/dev/input/touchscreen0");
         ErrorF("[tslib/TslibEnable] no device path given, trying %s\n", pi->path);
     }
+
     private->tsDev = ts_open(pi->path, 0);
-    private->fd = ts_fd(private->tsDev);
-    if (!private->tsDev || ts_config(private->tsDev) || private->fd < 0) {
+    if (!private->tsDev) {
         ErrorF("[tslib/TslibEnable] failed to open %s\n", pi->path);
-        if (private->fd >= 0)
-            close(private->fd);
         return BadAlloc;
     }
 
+    if (ts_config(private->tsDev)) {
+        ErrorF("[tslib/TslibEnable] failed to load configuration\n");
+        ts_close(private->tsDev);
+        private->tsDev = NULL;
+        return BadValue;
+    }
+
+    private->fd = ts_fd(private->tsDev);
+
     KdRegisterFd(private->fd, TsRead, pi);
 
     return Success;


More information about the xorg-commit mailing list