xf86-video-r128: Branch 'master' - 8 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 30 05:13:01 UTC 2018


 configure.ac      |    2 
 src/r128.h        |    1 
 src/r128_accel.c  |    1 
 src/r128_driver.c |  229 +++++++++++++++++++++++++++++++++---------------------
 src/r128_exa.c    |   12 --
 5 files changed, 143 insertions(+), 102 deletions(-)

New commits:
commit 641d3d42b7214d01addfd21efb692531849b4603
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jul 27 11:22:49 2018 -0700

    Version bumped to 6.11.100
    
    Performed code refactoring and made tweaks to initialization behavior.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index 69ab65e..fd78f41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-r128],
-        [6.11.99],
+        [6.11.100],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-r128])
 AC_CONFIG_SRCDIR([Makefile.am])
commit 7dbb89d6fd11d3521b8a0085f4d9640910081bf2
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jul 27 11:08:29 2018 -0700

    Move loading of EXA and XAA modules into R128PreInitAccel
    
    Moving them away from R128ScreenInit callback function. This is how
    other DDXs do it.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/r128_accel.c b/src/r128_accel.c
index bfadaf6..589f49b 100644
--- a/src/r128_accel.c
+++ b/src/r128_accel.c
@@ -1909,7 +1909,6 @@ R128XAAAccelInit(ScreenPtr pScreen)
     R128InfoPtr   info  = R128PTR(pScrn);
     XAAInfoRecPtr a;
 
-    if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE;
     if (!(a = info->accel = XAACreateInfoRec())) return FALSE;
 
 #ifdef R128DRI
diff --git a/src/r128_driver.c b/src/r128_driver.c
index 773038c..afa41ca 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -1325,6 +1325,46 @@ exit:
     return ret;
 }
 
