[Openchrome-devel] xf86-video-openchrome: 3 commits - configure.ac src/via_ums.c

Kevin Brace kevinbrace at kemper.freedesktop.org
Tue Jun 14 06:19:38 UTC 2016


 configure.ac  |    2 -
 src/via_ums.c |  100 ++++++++++++++++++++++++++++------------------------------
 2 files changed, 50 insertions(+), 52 deletions(-)

New commits:
commit d581a5fed8666fa83ae74896a754d8fae34e5e14
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue Jun 14 01:19:03 2016 -0500

    Version bumped to 0.4.183
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index b19ce75..d0d38f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.4.182],
+        [0.4.183],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 2b8212b4f69302989e830a2ee46f31b36923eea3
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue Jun 14 01:05:24 2016 -0500

    Changing the error handling of viaMapFB
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.c b/src/via_ums.c
index 0068309..d9af4dc 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -267,59 +267,61 @@ viaMapFB(ScrnInfoPtr pScrn)
                "Mapping a frame buffer at address 0x%lx with size 0x%lx.\n",
                pVia->FrameBufferBase, pVia->videoRambytes);
 
-    if (pVia->videoRambytes) {
+    if (!(pVia->videoRambytes)) {
+        goto fail;
+    }
+
 #ifdef HAVE_PCIACCESS
-        err = pci_device_map_range(pVia->PciInfo, pVia->FrameBufferBase,
-                                   pVia->videoRambytes,
-                                   (PCI_DEV_MAP_FLAG_WRITABLE |
-                                    PCI_DEV_MAP_FLAG_WRITE_COMBINE),
-                                   (void **)&pVia->FBBase);
-        if (err) {
-            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                        "Unable to map a frame buffer.\n"
-                        "Error: %s (%d)\n",
-                        strerror(err), err);
-            goto fail;
-        }
+    err = pci_device_map_range(pVia->PciInfo, pVia->FrameBufferBase,
+                               pVia->videoRambytes,
+                               (PCI_DEV_MAP_FLAG_WRITABLE |
+                                PCI_DEV_MAP_FLAG_WRITE_COMBINE),
+                               (void **)&pVia->FBBase);
+    if (err) {
+        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                    "Unable to map a frame buffer.\n"
+                    "Error: %s (%d)\n",
+                    strerror(err), err);
+        goto fail;
+    }
 #else
-        /*
-         * FIXME: This is a hack to get rid of offending wrongly sized
-         * MTRR regions set up by the VIA BIOS. Should be taken care of
-         * in the OS support layer.
-         */
-        tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag,
-                            pVia->FrameBufferBase, pVia->videoRambytes);
-        xf86UnMapVidMem(pScrn->scrnIndex, (pointer) tmp, pVia->videoRambytes);
-
-        /*
-         * And, as if this wasn't enough, 2.6 series kernels don't
-         * remove MTRR regions on the first attempt. So try again.
-         */
-        tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag,
-                            pVia->FrameBufferBase, pVia->videoRambytes);
-        xf86UnMapVidMem(pScrn->scrnIndex, (pointer) tmp, pVia->videoRambytes);
-        /*
-         * End of hack.
-         */
-
-        pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
-                                     pVia->PciTag, pVia->FrameBufferBase,
-                                     pVia->videoRambytes);
-
-        if (!pVia->FBBase) {
-            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                       "Unable to map a frame buffer.\n");
-            goto fail;
-        }
-#endif
+    /*
+     * FIXME: This is a hack to get rid of offending wrongly sized
+     * MTRR regions set up by the VIA BIOS. Should be taken care of
+     * in the OS support layer.
+     */
+    tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag,
+                        pVia->FrameBufferBase, pVia->videoRambytes);
+    xf86UnMapVidMem(pScrn->scrnIndex, (pointer) tmp, pVia->videoRambytes);
+
+    /*
+     * And, as if this wasn't enough, 2.6 series kernels don't
+     * remove MTRR regions on the first attempt. So try again.
+     */
+    tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag,
+                        pVia->FrameBufferBase, pVia->videoRambytes);
+    xf86UnMapVidMem(pScrn->scrnIndex, (pointer) tmp, pVia->videoRambytes);
+    /*
+     * End of hack.
+     */
 
-        pVia->FBFreeStart = 0;
-        pVia->FBFreeEnd = pVia->videoRambytes;
+    pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
+                                 pVia->PciTag, pVia->FrameBufferBase,
+                                 pVia->videoRambytes);
 
-        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-                   "Frame buffer start address: %p, free start: 0x%x end: 0x%x\n",
-                   pVia->FBBase, pVia->FBFreeStart, pVia->FBFreeEnd);
+    if (!pVia->FBBase) {
+        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                   "Unable to map a frame buffer.\n");
+        goto fail;
     }
+#endif
+
+    pVia->FBFreeStart = 0;
+    pVia->FBFreeEnd = pVia->videoRambytes;
+
+    xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+               "Frame buffer start address: %p, free start: 0x%x end: 0x%x\n",
+               pVia->FBBase, pVia->FBFreeStart, pVia->FBFreeEnd);
 
 #ifdef HAVE_PCIACCESS
     if (pVia->Chipset == VIA_VX900) {
commit 8d8bb92f007ae4961ffa27fcb7325d54099adcd0
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Tue Jun 14 00:31:10 2016 -0500

    Merging PCI MMIO mapping code when libpciaccess is not available
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.c b/src/via_ums.c
index fcfa774..0068309 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -268,7 +268,20 @@ viaMapFB(ScrnInfoPtr pScrn)
                pVia->FrameBufferBase, pVia->videoRambytes);
 
     if (pVia->videoRambytes) {
-#ifndef HAVE_PCIACCESS
+#ifdef HAVE_PCIACCESS
+        err = pci_device_map_range(pVia->PciInfo, pVia->FrameBufferBase,
+                                   pVia->videoRambytes,
+                                   (PCI_DEV_MAP_FLAG_WRITABLE |
+                                    PCI_DEV_MAP_FLAG_WRITE_COMBINE),
+                                   (void **)&pVia->FBBase);
+        if (err) {
+            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                        "Unable to map a frame buffer.\n"
+                        "Error: %s (%d)\n",
+                        strerror(err), err);
+            goto fail;
+        }
+#else
         /*
          * FIXME: This is a hack to get rid of offending wrongly sized
          * MTRR regions set up by the VIA BIOS. Should be taken care of
@@ -282,30 +295,13 @@ viaMapFB(ScrnInfoPtr pScrn)
          * And, as if this wasn't enough, 2.6 series kernels don't
          * remove MTRR regions on the first attempt. So try again.
          */
-
         tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag,
                             pVia->FrameBufferBase, pVia->videoRambytes);
         xf86UnMapVidMem(pScrn->scrnIndex, (pointer) tmp, pVia->videoRambytes);
-
         /*
          * End of hack.
          */
-#endif
 
-#ifdef HAVE_PCIACCESS
-        err = pci_device_map_range(pVia->PciInfo, pVia->FrameBufferBase,
-                                   pVia->videoRambytes,
-                                   (PCI_DEV_MAP_FLAG_WRITABLE |
-                                    PCI_DEV_MAP_FLAG_WRITE_COMBINE),
-                                   (void **)&pVia->FBBase);
-        if (err) {
-            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                        "Unable to map a frame buffer.\n"
-                        "Error: %s (%d)\n",
-                        strerror(err), err);
-            goto fail;
-        }
-#else
         pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
                                      pVia->PciTag, pVia->FrameBufferBase,
                                      pVia->videoRambytes);


More information about the Openchrome-devel mailing list