summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-12-22 17:09:07 +0100
committerMichel Dänzer <michel@daenzer.net>2017-12-22 17:09:07 +0100
commitdfccaa7043ccb157a1f8be7313123792bb7e7001 (patch)
tree4f81c3a9de766faa8c10734436e3b3073406e15f
parent1d65ac395971571094df21ca0408d5972c6b56ec (diff)
Move cursor related ScreenInit calls into AMDGPUCursorInit_KMS
And bail if xf86_cursors_init fails. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_kms.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index c157112..58531bf 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1523,12 +1523,29 @@ static Bool AMDGPUCursorInit_KMS(ScreenPtr pScreen)
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
AMDGPUInfoPtr info = AMDGPUPTR(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, AMDGPU_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 AMDGPUBlank(ScrnInfoPtr pScrn)
@@ -1858,19 +1875,8 @@ Bool AMDGPUScreenInit_KMS(ScreenPtr pScreen, int argc, char **argv)
"Initializing DPMS\n");
xf86DPMSInit(pScreen, xf86DPMSSet, 0);
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
- "Initializing Cursor\n");
-
- /* Set Silken Mouse */
- xf86SetSilkenMouse(pScreen);
-
- /* Cursor setup */
- miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
-
- if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
- if (AMDGPUCursorInit_KMS(pScreen)) {
- }
- }
+ if (!AMDGPUCursorInit_KMS(pScreen))
+ return FALSE;
/* DGA setup */
#ifdef XFreeXDGA