+static void
+R128PreInitAccel(ScrnInfoPtr pScrn)
+{
+    R128InfoPtr      info = R128PTR(pScrn);
+#ifdef USE_EXA
+    int errmaj, errmin;
+#endif
+
+    if (!info->noAccel) {
+        if (info->useEXA) {
+#ifdef USE_EXA
+            info->exaReq.majorversion = EXA_VERSION_MAJOR;
+            info->exaReq.minorversion = EXA_VERSION_MINOR;
+
+            xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Loading EXA module...\n");
+            if (LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL,
+                                &info->exaReq, &errmaj, &errmin)) {
+                info->accelOn = TRUE;
+                xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                            "EXA acceleration enabled.\n");
+            } else {
+                LoaderErrorMsg(NULL, "exa", errmaj, errmin);
+            }
+#endif
+        }
+
+        if ((!info->useEXA) ||
+            ((info->useEXA) && (!info->accelOn))) {
+#ifdef HAVE_XAA_H
+            if (xf86LoadSubModule(pScrn, "xaa")) {
+                info->accelOn = TRUE;
+                xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                            "XAA acceleration enabled.\n");
+            }
+#endif
+        }
+    }
+}
+
 /* R128PreInit is called once at server startup. */
 Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 {
@@ -1404,6 +1444,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
 
     info->noAccel = FALSE;
+    info->accelOn = FALSE;
 
     info->useEXA = FALSE;
 #ifdef USE_EXA
@@ -1467,6 +1508,8 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
     /* Get ScreenInit function */
     if (!xf86LoadSubModule(pScrn, "fb")) return FALSE;
 
+    R128PreInitAccel(pScrn);
+
     info->CurrentLayout.displayWidth = pScrn->displayWidth;
 
     if (!xf86RandR12PreInit(pScrn)) {
@@ -1630,14 +1673,10 @@ R128AccelInit(Bool noAccel, ScreenPtr pScreen)
     ScrnInfoPtr pScrn  = xf86ScreenToScrn(pScreen);
     R128InfoPtr info   = R128PTR(pScrn);
 
-    /* Initially, assume that acceleration is off. */
-    info->accelOn = FALSE;
-
     if (!noAccel) {
         if (info->useEXA) {
 #ifdef USE_EXA
             if (R128EXAAccelInit(pScreen)) {
-                info->accelOn = TRUE;
                 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                             "EXA acceleration enabled.\n");
             }
@@ -1648,7 +1687,6 @@ R128AccelInit(Bool noAccel, ScreenPtr pScreen)
             ((info->useEXA) && (!info->accelOn))) {
 #ifdef HAVE_XAA_H
             if (R128XAAAccelInit(pScreen)) {
-                info->accelOn = TRUE;
                 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                             "XAA acceleration enabled.\n");
             }
diff --git a/src/r128_exa.c b/src/r128_exa.c
index 425fd64..5a54740 100644
--- a/src/r128_exa.c
+++ b/src/r128_exa.c
@@ -398,18 +398,6 @@ R128EXAAccelInit(ScreenPtr pScreen)
 {
     ScrnInfoPtr   pScrn = xf86ScreenToScrn(pScreen);
     R128InfoPtr   info  = R128PTR(pScrn);
-    int errmaj = 0, errmin = 0;
-
-    info->exaReq.majorversion = EXA_VERSION_MAJOR;
-    info->exaReq.minorversion = EXA_VERSION_MINOR;
-
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                "Loading EXA module...\n");
-    if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL,
-                    &info->exaReq, &errmaj, &errmin)) {
-        LoaderErrorMsg(NULL, "exa", errmaj, errmin);
-        return FALSE;
-    }
 
     /* Don't init EXA here because it'll be taken care of in mm init */
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
commit c4c05c95ae9f1b02fcbc9f6ee431d466c1c0b519
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Jul 26 19:58:06 2018 -0700

    Move RAMDAC module initialization into R128LegacyMS
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/r128_driver.c b/src/r128_driver.c
index 6c1a9e9..773038c 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -1031,7 +1031,7 @@ static Bool R128PreInitCursor(ScrnInfoPtr pScrn)
 {
     R128InfoPtr   info = R128PTR(pScrn);
 
-    if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) {
+    if (!info->swCursor) {
 	if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE;
     }
     return TRUE;
@@ -1303,6 +1303,8 @@ static Bool R128LegacyMS(ScrnInfoPtr pScrn)
 
     xf86CrtcSetSizeRange(pScrn, 320, 200, 4096, 4096);
 
+    if (!R128PreInitCursor(pScrn)) goto freeInt10;
+
     /* Don't fail on this one */
     info->DDC = R128PreInitDDC(pScrn, pInt10);
 
@@ -1465,8 +1467,6 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
     /* Get ScreenInit function */
     if (!xf86LoadSubModule(pScrn, "fb")) return FALSE;
 
-    if (!R128PreInitCursor(pScrn))             goto fail;
-
     info->CurrentLayout.displayWidth = pScrn->displayWidth;
 
     if (!xf86RandR12PreInit(pScrn)) {
commit f54469efcad4a68d86abbd55b79f4660667a5fff
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Jul 26 19:43:27 2018 -0700

    Delete OPTION_DISPLAY option enumeration
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/r128_driver.c b/src/r128_driver.c
index e34b1cd..6c1a9e9 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -137,7 +137,6 @@ typedef enum {
   OPTION_BUFFER_SIZE,
   OPTION_PAGE_FLIP,
 #endif
-  OPTION_DISPLAY,
   OPTION_ACCELMETHOD,
   OPTION_RENDERACCEL
 } R128Opts;
commit 2a903d7c00d67716815b68fb492b4d40e2f5684d
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Jul 26 19:41:06 2018 -0700

    Delete USE_CRT_ONLY conditional compilation directive
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/r128_driver.c b/src/r128_driver.c
index c4a1019..e34b1cd 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -109,9 +109,6 @@
 #endif
 
 
-#define USE_CRT_ONLY	0
-
-				/* Forward definitions for driver functions */
 static Bool R128CloseScreen(CLOSE_SCREEN_ARGS_DECL);
 static Bool R128SaveScreen(ScreenPtr pScreen, int mode);
 static void R128Save(ScrnInfoPtr pScrn);
@@ -140,10 +137,6 @@ typedef enum {
   OPTION_BUFFER_SIZE,
   OPTION_PAGE_FLIP,
 #endif
-#if USE_CRT_ONLY
-  /* FIXME: Disable CRTOnly until it is tested */
-  OPTION_CRT,
-#endif
   OPTION_DISPLAY,
   OPTION_ACCELMETHOD,
   OPTION_RENDERACCEL
commit b5f0862bbbe604605be19621ba22d60aeb68d4b9
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Jul 26 19:36:22 2018 -0700

    Move many DDX UMS options into R128UMSOption
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/r128_driver.c b/src/r128_driver.c
index d21117a..c4a1019 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -119,8 +119,15 @@ static void R128Restore(ScrnInfoPtr pScrn);
 
 typedef enum {
   OPTION_NOACCEL,
-  OPTION_SW_CURSOR,
+  OPTION_FBDEV,
   OPTION_DAC_6BIT,
+  OPTION_VGA_ACCESS,
+  OPTION_SHOW_CACHE,
+  OPTION_SW_CURSOR,
+  OPTION_VIDEO_KEY,
+  OPTION_PANEL_WIDTH,
+  OPTION_PANEL_HEIGHT,
+  OPTION_PROG_FP_REGS,
 #ifdef R128DRI
   OPTION_XV_DMA,
   OPTION_IS_PCI,
@@ -138,21 +145,21 @@ typedef enum {
   OPTION_CRT,
 #endif
   OPTION_DISPLAY,
-  OPTION_PANEL_WIDTH,
-  OPTION_PANEL_HEIGHT,
-  OPTION_PROG_FP_REGS,
-  OPTION_FBDEV,
-  OPTION_VIDEO_KEY,
-  OPTION_SHOW_CACHE,
-  OPTION_VGA_ACCESS,
   OPTION_ACCELMETHOD,
   OPTION_RENDERACCEL
 } R128Opts;
 
 static const OptionInfoRec R128Options[] = {
-  { OPTION_NOACCEL,      "NoAccel",          OPTV_BOOLEAN, {0}, FALSE },
-  { OPTION_SW_CURSOR,    "SWcursor",         OPTV_BOOLEAN, {0}, FALSE },
-  { OPTION_DAC_6BIT,     "Dac6Bit",          OPTV_BOOLEAN, {0}, FALSE },
+{ OPTION_NOACCEL,      "NoAccel",          OPTV_BOOLEAN, {0}, FALSE },
+{ OPTION_FBDEV,        "UseFBDev",         OPTV_BOOLEAN, {0}, FALSE },
+{ OPTION_DAC_6BIT,     "Dac6Bit",          OPTV_BOOLEAN, {0}, FALSE },
+{ OPTION_VGA_ACCESS,   "VGAAccess",        OPTV_BOOLEAN, {0}, TRUE  },
+{ OPTION_SHOW_CACHE,   "ShowCache",        OPTV_BOOLEAN, {0}, FALSE },
+{ OPTION_SW_CURSOR,    "SWcursor",         OPTV_BOOLEAN, {0}, FALSE },
+{ OPTION_VIDEO_KEY,    "VideoKey",         OPTV_INTEGER, {0}, FALSE },
+{ OPTION_PANEL_WIDTH,  "PanelWidth",       OPTV_INTEGER, {0}, FALSE },
+{ OPTION_PANEL_HEIGHT, "PanelHeight",      OPTV_INTEGER, {0}, FALSE },
+{ OPTION_PROG_FP_REGS, "ProgramFPRegs",    OPTV_BOOLEAN, {0}, FALSE },
 #ifdef R128DRI
   { OPTION_XV_DMA,       "DMAForXv",         OPTV_BOOLEAN, {0}, FALSE },
   { OPTION_IS_PCI,       "ForcePCIMode",     OPTV_BOOLEAN, {0}, FALSE },
@@ -165,13 +172,6 @@ static const OptionInfoRec R128Options[] = {
   { OPTION_BUFFER_SIZE,  "BufferSize",       OPTV_INTEGER, {0}, FALSE },
   { OPTION_PAGE_FLIP,    "EnablePageFlip",   OPTV_BOOLEAN, {0}, FALSE },
 #endif
-  { OPTION_PANEL_WIDTH,  "PanelWidth",       OPTV_INTEGER, {0}, FALSE },
-  { OPTION_PANEL_HEIGHT, "PanelHeight",      OPTV_INTEGER, {0}, FALSE },
-  { OPTION_PROG_FP_REGS, "ProgramFPRegs",    OPTV_BOOLEAN, {0}, FALSE },
-  { OPTION_FBDEV,        "UseFBDev",         OPTV_BOOLEAN, {0}, FALSE },
-  { OPTION_VIDEO_KEY,    "VideoKey",         OPTV_INTEGER, {0}, FALSE },
-  { OPTION_SHOW_CACHE,   "ShowCache",        OPTV_BOOLEAN, {0}, FALSE },
-  { OPTION_VGA_ACCESS,   "VGAAccess",        OPTV_BOOLEAN, {0}, TRUE  },
   { OPTION_ACCELMETHOD,  "AccelMethod",      OPTV_STRING,  {0}, FALSE },
   { OPTION_RENDERACCEL,  "RenderAccel",      OPTV_BOOLEAN, {0}, FALSE },
   { -1,                  NULL,               OPTV_NONE,    {0}, FALSE }
@@ -1204,6 +1204,81 @@ static Bool R128PreInitControllers(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
     return !!found;
 }
 
+static void R128UMSOption(ScrnInfoPtr pScrn)
+{
+    R128InfoPtr      info = R128PTR(pScrn);
+
+#ifdef __powerpc__
+    if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, TRUE))
+#else
+    if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, FALSE))
+#endif
+    {
+        info->FBDev = TRUE;
+        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+                    "Using framebuffer device.\n");
+    }
+
+    /* By default, don't access VGA IOs on PowerPC or SPARC. */
+#if defined(__powerpc__) || defined(__sparc__) || !defined(WITH_VGAHW)
+    info->VGAAccess = FALSE;
+#else
+    info->VGAAccess = TRUE;
+#endif
+
+#ifdef WITH_VGAHW
+    xf86GetOptValBool(info->Options, OPTION_VGA_ACCESS,
+                        &info->VGAAccess);
+    if (info->VGAAccess) {
+       if (!xf86LoadSubModule(pScrn, "vgahw"))
+           info->VGAAccess = FALSE;
+        else {
+            if (!vgaHWGetHWRec(pScrn))
+               info->VGAAccess = FALSE;
+       }
+
+       if (!info->VGAAccess) {
+           xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+                       "Loading VGA module failed, trying to "
+                       "run without it.\n");
+       }
+    } else
+           xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                       "VGAAccess option set to FALSE, VGA "
+                       "module load skipped.\n");
+    if (info->VGAAccess) {
+        vgaHWSetStdFuncs(VGAHWPTR(pScrn));
+        vgaHWGetIOBase(VGAHWPTR(pScrn));
+    }
+#else
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "VGAHW support not compiled, VGA "
+                "module load skipped.\n");
+#endif
+
+    if (xf86ReturnOptValBool(info->Options,
+                                OPTION_SHOW_CACHE, FALSE)) {
+        info->showCache = TRUE;
+        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+                    "ShowCache enabled.\n");
+    }
+
+    if (xf86ReturnOptValBool(info->Options,
+                                OPTION_SW_CURSOR, FALSE)) {
+        info->swCursor = TRUE;
+        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+                    "Software cursor requested.\n");
+    }
+
+    if(xf86GetOptValInteger(info->Options,
+                            OPTION_VIDEO_KEY, &info->videoKey)) {
+        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+                    "Video key set to 0x%x.\n", info->videoKey);
+    } else {
+        info->videoKey = 0x1E;
+    }
+}
+
 static Bool R128CRTCResize(ScrnInfoPtr pScrn, int width, int height)
 {
     pScrn->virtualX = width;
@@ -1345,46 +1420,8 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 
     info->swCursor = FALSE;
 
-    /* By default, don't do VGA IOs on ppc */
-#if defined(__powerpc__) || defined(__sparc__) || !defined(WITH_VGAHW)
-    info->VGAAccess = FALSE;
-#else
-    info->VGAAccess = TRUE;
-#endif
-
-#ifdef WITH_VGAHW
-    xf86GetOptValBool(info->Options, OPTION_VGA_ACCESS, &info->VGAAccess);
-    if (info->VGAAccess) {
-       if (!xf86LoadSubModule(pScrn, "vgahw"))
-           info->VGAAccess = FALSE;
-        else {
-            if (!vgaHWGetHWRec(pScrn))
-               info->VGAAccess = FALSE;
-       }
-       if (!info->VGAAccess)
-           xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Loading VGA module failed,"
-                      " trying to run without it\n");
-    } else
-           xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VGAAccess option set to FALSE,"
-                      " VGA module load skipped\n");
-    if (info->VGAAccess) {
-	vgaHWSetStdFuncs(VGAHWPTR(pScrn));
-        vgaHWGetIOBase(VGAHWPTR(pScrn));
-    }
-#else
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VGAHW support not compiled, VGA "
-               "module load skipped\n");
-#endif
-
     if (!R128PreInitWeight(pScrn))    goto fail;
 
