diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-20 09:49:19 +0000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-02-17 10:14:03 +1000 |
commit | 9a9c6af22e0f0136b11d7c19ce06c48e720a9ca4 (patch) | |
tree | 1700f1364f6f6556aa72c96bae7e0e096f59daa6 | |
parent | 2a6904306f9cebc30aa472956a3417ff02221d00 (diff) |
xfree86: Take input_lock() for xf86ScreenCheckHWCursor
(cherry picked from commit 3eb964e25243056dd998f52d3b00171b71c89189)
-rw-r--r-- | hw/xfree86/ramdac/xf86HWCurs.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c index 26dc7e5af..7043a9c72 100644 --- a/hw/xfree86/ramdac/xf86HWCurs.c +++ b/hw/xfree86/ramdac/xf86HWCurs.c @@ -139,9 +139,14 @@ Bool xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr) { ScreenPtr pSlave; + Bool use_hw_cursor = TRUE; - if (!xf86ScreenCheckHWCursor(pScreen, cursor, infoPtr)) - return FALSE; + input_lock(); + + if (!xf86ScreenCheckHWCursor(pScreen, cursor, infoPtr)) { + use_hw_cursor = FALSE; + goto unlock; + } /* ask each driver consuming a pixmap if it can support HW cursor */ xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) { @@ -151,14 +156,22 @@ xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr continue; sPriv = dixLookupPrivate(&pSlave->devPrivates, xf86CursorScreenKey); - if (!sPriv) /* NULL if Option "SWCursor", possibly other conditions */ - return FALSE; + if (!sPriv) { /* NULL if Option "SWCursor", possibly other conditions */ + use_hw_cursor = FALSE; + break; + } /* FALSE if HWCursor not supported by slave */ - if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr)) - return FALSE; + if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr)) { + use_hw_cursor = FALSE; + break; + } } - return TRUE; + +unlock: + input_unlock(); + + return use_hw_cursor; } static Bool |