[xserver] xfree86: Hold input_lock across SPRITE functions in VGA arbiter

Submitted by Keith Packard on Aug. 3, 2017, 4:34 a.m.

Details

Message ID 20170803043452.19210-1-keithp@keithp.com
State Accepted
Commit cf7517675d988c2d1ff967d6d162a17acbdad466
Headers show
Series "xfree86: Hold input_lock across SPRITE functions in VGA arbiter" ( rev: 1 ) in X.org (DEPRECATED - USE GITLAB)

Not browsing as part of any series.

Commit Message

Keith Packard Aug. 3, 2017, 4:34 a.m.
Avoid scrambling the sprite functions wrapper.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101995
Signed-off-by: Keith Packard <keithp@keithp.com>
---
 hw/xfree86/common/xf86VGAarbiterPriv.h | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index 09be10aa3..03db55700 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -73,14 +73,20 @@ 
 
 #define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
 
-#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \
-    (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, \
-    miPointerScreenKey); VGAarbiterScreenPtr pScreenPriv = \
-    ((VGAarbiterScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
-    VGAarbiterScreenKey)); PointPriv->spriteFuncs = pScreenPriv->miSprite;
+#define SPRITE_PROLOG                                           \
+    miPointerScreenPtr PointPriv;                               \
+    VGAarbiterScreenPtr pScreenPriv;                            \
+    input_lock();                                               \
+    PointPriv = dixLookupPrivate(&pScreen->devPrivates,         \
+                                 miPointerScreenKey);           \
+    pScreenPriv = dixLookupPrivate(&(pScreen)->devPrivates,     \
+                                   VGAarbiterScreenKey);        \
+    PointPriv->spriteFuncs = pScreenPriv->miSprite;             \
 
-#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\
-    PointPriv->spriteFuncs  = &VGAarbiterSpriteFuncs;
+#define SPRITE_EPILOG                                   \
+    pScreenPriv->miSprite = PointPriv->spriteFuncs;     \
+    PointPriv->spriteFuncs  = &VGAarbiterSpriteFuncs;   \
+    input_unlock();
 
 #define WRAP_SPRITE do { pScreenPriv->miSprite = PointPriv->spriteFuncs;\
     	PointPriv->spriteFuncs  = &VGAarbiterSpriteFuncs; 		\

Comments

On Wed, 2017-08-02 at 21:34 -0700, Keith Packard wrote:
> Avoid scrambling the sprite functions wrapper.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101995
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
>  hw/xfree86/common/xf86VGAarbiterPriv.h | 20 +++++++++++++-------
>  1 file changed, 13 insertions(+), 7 deletions(-)

remote: I: patch #170077 updated using rev cf7517675d988c2d1ff967d6d162a17acbdad466.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   3265d0c81f..cf7517675d  master -> master

- ajax