-    if(xf86GetOptValInteger(info->Options, OPTION_VIDEO_KEY, &(info->videoKey))) {
-        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
-                                info->videoKey);
-    } else {
-        info->videoKey = 0x1E;
-    }
-
     if (xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
         info->noAccel = TRUE;
     }
@@ -1417,26 +1454,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
     }
 #endif
 
-    if (xf86ReturnOptValBool(info->Options, OPTION_SHOW_CACHE, FALSE)) {
-        info->showCache = TRUE;
-        xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n");
-    }
-
-#ifdef __powerpc__
-    if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, TRUE))
-#else
-    if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, FALSE))
-#endif
-    {
-	info->FBDev = TRUE;
-	xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
-		   "Using framebuffer device\n");
-    }
-
-    if (xf86ReturnOptValBool(info->Options,
-                                OPTION_SW_CURSOR, FALSE)) {
-        info->swCursor = TRUE;
-    }
+    R128UMSOption(pScrn);
 
     /* Allocate an xf86CrtcConfig */
     xf86CrtcConfigInit(pScrn, &R128CRTCResizeFuncs);
commit 0ef4fbad35a1e6d20cf72c7702ffd7ebf215cdb9
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Jul 26 13:38:16 2018 -0700

    Remove OPTION_DAC_8BIT option
    
    It is no longer used.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/r128_driver.c b/src/r128_driver.c
