summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:48:39 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:48:39 +0000
commitb354474bae9ab473e17b5cc51e45d36f0b4cf3b1 (patch)
treef7624cbda00d033bbceeece2b3843fb201f623f4
parentca572cb2f331b374c246b4435f5aeb036392e16f (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branch
-rw-r--r--src/XF86DGA.c5
-rw-r--r--src/XF86DGA2.c32
2 files changed, 23 insertions, 14 deletions
diff --git a/src/XF86DGA.c b/src/XF86DGA.c
index ceff6b3..b60c377 100644
--- a/src/XF86DGA.c
+++ b/src/XF86DGA.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/Xxf86dga/XF86DGA.c,v 3.22 2002/12/14 04:41:12 dawes Exp $ */
+/* $XFree86: xc/lib/Xxf86dga/XF86DGA.c,v 3.24 2003/05/05 20:42:30 tsi Exp $ */
/*
Copyright (c) 1995 Jon Tombs
@@ -11,6 +11,7 @@ Copyright (c) 1995,1996 The XFree86 Project, Inc
#ifdef __UNIXOS2__ /* needed here to override certain constants in X headers */
#define INCL_DOS
#define INCL_DOSIOCTL
+#define I_NEED_OS2_H
#include <os2.h>
#endif
@@ -376,6 +377,8 @@ Bool XF86DGAViewPortChanged(
#define DEV_MEM "/dev/pmem"
#elif defined(SVR4) && defined(sun)
#define DEV_MEM "/dev/xsvc"
+#elif defined(HAS_APERTURE_DRV)
+#define DEV_MEM "/dev/xf86"
#else
#define DEV_MEM "/dev/mem"
#endif
diff --git a/src/XF86DGA2.c b/src/XF86DGA2.c
index c3bd960..4dd7de8 100644
--- a/src/XF86DGA2.c
+++ b/src/XF86DGA2.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/Xxf86dga/XF86DGA2.c,v 1.21 2002/12/14 04:41:12 dawes Exp $ */
+/* $XFree86: xc/lib/Xxf86dga/XF86DGA2.c,v 1.24 2003/11/21 05:07:16 dawes Exp $ */
/*
Copyright (c) 1995 Jon Tombs
@@ -11,6 +11,7 @@ Copyright (c) 1995,1996 The XFree86 Project, Inc
#ifdef __UNIXOS2__ /* needed here to override certain constants in X headers */
#define INCL_DOS
#define INCL_DOSIOCTL
+#define I_NEED_OS2_H
#include <os2.h>
#endif
@@ -67,6 +68,7 @@ static XExtensionHooks xdga_extension_hooks = {
static XEXT_GENERATE_CLOSE_DISPLAY (xdga_close_display, xdga_info)
+XExtDisplayInfo* xdga_find_display(Display*);
XEXT_GENERATE_FIND_DISPLAY (xdga_find_display, xdga_info,
"XFree86-DGA",
&xdga_extension_hooks,
@@ -744,6 +746,8 @@ void XDGAKeyEventToXKeyEvent(
#define DEV_MEM "/dev/pmem"
#elif defined(SVR4) && defined(sun)
#define DEV_MEM "/dev/xsvc"
+#elif defined(HAS_APERTURE_DRV)
+#define DEV_MEM "/dev/xf86"
#else
#define DEV_MEM "/dev/mem"
#endif
@@ -931,11 +935,6 @@ DGAMapPhysical(
MAP_FILE | MAP_SHARED, pMap->fd, (off_t)base);
if (pMap->virtual == (void *)-1)
return False;
-#endif
-
-#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \
- && !(defined(Lynx) && defined(NO_MMAP)) \
- && !defined(__UNIXOS2__)
mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE);
#endif
@@ -947,16 +946,23 @@ DGAMapPhysical(
static void
DGAUnmapPhysical(DGAMapPtr pMap)
{
-#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \
- && !(defined(Lynx) && defined(NO_MMAP)) \
- && !defined(__UNIXOS2__)
- mprotect(pMap->virtual,pMap->size, PROT_READ);
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ /* XXX Add unmapping code here. */
+#elif defined (__UNIXOS2__)
+ /* XXX Add unmapping code here. */
#elif defined(Lynx) && defined(NO_MMAP)
/* XXX this doesn't allow enable after disable */
smem_create(NULL, pMap->virtual, pMap->size, SM_DETACH);
smem_remove("XF86DGA");
+#else
+ if (pMap->virtual && pMap->virtual != (void *)-1) {
+ mprotect(pMap->virtual,pMap->size, PROT_READ);
+ munmap(pMap->virtual, pMap->size);
+ pMap->virtual = 0;
+ }
+ if (pMap->fd >= 0) {
+ close(pMap->fd);
+ pMap->fd = -1;
+ }
#endif
-
-
- /* We need to unmap and close too !!!!!!!!!!*/
}