diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2017-12-27 17:05:26 +0100 |
---|---|---|
committer | Michel Dänzer <michel.daenzer@amd.com> | 2017-12-27 17:05:26 +0100 |
commit | b4ce8913ac392df339081f6f3e28bf79a239ee75 (patch) | |
tree | 2c405f9128bf918a328f65e16f0c3af9b5579148 | |
parent | ee907e9b9563609cb4a4817e17215b50bb1c7177 (diff) |
Move cursor related ScreenInit calls into RADEONCursorInit_KMS
And bail if xf86_cursors_init fails.
(Ported from amdgpu commit dfccaa7043ccb157a1f8be7313123792bb7e7001)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/radeon_kms.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index a9300d40..602a8fb7 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -1982,12 +1982,29 @@ static Bool RADEONCursorInit_KMS(ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); RADEONInfoPtr info = RADEONPTR(pScrn); - return xf86_cursors_init (pScreen, info->cursor_w, info->cursor_h, - (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | - HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | - HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 | - HARDWARE_CURSOR_UPDATE_UNHIDDEN | - HARDWARE_CURSOR_ARGB)); + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, + "Initializing Cursor\n"); + + /* Set Silken Mouse */ + xf86SetSilkenMouse(pScreen); + + /* Cursor setup */ + miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); + + if (xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) + return TRUE; + + if (!xf86_cursors_init(pScreen, info->cursor_w, info->cursor_h, + HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | + HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 | + HARDWARE_CURSOR_UPDATE_UNHIDDEN | + HARDWARE_CURSOR_ARGB)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86_cursors_init failed\n"); + return FALSE; + } + + return TRUE; } void @@ -2330,19 +2347,8 @@ Bool RADEONScreenInit_KMS(ScreenPtr pScreen, int argc, char **argv) "Initializing DPMS\n"); xf86DPMSInit(pScreen, xf86DPMSSet, 0); - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, - "Initializing Cursor\n"); - - /* Set Silken Mouse */ - xf86SetSilkenMouse(pScreen); - - /* Cursor setup */ - miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); - - if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { - if (RADEONCursorInit_KMS(pScreen)) { - } - } + if (!RADEONCursorInit_KMS(pScreen)) + return FALSE; /* DGA setup */ #ifdef XFreeXDGA |