xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Feb 12 08:23:20 PST 2013


 hw/xfree86/common/xf86Events.c |    4 ++--
 randr/rrcrtc.c                 |    5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 7115f6c709898a5124b67e19c61dc01334471358
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Wed Jan 23 16:58:47 2013 -0800

    randr: unref the provider shared pixmap the appropriate number of times
    
    When an RandR shared pixmap is created in rrCreateSharedPixmap, it has a refcnt
    of 1.  Then, PixmapShareToSlave bumps the refcnt to 2.  However, there's no
    corresponding PixmapUnshareFromSlave where the refcnt can be decreased again,
    and there's no convenient common place where the refcnt can be decremented when
    the slave pixmap is destroyed.
    
    Fix this by just unreffing the pixmap twice in RRCrtcDetachScanoutPixmap.
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index e82d050..6e2eca5 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -372,6 +372,11 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
     ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
     if (crtc->scanout_pixmap) {
         master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap);
+        /*
+         * Unref the pixmap twice: once for the original reference, and once
+         * for the reference implicitly added by PixmapShareToSlave.
+         */
+        master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
         master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
         crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap);
     }
commit da92690107d90061205340d4cdc98b73b59db9b2
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Mon Feb 11 14:31:56 2013 -0800

    xf86: use nt_list_for_each_entry_safe to walk InputHandlers in xf86Wakeup
    
    This is necessary when the input handler deletes itself from the
    list. Bug found by Maarten Lankhorst, this patch uses the list macros
    instead of open-coding the fix.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 377e936..d92174e 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -272,9 +272,9 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
     }
 
     if (err >= 0) {             /* we don't want the handlers called if select() */
-        IHPtr ih;               /* returned with an error condition, do we?      */
+        IHPtr ih, ih_tmp;       /* returned with an error condition, do we?      */
 
-        for (ih = InputHandlers; ih; ih = ih->next) {
+        nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) {
             if (ih->enabled && ih->fd >= 0 && ih->ihproc &&
                 (FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) {
                 ih->ihproc(ih->fd, ih->data);


More information about the xorg-commit mailing list