From b354474bae9ab473e17b5cc51e45d36f0b4cf3b1 Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Wed, 26 Nov 2003 22:48:39 +0000 Subject: merge latest (4.3.99.16) from XFree86 (vendor) branch --- src/XF86DGA.c | 5 ++++- src/XF86DGA2.c | 32 +++++++++++++++++++------------- 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 #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 #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 !!!!!!!!!!*/ } -- cgit v1.2.3