From 08fc33042c858568e7244eb9ad25a8d0270754f0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 18 Apr 2014 13:55:50 -0700 Subject: [PATCH] hw/xfree86: Fix block handler wrapping in xf86Rotate xf86Rotate, it was delaying unwrapping the BlockHandler until after calling xf86RotateRedisplay. If there was a software cursor on the screen, the redisplay operation would cause cursor to be removed from the frame buffer and the misprite block handler to be inserted into the block handler chain with the misprite screen private saved block handler now set to xf86RotateBlockHandler. When xf86RotateRedisplay returned, xf86RotateBlockHandler would then set screen->BlockHandler to its saved value, call down and then reset screen->BlockHandler to xf86RotateBlockHandler. miSpriteBlockHandler would never be called after that, which meant that the software cursor will now disappear from the screen whenever rendering overlapped and would only reappear when the cursor was moved. To correct this, all that is needed is to move the restoration of screen->BlockHandler to the top of xf86RotateBlockHandler, before the call to xf86RotateRedisplay. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt --- hw/xfree86/modes/xf86Rotate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 0ddd8408e..99dcb43cb 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -234,8 +234,14 @@ xf86RotateBlockHandler(ScreenPtr pScreen, ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - xf86RotateRedisplay(pScreen); + /* Unwrap before redisplay in case the software + * cursor layer wants to add its block handler to the + * chain + */ pScreen->BlockHandler = xf86_config->BlockHandler; + + xf86RotateRedisplay(pScreen); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); /* cannot avoid re-wrapping until all wrapping is audited */ xf86_config->BlockHandler = pScreen->BlockHandler;