index 57f4d05..d21117a 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -121,7 +121,6 @@ typedef enum {
   OPTION_NOACCEL,
   OPTION_SW_CURSOR,
   OPTION_DAC_6BIT,
-  OPTION_DAC_8BIT,
 #ifdef R128DRI
   OPTION_XV_DMA,
   OPTION_IS_PCI,
@@ -154,7 +153,6 @@ static const OptionInfoRec R128Options[] = {
   { OPTION_NOACCEL,      "NoAccel",          OPTV_BOOLEAN, {0}, FALSE },
   { OPTION_SW_CURSOR,    "SWcursor",         OPTV_BOOLEAN, {0}, FALSE },
   { OPTION_DAC_6BIT,     "Dac6Bit",          OPTV_BOOLEAN, {0}, FALSE },
-  { OPTION_DAC_8BIT,     "Dac8Bit",          OPTV_BOOLEAN, {0}, TRUE  },
 #ifdef R128DRI
   { OPTION_XV_DMA,       "DMAForXv",         OPTV_BOOLEAN, {0}, FALSE },
   { OPTION_IS_PCI,       "ForcePCIMode",     OPTV_BOOLEAN, {0}, FALSE },
commit 4e3638c612831dea400be7d0d85d4d1ea9f9a4c2
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Thu Jul 26 10:11:59 2018 -0700

    Evaluate software cursor option inside R128PreInit
    
    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>

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;
 


More information about the xorg-commit mailing list