[PATCH xf86-video-r128 v2] Evaluate software cursor option inside R128PreInit

Kevin Brace kevinbrace at gmx.com
Thu Jul 26 17:21:33 UTC 2018


Since SWCursor option is referenced only once, it should be handled
inside R128PreInit callback function rather than R128ScreenInit
callback function.

Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
---
 src/r128.h        | 1 +
 src/r128_driver.c | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/r128.h b/src/r128.h
index 17ffbc5..032c40b 100644
--- a/src/r128.h
+++ b/src/r128.h
@@ -349,6 +349,7 @@ typedef struct {
     int               fifo_slots;   /* Free slots in the FIFO (64 max)       */
     int               pix24bpp;     /* Depth of pixmap for 24bpp framebuffer */
     Bool              dac6bits;     /* Use 6 bit DAC?                        */
+    Bool              swCursor;
 
 				/* Computed values for Rage 128 */
     int               pitch;
diff --git a/src/r128_driver.c b/src/r128_driver.c
index 7cc788b..57f4d05 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -1345,6 +1345,8 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 #endif
 #endif
 
+    info->swCursor = FALSE;
+
     /* By default, don't do VGA IOs on ppc */
 #if defined(__powerpc__) || defined(__sparc__) || !defined(WITH_VGAHW)
     info->VGAAccess = FALSE;
@@ -1433,6 +1435,11 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 		   "Using framebuffer device\n");
     }
 
+    if (xf86ReturnOptValBool(info->Options,
+                                OPTION_SW_CURSOR, FALSE)) {
+        info->swCursor = TRUE;
+    }
+
     /* Allocate an xf86CrtcConfig */
     xf86CrtcConfigInit(pScrn, &R128CRTCResizeFuncs);
 
@@ -2082,7 +2089,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
     miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
 
 				/* Hardware cursor setup */
-    if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
+    if (!info->swCursor) {
 	if (R128CursorInit(pScreen)) {
 	    int width, height;
 
-- 
2.7.4



More information about the xorg-driver-ati mailing list