[openchrome-devel] xf86-video-openchrome: 6 commits - src/via_driver.c src/via_memmgr.c src/via_ums.c src/via_ums.h

Kevin Brace kevinbrace at kemper.freedesktop.org
Sat Jan 4 17:28:48 UTC 2020


 src/via_driver.c |   24 +++++++++++++++++-------
 src/via_memmgr.c |    2 +-
 src/via_ums.c    |   16 ++++++----------
 src/via_ums.h    |    8 ++++----
 4 files changed, 28 insertions(+), 22 deletions(-)

New commits:
commit fb1812ee0959904289b44dc4f5d4dd8b8afb0ff8
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jan 4 11:25:56 2020 -0600

    Eliminate a duplicate allocation of EXA sync bo
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.c b/src/via_ums.c
index 8425cb0..4993e9f 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -652,10 +652,6 @@ viaUMSAccelInit(ScreenPtr pScreen)
                         "Initializing the 3D engine.\n"));
     viaInitialize3DEngine(pScrn);
 
-    pVia->exa_sync_bo = drm_bo_alloc(pScrn, 32, 32, TTM_PL_FLAG_VRAM);
-    if (!pVia->exa_sync_bo)
-        goto err;
-
     /* Sync marker space. */
     pVia->exa_sync_bo = drm_bo_alloc(pScrn, 32, 32, TTM_PL_FLAG_VRAM);
     if (!pVia->exa_sync_bo)
commit 0670cac2687f69154649ab64b3340c45e5cdcff8
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jan 4 11:22:51 2020 -0600

    Change how viaUMSAccelInit() is invoked
    
    It is called only when DRI is not available or when DRI1 is available.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index bd80eef..50c891d 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1429,8 +1429,16 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
     if (!drm_bo_map(pScrn, pVia->drmmode.front_bo))
         return FALSE;
 
-    if (!pVia->NoAccel && !viaUMSAccelInit(pScrn->pScreen))
-        return FALSE;
+    if ((!pVia->NoAccel) &&
+        ((pVia->directRenderingType == DRI_NONE)
+#ifdef HAVE_DRI
+        || (pVia->directRenderingType == DRI_1)
+#endif /* HAVE_DRI */
+        )) {
+        if (!viaUMSAccelInit(pScrn->pScreen)) {
+            return FALSE;
+        }
+    }
 
     miClearVisualTypes();
 
commit c1940e9b0f3e96d26b9c7c9399f8f55fc09e8b8a
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jan 4 11:19:37 2020 -0600

    Rename umsCrtcInit() to viaUMSCrtcInit()
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index d19e093..bd80eef 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1136,7 +1136,7 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
             goto fail;
         }
     } else {
-        if (!umsCrtcInit(pScrn)) {
+        if (!viaUMSCrtcInit(pScrn)) {
             goto fail;
         }
     }
diff --git a/src/via_ums.c b/src/via_ums.c
index 73f7a05..8425cb0 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -1062,7 +1062,7 @@ viaUMSPreInit(ScrnInfoPtr pScrn)
 }
 
 Bool
