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

Peter Hutterer whot at kemper.freedesktop.org
Sat Jun 12 22:28:20 PDT 2010


 Xi/exevents.c     |    4 ----
 exa/exa_classic.c |    3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit e50f84d69811baea04ef559d846e4588c4bc4c8e
Author: Éric Piel <E.A.B.Piel at tudelft.nl>
Date:   Fri Jun 11 09:16:32 2010 -0700

    exa: fix ExaCheckCopyNtoN for exa_classic when source = dest
    
    In case you want to copy a region with source = dest, you have the same pixmap
    as source and dest.
    
    At the end of exaPixmapIsOffscreen_classic() the devPrivate.ptr is reset to
    NULL (look at the sources).
    
    Now this is what happens in ExaCheckCopyNtoN:
    
    exaPrepareAccess( pDst );
       Calls IsOffscreen()
          sets devPrivate.ptr to NULL
       sets up devPrivate.ptr to real pointer
       Everything OK
    exaPrepareAccess( pSrc );
       Calls IsOffscreen()
          sets devPrivate.ptr to NULL
       BAILS OUT CAUSE OF NESTED OPERATION SINCE DST EQUALS SRC
    
    We end up with devPrivate.ptr as NULL, and that is clearly wrong.
    
    In particular this fixes a segfault when using the psb driver (bug 28077)
    
    Signed-off-by: Éric Piel <eric.piel at tremplin-utc.net>
    Reviewed-by: Michel Dänzer <michel at daenzer.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 7e8f1001217326cc451974bacf25275420c4bb4e)

diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index c31e2d4..9bc369e 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -256,9 +256,10 @@ exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap)
     Bool ret;
 
     if (pExaScr->info->PixmapIsOffscreen) {
+	void* old_ptr = pPixmap->devPrivate.ptr;
 	pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap);
 	ret = pExaScr->info->PixmapIsOffscreen(pPixmap);
-	pPixmap->devPrivate.ptr = NULL;
+	pPixmap->devPrivate.ptr = old_ptr;
     } else
 	ret = (pExaPixmap->use_gpu_copy && pExaPixmap->fb_ptr);
 
commit 75c1ba8b4fd0cbf5a6eb41fefc4ec728790589df
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Jun 10 12:21:36 2010 +1000

    Xi: don't copy the modifier key count when copying device classes (#25480)
    
    The modifier key count is maintained by the XKB layer and
    increased/decreased for all modifiers that set state.
    
    Test case, MD/SD modifier key count in comment:
    1. keyboard 1: press and hold Shift_L    # SD:1     MD:1
    2. keyboard 2: press and release Shift_L # SD:1,0   MD:1,0
    <class copy happens>                     # SD:1     MD:1
    3. keyboard 1: release Shift_L           # SD:0     MD:1
    4. keyboard 1: press and release Shift_L # SD:1,0   MD:2,1
    
    The modifier is now logically down on the MD but not on keyboard 1 or
    keyboard 2.
    
    XKB is layered in before the DIX, it increases/decreases the modifier key
    count accordingly. In the above example, during (2), the MD gets the key
    release and thus clears the modifier bit. (3) doesn't forward the release to
    the MD because it is already cleared. The copy of modifierKeysDown when the
    lastSlave changes however increases the counter for the held key. On (4),
    the press and release are both forwarded to the MD, causing a offset by 1
    and thus do not clear the logical modifier state.
    
    X.Org Bug 25480 <http://bugs.freedesktop.org/show_bug.cgi?id=25480>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit dc614484f93b67e8b62dbb1bb2fd247fe5a4c850)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index e680f6f..566b0ef 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -196,16 +196,12 @@ void
 CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
 {
     KeyClassPtr mk = master->key;
-    KeyClassPtr dk = device->key;
-    int i;
 
     if (device == master)
         return;
 
     mk->sourceid = device->id;
 
-    for (i = 0; i < 8; i++)
-        mk->modifierKeyCount[i] = dk->modifierKeyCount[i];
 
     if (!XkbCopyDeviceKeymap(master, device))
         FatalError("Couldn't pivot keymap from device to core!\n");


More information about the xorg-commit mailing list