<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Michel Dänzer <michel@daenzer.net><br>
<b>Sent:</b> Friday, December 22, 2017 12:39:43 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> [PATCH xf86-video-amdgpu 1/2] Move cursor related ScreenInit calls into AMDGPUCursorInit_KMS</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Michel Dänzer <michel.daenzer@amd.com><br>
<br>
And bail if xf86_cursors_init fails.<br>
<br>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com><br>
---<br>
 src/amdgpu_kms.c | 44 +++++++++++++++++++++++++-------------------<br>
 1 file changed, 25 insertions(+), 19 deletions(-)<br>
<br>
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c<br>
index c15711224..58531bf33 100644<br>
--- a/src/amdgpu_kms.c<br>
+++ b/src/amdgpu_kms.c<br>
@@ -1523,12 +1523,29 @@ static Bool AMDGPUCursorInit_KMS(ScreenPtr pScreen)<br>
         ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);<br>
         AMDGPUInfoPtr info = AMDGPUPTR(pScrn);<br>
 <br>
-       return xf86_cursors_init(pScreen, info->cursor_w, info->cursor_h,<br>
-                                (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |<br>
-                                 HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |<br>
-                                 HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 |<br>
-                                 HARDWARE_CURSOR_UPDATE_UNHIDDEN |<br>
-                                 HARDWARE_CURSOR_ARGB));<br>
+       xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,<br>
+                      "Initializing Cursor\n");<br>
+<br>
+       /* Set Silken Mouse */<br>
+       xf86SetSilkenMouse(pScreen);<br>
+<br>
+       /* Cursor setup */<br>
+       miDCInitialize(pScreen, xf86GetPointerScreenFuncs());<br>
+<br>
+       if (xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE))<br>
+               return TRUE;<br>
+<br>
+       if (!xf86_cursors_init(pScreen, info->cursor_w, info->cursor_h,<br>
+                              HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |<br>
+                              HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |<br>
+                              HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 |<br>
+                              HARDWARE_CURSOR_UPDATE_UNHIDDEN |<br>
+                              HARDWARE_CURSOR_ARGB)) {<br>
+               xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86_cursors_init failed\n");<br>
+               return FALSE;<br>
+       }<br>
+<br>
+       return TRUE;<br>
 }<br>
 <br>
 void AMDGPUBlank(ScrnInfoPtr pScrn)<br>
@@ -1858,19 +1875,8 @@ Bool AMDGPUScreenInit_KMS(ScreenPtr pScreen, int argc, char **argv)<br>
                        "Initializing DPMS\n");<br>
         xf86DPMSInit(pScreen, xf86DPMSSet, 0);<br>
 <br>
-       xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,<br>
-                      "Initializing Cursor\n");<br>
-<br>
-       /* Set Silken Mouse */<br>
-       xf86SetSilkenMouse(pScreen);<br>
-<br>
-       /* Cursor setup */<br>
-       miDCInitialize(pScreen, xf86GetPointerScreenFuncs());<br>
-<br>
-       if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {<br>
-               if (AMDGPUCursorInit_KMS(pScreen)) {<br>
-               }<br>
-       }<br>
+       if (!AMDGPUCursorInit_KMS(pScreen))<br>
+               return FALSE;<br>
 <br>
         /* DGA setup */<br>
 #ifdef XFreeXDGA<br>
-- <br>
2.15.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>