[PATCH xfree86] Skip SetCursor when vtSema is FALSE.

Yogish Kulkarni yogishk at nvidia.com
Wed Oct 22 00:25:28 PDT 2014


Consider below sequence -
1) Cursor is removed : isUp will be FALSE if HW cursor is set.
2) VT switched away from X : vtSema becomes FALSE.
3) xf86CursorSetCursor is called with non-null CursorPtr :
Saves the passed in CursorPtr, fallbacks to SW cursor and invokes
spriteFuncs->SetCursor which saves the area under cursor and restores
the cursor. This sets isUp to TRUE and as vtSema is FALSE saved data
is garbage.
4) VT switched to X : vtSema becomes TRUE. xf86Cursor enable fb access
is called which will remove the SW cursor, i.e copies saved data in #3
to screen.

This results to momentary garbage data on screen. Hence when !vtSema
skip spriteFuncs->SetCursor.

X.Org Bug 85313 <https://bugs.freedesktop.org/show_bug.cgi?id=85313>

Signed-off-by: Yogish Kulkarni <yogishk at nvidia.com>
---
 hw/xfree86/ramdac/xf86Cursor.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index 4a4def5..98edb88 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -333,8 +333,10 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
         ScreenPriv->HotX = pCurs->bits->xhot;
         ScreenPriv->HotY = pCurs->bits->yhot;
 
-        if (!infoPtr->pScrn->vtSema)
+        if (!infoPtr->pScrn->vtSema) {
             ScreenPriv->SavedCursor = pCurs;
+            return;
+        }
 
         if (infoPtr->pScrn->vtSema &&
             (ScreenPriv->ForceHWCursorCount ||
-- 
1.8.1.5


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


More information about the xorg-devel mailing list