xserver: Branch 'master' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Thu Oct 13 09:41:23 UTC 2016


 hw/xfree86/ramdac/xf86HWCurs.c |   37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

New commits:
commit 9cf0bd4d4507dca6234024605b14724713f2109e
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Oct 5 18:28:45 2016 +0900

    xf86Cursor: Take the input lock in xf86Set/MoveCursor
    
    Prevents the HW cursor from intermittently jumping around when the
    cursor image is changed while the cursor is being moved. This is hardly
    noticeable in normal operation but can be quite confusing when stepping
    through these codepaths in a debugger.
    
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index c455902..da2b181 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -215,12 +215,15 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
         (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
                                                xf86CursorScreenKey);
     ScreenPtr pSlave;
+    Bool ret = FALSE;
+
+    input_lock();
 
     x -= ScreenPriv->HotX;
     y -= ScreenPriv->HotY;
 
     if (!xf86ScreenSetCursor(pScreen, pCurs, x, y))
-        return FALSE;
+        goto out;
 
     /* ask each slave driver to set the cursor. */
     xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) {
@@ -233,10 +236,14 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
              * otherwise both the hw and sw cursor will show.
              */
             xf86SetCursor(pScreen, NullCursor, x, y);
-            return FALSE;
+            goto out;
         }
     }
-    return TRUE;
+    ret = TRUE;
+
+ out:
+    input_unlock();
+    return ret;
 }
 
 void
@@ -283,6 +290,8 @@ xf86MoveCursor(ScreenPtr pScreen, int x, int y)
                                                xf86CursorScreenKey);
     ScreenPtr pSlave;
 
+    input_lock();
+
     x -= ScreenPriv->HotX;
     y -= ScreenPriv->HotY;
 
@@ -295,6 +304,8 @@ xf86MoveCursor(ScreenPtr pScreen, int x, int y)
 
         xf86ScreenMoveCursor(pSlave, x, y);
     }
+
+    input_unlock();
 }
 
 void
commit 011ce3297d924e78ef0254b0451561946bd8be8d
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Oct 5 18:01:29 2016 +0900

    xf86Cursor: Use PRIME master xf86CursorScreenRec::HotX/Y for slaves
    
    xf86CursorScreenRec::HotX/Y contain 0 for PRIME slave screens.
    
    Fixes incorrect HW cursor position on PRIME slave screens.
    
    Also hoist the hotspot translation out from xf86ScreenSet/MoveCursor to
    xf86Set/MoveCursor, since the hotspot position is a property of the
    cursor, not the screen.
    
    v2:
    * Squash patches 1 & 2 of the v1 series, since it's basically the same
      problem
    * Use the master screen's xf86CursorScreenRec::HotX/Y instead of
      CursorRec::bits->x/yhot, since CursorRec::bits can be NULL (Hans de
      Goede)
    
    Reviewed-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index e8966ed..c455902 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -179,8 +179,8 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
     bits =
         dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen);
 
-    x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
-    y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
+    x -= infoPtr->pScrn->frameX0;
+    y -= infoPtr->pScrn->frameY0;
 
     if (!pCurs->bits->argb || !xf86DriverHasLoadCursorARGB(infoPtr))
         if (!bits) {
@@ -211,8 +211,14 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
 Bool
 xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
 {
+    xf86CursorScreenPtr ScreenPriv =
+        (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
+                                               xf86CursorScreenKey);
     ScreenPtr pSlave;
 
+    x -= ScreenPriv->HotX;
+    y -= ScreenPriv->HotY;
+
     if (!xf86ScreenSetCursor(pScreen, pCurs, x, y))
         return FALSE;
 
@@ -263,8 +269,8 @@ xf86ScreenMoveCursor(ScreenPtr pScreen, int x, int y)
                                                xf86CursorScreenKey);
     xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
 
-    x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
-    y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
+    x -= infoPtr->pScrn->frameX0;
+    y -= infoPtr->pScrn->frameY0;
 
     (*infoPtr->SetCursorPosition) (infoPtr->pScrn, x, y);
 }
@@ -272,8 +278,14 @@ xf86ScreenMoveCursor(ScreenPtr pScreen, int x, int y)
 void
 xf86MoveCursor(ScreenPtr pScreen, int x, int y)
 {
+    xf86CursorScreenPtr ScreenPriv =
+        (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
+                                               xf86CursorScreenKey);
     ScreenPtr pSlave;
 
+    x -= ScreenPriv->HotX;
+    y -= ScreenPriv->HotY;
+
     xf86ScreenMoveCursor(pScreen, x, y);
 
     /* ask each slave driver to move the cursor */


More information about the xorg-commit mailing list