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

Kevin Brace kevinbrace at kemper.freedesktop.org
Fri Jul 27 18:19:58 UTC 2018


 src/r128.h        |    2 +
 src/r128_driver.c |   82 ++++++++++++++++++++++++++++++++----------------------
 2 files changed, 52 insertions(+), 32 deletions(-)

New commits:
commit 15d245de2814128b04dea2b640c4ba0b12926f24
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Jul 25 20:19:06 2018 -0700

    Evaluate EXA related options inside R128PreInit
    
    Since AccelMethod and RenderAccel options are 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_driver.c b/src/r128_driver.c
index 723c56b..7cc788b 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -1262,6 +1262,9 @@ exit:
 Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 {
     R128InfoPtr      info;
+#ifdef USE_EXA
+    char *optstr;
+#endif
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "%s\n", __func__));
@@ -1335,6 +1338,13 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
 
     info->noAccel = FALSE;
 
+    info->useEXA = FALSE;
+#ifdef USE_EXA
+#ifndef HAVE_XAA_H
+    info->useEXA = TRUE;
+#endif
+#endif
+
     /* By default, don't do VGA IOs on ppc */
 #if defined(__powerpc__) || defined(__sparc__) || !defined(WITH_VGAHW)
     info->VGAAccess = FALSE;
@@ -1379,6 +1389,34 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
         info->noAccel = TRUE;
     }
 
+#ifdef USE_EXA
+    if (!info->noAccel) {
+        optstr = (char *) xf86GetOptValString(info->Options,
+                                                OPTION_ACCELMETHOD);
+        if (optstr) {
+            xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "AccelMethod option found.\n");
+            if (xf86NameCmp(optstr, "EXA") == 0) {
+                info->useEXA = TRUE;
+                xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                            "AccelMethod is set to EXA, turning "
+                            "EXA on.\n");
+            }
+        }
+
+#ifdef RENDER
+        info->RenderAccel = xf86ReturnOptValBool(info->Options,
+                                                    OPTION_RENDERACCEL,
+                                                    TRUE);
+        if (info->RenderAccel)
+            xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Acceleration of RENDER operations will be "
+                        "enabled upon successful loading of DRI and "
+                        "EXA.\n");
+#endif
+    }
+#endif
+
     if (xf86ReturnOptValBool(info->Options, OPTION_SHOW_CACHE, FALSE)) {
         info->showCache = TRUE;
         xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n");
@@ -1623,35 +1661,11 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
 #else
     void*		  osArea = NULL;
 #endif
-    char *optstr;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "%s %lx %lx\n",
                         __func__,
                         pScrn->memPhysBase, pScrn->fbOffset));
-    info->useEXA = FALSE;
-#ifdef USE_EXA
-#ifndef HAVE_XAA_H
-    info->useEXA = TRUE;
-#endif
-#endif
-
-#ifdef USE_EXA
-    optstr = (char *)xf86GetOptValString(info->Options, OPTION_ACCELMETHOD);
-    if (optstr != NULL) {
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "AccelMethod option found\n");
-	if (xf86NameCmp(optstr, "EXA") == 0) {
-	    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "AccelMethod is set to EXA, turning EXA on\n");
-	    info->useEXA = TRUE;
-	}
-    }
-#ifdef RENDER
-    info->RenderAccel = xf86ReturnOptValBool(info->Options, OPTION_RENDERACCEL, TRUE);
-    if (info->RenderAccel)
-        xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration of RENDER operations will be enabled "
-					     "upon successful loading of DRI and EXA\n");
-#endif
-#endif
 
 #ifdef R128DRI
 				/* Turn off the CCE for now. */
commit 680aeee6730aa5b00bbc457b199b7643a6b0a1cb
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Jul 25 19:50:40 2018 -0700

    Evaluate NoAccel option inside R128PreInit
    
    Since NoAccel 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 7438757..17ffbc5 100644
--- a/src/r128.h
+++ b/src/r128.h
@@ -335,6 +335,8 @@ typedef struct {
 #ifdef HAVE_XAA_H
     XAAInfoRecPtr     accel;
 #endif
+
+    Bool              noAccel;
     Bool              accelOn;
     Bool	      useEXA;
     Bool	      RenderAccel;
diff --git a/src/r128_driver.c b/src/r128_driver.c
index 9725ee2..723c56b 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -1333,6 +1333,8 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
     memcpy(info->Options, R128Options, sizeof(R128Options));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
 
+    info->noAccel = FALSE;
+
     /* By default, don't do VGA IOs on ppc */
 #if defined(__powerpc__) || defined(__sparc__) || !defined(WITH_VGAHW)
     info->VGAAccess = FALSE;
@@ -1373,6 +1375,10 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
         info->videoKey = 0x1E;
     }
 
+    if (xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) {
+        info->noAccel = TRUE;
+    }
+
     if (xf86ReturnOptValBool(info->Options, OPTION_SHOW_CACHE, FALSE)) {
         info->showCache = TRUE;
         xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n");
@@ -1612,7 +1618,6 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
     int width_bytes = (pScrn->displayWidth *
 			   info->CurrentLayout.pixel_bytes);
     int         x1 = 0, x2 = 0, y1 = 0, y2 = 0;
-    Bool	noAccel;
 #ifdef USE_EXA
     ExaOffscreenArea*     osArea = NULL;
 #else
@@ -1676,8 +1681,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
 			  pScrn->defaultVisual)) return FALSE;
     miSetPixmapDepths ();
 
-    noAccel = xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE);
-    if (noAccel) info->useEXA = FALSE;
+    if (info->noAccel) info->useEXA = FALSE;
 
 #ifdef R128DRI
 				/* Setup DRI after visuals have been
@@ -1689,7 +1693,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
 	   times the virtual size of the screen below. */
 	int maxy        = info->FbMapSize / width_bytes;
 
-	if (noAccel) {
+        if (info->noAccel) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		       "Acceleration disabled, not initializing the DRI\n");
 	    info->directRenderingEnabled = FALSE;
@@ -1843,7 +1847,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
 				width, height);
 	        }
 
-                R128AccelInit(noAccel, pScreen);
+                R128AccelInit(info->noAccel, pScreen);
 	    }
 	}
 #ifdef USE_EXA
@@ -1851,7 +1855,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		       "Filling in EXA memory info\n");
 
-            R128AccelInit(noAccel, pScreen);
+            R128AccelInit(info->noAccel, pScreen);
 	    info->ExaDriver->offScreenBase = pScrn->virtualY * width_bytes;
 
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -2016,7 +2020,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
 				width, height);
 	        }
 
-                R128AccelInit(noAccel, pScreen);
+                R128AccelInit(info->noAccel, pScreen);
 	    }
 	}
 #ifdef USE_EXA
@@ -2024,7 +2028,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		       "Filling in EXA memory info\n");
 
-            R128AccelInit(noAccel, pScreen);
+            R128AccelInit(info->noAccel, pScreen);
 	    info->ExaDriver->offScreenBase = pScrn->virtualY * width_bytes;
 
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO,


More information about the xorg-commit mailing list