summaryrefslogtreecommitdiff
path: root/src/radeon_kms.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-03-07 17:28:55 +0100
committerMichel Dänzer <michel@daenzer.net>2018-03-07 17:28:55 +0100
commitb915e8e6fb956e983c2ce2a5565c20838c85707c (patch)
treefe04665a6450b4a5cb6af674028188d475d0547d /src/radeon_kms.c
parent7e18aea984e186dd2ab1144470b0c0e832562ad1 (diff)
Wrap the whole miPointerScreenFuncRec, instead of only Set/MoveCursor
We were clobbering entries in mi's global miSpritePointerFuncs struct, which cannot work correctly with multiple primary screens. Instead, assign a pointer to our own wrapper struct to PointPriv->spriteFuncs. Fixes crashes with multiple primary screens. Fixes: 1fe8ca75974c ("Keep track of how many SW cursors are visible on each screen") Reported-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r--src/radeon_kms.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 790d4be1..8c3d15eb 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -2017,12 +2017,8 @@ static Bool RADEONCursorInit_KMS(ScreenPtr pScreen)
return FALSE;
}
- if (PointPriv->spriteFuncs->SetCursor != drmmode_sprite_set_cursor) {
- info->SetCursor = PointPriv->spriteFuncs->SetCursor;
- info->MoveCursor = PointPriv->spriteFuncs->MoveCursor;
- PointPriv->spriteFuncs->SetCursor = drmmode_sprite_set_cursor;
- PointPriv->spriteFuncs->MoveCursor = drmmode_sprite_move_cursor;
- }
+ info->SpriteFuncs = PointPriv->spriteFuncs;
+ PointPriv->spriteFuncs = &drmmode_sprite_funcs;
}
if (xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE))
@@ -2186,10 +2182,8 @@ static Bool RADEONCloseScreen_KMS(ScreenPtr pScreen)
miPointerScreenPtr PointPriv =
dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
- if (PointPriv->spriteFuncs->SetCursor == drmmode_sprite_set_cursor) {
- PointPriv->spriteFuncs->SetCursor = info->SetCursor;
- PointPriv->spriteFuncs->MoveCursor = info->MoveCursor;
- }
+ if (PointPriv->spriteFuncs == &drmmode_sprite_funcs)
+ PointPriv->spriteFuncs = info->SpriteFuncs;
}
pScreen->BlockHandler = info->BlockHandler;