-umsCrtcInit(ScrnInfoPtr pScrn)
+viaUMSCrtcInit(ScrnInfoPtr pScrn)
 {
     drmmode_crtc_private_ptr iga1_rec = NULL, iga2_rec = NULL;
     vgaHWPtr hwp = VGAHWPTR(pScrn);
diff --git a/src/via_ums.h b/src/via_ums.h
index 4160755..4c9b4ce 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -1561,7 +1561,7 @@ void viaDisableVQ(ScrnInfoPtr pScrn);
 Bool viaUMSAccelInit(ScreenPtr pScreen);
 Bool viaUMSCreate(ScrnInfoPtr pScrn);
 Bool viaUMSPreInit(ScrnInfoPtr pScrn);
-Bool umsCrtcInit(ScrnInfoPtr pScrn);
+Bool viaUMSCrtcInit(ScrnInfoPtr pScrn);
 
 /* via_i2c.c */
 void ViaI2CInit(ScrnInfoPtr pScrn);
commit ea55fee62711eb6eaa016775faa09c0d47710b16
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jan 4 11:15:13 2020 -0600

    Rename umsPreInit() to viaUMSPreInit()
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index 2125c06..d19e093 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1116,11 +1116,13 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
 
     VIAVidHWDiffInit(pScrn);
 
-    /* After umsPreInit function succeeds, PCI hardware resources are
-     * memory mapped. If there is an error from this point on, they will
-     * need to be explicitly relinquished. */
+    /*
+     * After viaUMSPreInit() succeeds, PCI hardware resources are
+     * memory mapped.  If there is an error from this point on, they
+     * will need to be explicitly relinquished.
+     */
     if (!pVia->KMS) {
-        if (!umsPreInit(pScrn)) {
+        if (!viaUMSPreInit(pScrn)) {
             VIAFreeRec(pScrn);
             return FALSE;
         }
diff --git a/src/via_ums.c b/src/via_ums.c
index b49decc..73f7a05 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -954,7 +954,7 @@ exit:
 }
 
 Bool
-umsPreInit(ScrnInfoPtr pScrn)
+viaUMSPreInit(ScrnInfoPtr pScrn)
 {
     VIAPtr pVia = VIAPTR(pScrn);
     VIADisplayPtr pVIADisplay = pVia->pVIADisplay;
diff --git a/src/via_ums.h b/src/via_ums.h
index 0986921..4160755 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -1560,7 +1560,7 @@ void viaUnmapMMIO(ScrnInfoPtr pScrn);
 void viaDisableVQ(ScrnInfoPtr pScrn);
 Bool viaUMSAccelInit(ScreenPtr pScreen);
 Bool viaUMSCreate(ScrnInfoPtr pScrn);
-Bool umsPreInit(ScrnInfoPtr pScrn);
+Bool viaUMSPreInit(ScrnInfoPtr pScrn);
 Bool umsCrtcInit(ScrnInfoPtr pScrn);
 
 /* via_i2c.c */
commit 3cf916b5e0091cdbd8db4d8d59cbecc24117584d
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jan 4 11:08:49 2020 -0600

    Rename umsCreate() to viaUMSCreate()
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index 9b8e37c..0c3127d 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -284,7 +284,7 @@ drm_bo_manager_init(ScrnInfoPtr pScrn)
 
     if (pVia->directRenderingType == DRI_2)
         return ret;
-    ret = umsCreate(pScrn);
+    ret = viaUMSCreate(pScrn);
 #ifdef HAVE_DRI
     if (pVia->directRenderingType == DRI_1)
         ret = VIADRIKernelInit(pScrn);
diff --git a/src/via_ums.c b/src/via_ums.c
index 5f453fa..b49decc 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -691,7 +691,7 @@ err:
 }
 
 Bool
-umsCreate(ScrnInfoPtr pScrn)
+viaUMSCreate(ScrnInfoPtr pScrn)
 {
     ScreenPtr pScreen = pScrn->pScreen;
     VIAPtr pVia = VIAPTR(pScrn);
diff --git a/src/via_ums.h b/src/via_ums.h
index fefba2f..0986921 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -1559,7 +1559,7 @@ viaSetDisplayScaling(ScrnInfoPtr pScrn, Bool scalingState)
 void viaUnmapMMIO(ScrnInfoPtr pScrn);
 void viaDisableVQ(ScrnInfoPtr pScrn);
 Bool viaUMSAccelInit(ScreenPtr pScreen);
-Bool umsCreate(ScrnInfoPtr pScrn);
+Bool viaUMSCreate(ScrnInfoPtr pScrn);
 Bool umsPreInit(ScrnInfoPtr pScrn);
 Bool umsCrtcInit(ScrnInfoPtr pScrn);
 
commit b5eb5cce6a074d88153f807e31b9b98fc1599181
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jan 4 11:00:30 2020 -0600

    Rename umsAccelInit() to viaUMSAccelInit()
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_driver.c b/src/via_driver.c
index d2d4b16..2125c06 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1427,7 +1427,7 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
     if (!drm_bo_map(pScrn, pVia->drmmode.front_bo))
         return FALSE;
 
-    if (!pVia->NoAccel && !umsAccelInit(pScrn->pScreen))
+    if (!pVia->NoAccel && !viaUMSAccelInit(pScrn->pScreen))
         return FALSE;
 
     miClearVisualTypes();
diff --git a/src/via_ums.c b/src/via_ums.c
index 4f2f0fa..5f453fa 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -627,14 +627,14 @@ viaInitialize3DEngine(ScrnInfoPtr pScrn)
  * and initializes engines and acceleration method.
  */
 Bool
-umsAccelInit(ScreenPtr pScreen)
+viaUMSAccelInit(ScreenPtr pScreen)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     VIAPtr pVia = VIAPTR(pScrn);
     Bool ret = FALSE;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Entered umsAccelInit.\n"));
+                        "Entered %s.\n", __func__));
 
     pVia->VQStart = 0;
     pVia->vq_bo = drm_bo_alloc(pScrn, VIA_VQ_SIZE, 16, TTM_PL_FLAG_VRAM);
@@ -686,7 +686,7 @@ err:
     }
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Exiting umsAccelInit.\n"));
+                        "Exiting %s.\n", __func__));
     return ret;
 }
 
diff --git a/src/via_ums.h b/src/via_ums.h
index 6286983..fefba2f 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -1558,7 +1558,7 @@ viaSetDisplayScaling(ScrnInfoPtr pScrn, Bool scalingState)
 /* via_ums.c */
 void viaUnmapMMIO(ScrnInfoPtr pScrn);
 void viaDisableVQ(ScrnInfoPtr pScrn);
-Bool umsAccelInit(ScreenPtr pScreen);
+Bool viaUMSAccelInit(ScreenPtr pScreen);
 Bool umsCreate(ScrnInfoPtr pScrn);
 Bool umsPreInit(ScrnInfoPtr pScrn);
 Bool umsCrtcInit(ScrnInfoPtr pScrn);


More information about the openchrome-devel mailing list