configure.ac | 2 - src/via_ums.c | 64 ++++++++++++++++++++++++++++++++++------------------------ 2 files changed, 39 insertions(+), 27 deletions(-)
New commits: commit 75be924013996a65b471d2da6e8d1339749964f9 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Jun 14 04:03:06 2016 -0500 Version bumped to 0.4.185 Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/configure.ac b/configure.ac index 39be4f4..e97ff27 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ(2.57) AC_INIT([xf86-video-openchrome], - [0.4.184], + [0.4.185], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome], [xf86-video-openchrome]) commit 68b0585f18330b11c9b378be64301996c64dbd45 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Jun 14 04:01:55 2016 -0500 Various debug message tweaks to viaMapMMIO Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_ums.c b/src/via_ums.c index 5627000..00a077b 100644 --- a/src/via_ums.c +++ b/src/via_ums.c @@ -108,8 +108,9 @@ viaMapMMIO(ScrnInfoPtr pScrn) #endif xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "Mapping MMIO at address 0x%lx with size 0x%x.\n", - pVia->MmioBase, VIA_MMIO_REGSIZE); + "Mapping MMIO at address 0x%lX with " + "size %u KB.\n", + pVia->MmioBase, VIA_MMIO_REGSIZE / 1024); #ifdef HAVE_PCIACCESS err = pci_device_map_range(pVia->PciInfo, @@ -120,7 +121,7 @@ viaMapMMIO(ScrnInfoPtr pScrn) if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map MMIO.\n" - "Error: %s (%d)\n", + "Error: %s (%u)\n", strerror(err), err); goto fail; } @@ -136,9 +137,9 @@ viaMapMMIO(ScrnInfoPtr pScrn) #endif xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "Mapping 2D Host BitBLT space at address 0x%lx with " - "size 0x%x.\n", - pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE); + "Mapping 2D Host BitBLT space at address 0x%lX with " + "size %u KB.\n", + pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE / 1024); #ifdef HAVE_PCIACCESS err = pci_device_map_range(pVia->PciInfo, @@ -149,7 +150,7 @@ viaMapMMIO(ScrnInfoPtr pScrn) if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to map 2D Host BitBLT space.\n" - "Error: %s (%d)\n", + "Error: %s (%u)\n", strerror(err), err); goto fail; } @@ -184,8 +185,9 @@ viaMapMMIO(ScrnInfoPtr pScrn) #endif xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "Mapping the frame buffer at address 0x%lX with size 0x%lX.\n", - pVia->FrameBufferBase, pVia->videoRambytes); + "Mapping the frame buffer at address 0x%lX with " + "size %u KB.\n", + pVia->FrameBufferBase, pVia->videoRambytes / 1024); #ifdef HAVE_PCIACCESS err = pci_device_map_range(pVia->PciInfo, pVia->FrameBufferBase, @@ -195,8 +197,8 @@ viaMapMMIO(ScrnInfoPtr pScrn) (void **)&pVia->FBBase); if (err) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Unable to map a frame buffer.\n" - "Error: %s (%d)\n", + "Unable to map the frame buffer.\n" + "Error: %s (%u)\n", strerror(err), err); goto fail; } @@ -287,7 +289,6 @@ viaMapMMIO(ScrnInfoPtr pScrn) fail: #ifdef HAVE_PCIACCESS - if (pVia->FBBase) { pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->FBBase, pVia->videoRambytes); @@ -322,6 +323,7 @@ fail: pVia->FBBase = NULL; pVia->BltBase = NULL; pVia->MapBase = NULL; + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaMapMMIO.\n")); return FALSE; commit 19ad4151bf85b3fb8ff3be6b380d55c286bf43c9 Author: Kevin Brace <kevinbr...@gmx.com> Date: Tue Jun 14 03:11:16 2016 -0500 Making small modifications to viaUnmapMMIO Rearranging the code inside the function and adding additional safeguards like setting the pointers NULL after the memory map is released. Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_ums.c b/src/via_ums.c index e2a780f..5627000 100644 --- a/src/via_ums.c +++ b/src/via_ums.c @@ -338,31 +338,41 @@ viaUnmapMMIO(ScrnInfoPtr pScrn) viaMMIODisable(pScrn); #ifdef HAVE_PCIACCESS - if (pVia->MapBase) - pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->MapBase, - VIA_MMIO_REGSIZE); + if (pVia->FBBase) { + pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->FBBase, + pVia->videoRambytes); + } - if (pVia->BltBase) + if (pVia->BltBase) { pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->BltBase, VIA_MMIO_BLTSIZE); + } - if (pVia->FBBase) - pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->FBBase, - pVia->videoRambytes); + if (pVia->MapBase) { + pci_device_unmap_range(pVia->PciInfo, (pointer) pVia->MapBase, + VIA_MMIO_REGSIZE); + } #else - if (pVia->MapBase) - xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->MapBase, - VIA_MMIO_REGSIZE); + if (pVia->FBBase) { + xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->FBBase, + pVia->videoRambytes); + } - if (pVia->BltBase) + if (pVia->BltBase) { xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->BltBase, VIA_MMIO_BLTSIZE); + { - if (pVia->FBBase) - xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->FBBase, - pVia->videoRambytes); + if (pVia->MapBase) { + xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pVia->MapBase, + VIA_MMIO_REGSIZE); + } #endif + pVia->FBBase = NULL; + pVia->BltBase = NULL; + pVia->MapBase = NULL; + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting viaUnmapMMIO.\n")); } _______________________________________________ Openchrome-devel mailing list Openchrome-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/openchrome-devel