xserver: Branch 'master' - 4 commits

Peter Hutterer whot at kemper.freedesktop.org
Tue Feb 7 23:52:19 UTC 2017


 hw/xfree86/ramdac/xf86HWCurs.c |   55 +++++++++++++++++++++++++++++++----------
 hw/xwayland/xwayland-input.c   |    6 ++--
 hw/xwayland/xwayland-output.c  |    2 -
 3 files changed, 46 insertions(+), 17 deletions(-)

New commits:
commit 0702f2e840370be53d129fc5e3c243dac47ee720
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Feb 7 11:44:51 2017 +1000

    xwayland: replace hardcoded function name with __func__ in error msg
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 580df09..cc83ef8 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -854,7 +854,7 @@ touch_handle_down(void *data, struct wl_touch *wl_touch,
 
     xwl_touch = calloc(1, sizeof *xwl_touch);
     if (xwl_touch == NULL) {
-        ErrorF("touch_handle_down ENOMEM");
+        ErrorF("%s: ENOMEM\n", __func__);
         return;
     }
 
@@ -1125,7 +1125,7 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version
 
     xwl_seat = calloc(1, sizeof *xwl_seat);
     if (xwl_seat == NULL) {
-        ErrorF("create_input ENOMEM\n");
+        ErrorF("%s: ENOMEM\n", __func__);
         return;
     }
 
@@ -1452,7 +1452,7 @@ xwl_pointer_warp_emulator_create(struct xwl_seat *xwl_seat)
 
     warp_emulator = calloc(1, sizeof *warp_emulator);
     if (!warp_emulator) {
-        ErrorF("%s: ENOMEM", __func__);
+        ErrorF("%s: ENOMEM\n", __func__);
         return NULL;
     }
 
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index f3ce763..d13a728 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -244,7 +244,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id)
 
     xwl_output = calloc(1, sizeof *xwl_output);
     if (xwl_output == NULL) {
-        ErrorF("create_output ENOMEM\n");
+        ErrorF("%s ENOMEM\n", __func__);
         return NULL;
     }
 
commit 3eb964e25243056dd998f52d3b00171b71c89189
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 20 09:49:19 2017 +0000

    xfree86: Take input_lock() for xf86ScreenCheckHWCursor

diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index 26dc7e5..7043a9c 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -139,9 +139,14 @@ Bool
 xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr)
 {
     ScreenPtr pSlave;
+    Bool use_hw_cursor = TRUE;
 
-    if (!xf86ScreenCheckHWCursor(pScreen, cursor, infoPtr))
-        return FALSE;
+    input_lock();
+
+    if (!xf86ScreenCheckHWCursor(pScreen, cursor, infoPtr)) {
+        use_hw_cursor = FALSE;
+	goto unlock;
+    }
 
     /* ask each driver consuming a pixmap if it can support HW cursor */
     xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) {
@@ -151,14 +156,22 @@ xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr
             continue;
 
         sPriv = dixLookupPrivate(&pSlave->devPrivates, xf86CursorScreenKey);
-        if (!sPriv) /* NULL if Option "SWCursor", possibly other conditions */
-            return FALSE;
+        if (!sPriv) { /* NULL if Option "SWCursor", possibly other conditions */
+            use_hw_cursor = FALSE;
+	    break;
+	}
 
         /* FALSE if HWCursor not supported by slave */
-        if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr))
-            return FALSE;
+        if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr)) {
+            use_hw_cursor = FALSE;
+	    break;
+	}
     }
-    return TRUE;
+
+unlock:
+    input_unlock();
+
+    return use_hw_cursor;
 }
 
 static Bool
commit cfddd919cce4178baba07959e5e862d02e166522
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jan 16 22:36:34 2017 +0000

    xfree86: Take input lock for xf86TransparentCursor

diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index 55d5861..26dc7e5 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -261,6 +261,8 @@ xf86SetTransparentCursor(ScreenPtr pScreen)
                                                xf86CursorScreenKey);
     xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
 
+    input_lock();
+
     if (!ScreenPriv->transparentData)
         ScreenPriv->transparentData =
             (*infoPtr->RealizeCursor) (infoPtr, NullCursor);
@@ -273,6 +275,8 @@ xf86SetTransparentCursor(ScreenPtr pScreen)
                                    ScreenPriv->transparentData);
 
     (*infoPtr->ShowCursor) (infoPtr->pScrn);
+
+    input_unlock();
 }
 
 static void
commit 7198a6d4e74f684cb383b3e0f70dd2bae405e6e7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jan 16 22:17:36 2017 +0000

    xfree86: Take the input lock for xf86RecolorCursor
    
    xf86RecolorCursor() may be called directly from XRecolorCursor as well
    as from xf86ScreenSetCursor(). In the latter case, the input lock is
    already held, but not for the former and so we need to add a wrapper
    function that acquires the input lock before performing
    xf86RecolorCursor()
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=99358

diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index 4481320..55d5861 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -22,6 +22,9 @@
 
 #include "servermd.h"
 
+static void
+xf86RecolorCursor_locked(xf86CursorScreenPtr ScreenPriv, CursorPtr pCurs);
+
 static CARD32
 xf86ReverseBitOrder(CARD32 v)
 {
@@ -204,7 +207,7 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
         if (!xf86DriverLoadCursorImage (infoPtr, bits))
             return FALSE;
 
-    xf86RecolorCursor(pScreen, pCurs, 1);
+    xf86RecolorCursor_locked (ScreenPriv, pCurs);
 
     (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y);
 
@@ -312,12 +315,9 @@ xf86MoveCursor(ScreenPtr pScreen, int x, int y)
     input_unlock();
 }
 
-void
-xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
+static void
+xf86RecolorCursor_locked(xf86CursorScreenPtr ScreenPriv, CursorPtr pCurs)
 {
-    xf86CursorScreenPtr ScreenPriv =
-        (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
-                                               xf86CursorScreenKey);
     xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
 
     /* recoloring isn't applicable to ARGB cursors and drivers
@@ -357,6 +357,18 @@ xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
     }
 }
 
+void
+xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
+{
+    xf86CursorScreenPtr ScreenPriv =
+        (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
+                                               xf86CursorScreenKey);
+
+    input_lock();
+    xf86RecolorCursor_locked (ScreenPriv, pCurs);
+    input_unlock();
+}
+
 /* These functions assume that MaxWidth is a multiple of 32 */
 static unsigned char *
 RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)


More information about the xorg-commit mailing list