diff options
62 files changed, 845 insertions, 59 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index a60ddae2..b62aff08 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.58 1999/08/30 13:05:00 faith Exp $ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.1 1999/09/25 14:37:59 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h,v 1.1 2000/06/17 00:03:28 martin Exp $ * */ diff --git a/bsd/Imakefile b/bsd/Imakefile index b3e5971b..81445a7d 100644 --- a/bsd/Imakefile +++ b/bsd/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile,v 1.1 2000/06/17 00:03:28 martin Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile,v 1.2 2000/08/16 01:45:31 dawes Exp $ #include <Server.tmpl> diff --git a/bsd/drm/drmstat.c b/bsd/drm/drmstat.c index 0ce76b01..48fb1b16 100644 --- a/bsd/drm/drmstat.c +++ b/bsd/drm/drmstat.c @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmstat.c,v 1.28 1999/08/04 18:12:11 faith Exp $ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmstat.c,v 1.1 1999/09/25 14:37:59 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm/drmstat.c,v 1.1 2000/06/17 00:03:30 martin Exp $ * */ diff --git a/bsd/drm/proc.c b/bsd/drm/proc.c index 12168aa3..3f6616ef 100644 --- a/bsd/drm/proc.c +++ b/bsd/drm/proc.c @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c,v 1.4 1999/08/20 15:36:46 faith Exp $ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c,v 1.1 1999/09/25 14:38:02 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm/proc.c,v 1.1 2000/06/17 00:03:30 martin Exp $ * */ diff --git a/bsd/drm/sysctl.c b/bsd/drm/sysctl.c index 7c736abf..a890abac 100644 --- a/bsd/drm/sysctl.c +++ b/bsd/drm/sysctl.c @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI$ - * $XFree86$ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm/sysctl.c,v 1.1 2000/06/17 00:03:31 martin Exp $ * */ @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.58 1999/08/30 13:05:00 faith Exp $ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.1 1999/09/25 14:37:59 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h,v 1.1 2000/06/17 00:03:28 martin Exp $ * */ diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index aa086758..b921db38 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -27,7 +27,7 @@ * Authors: Rickard E. (Rik) Faith <faith@valinux.com> * Kevin E. Martin <martin@valinux.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.15 2000/08/09 14:44:27 alanh Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.16 2000/08/28 16:55:52 dawes Exp $ * */ diff --git a/libdrm/xf86drmHash.c b/libdrm/xf86drmHash.c index 17089e44..24b698cc 100644 --- a/libdrm/xf86drmHash.c +++ b/libdrm/xf86drmHash.c @@ -25,7 +25,7 @@ * * Authors: Rickard E. (Rik) Faith <faith@valinux.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmHash.c,v 1.2 2000/02/23 04:47:23 martin Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmHash.c,v 1.3 2000/06/17 00:03:34 martin Exp $ * * DESCRIPTION * diff --git a/libdrm/xf86drmRandom.c b/libdrm/xf86drmRandom.c index 71ef1155..9e1e9ee2 100644 --- a/libdrm/xf86drmRandom.c +++ b/libdrm/xf86drmRandom.c @@ -25,7 +25,7 @@ * * Authors: Rickard E. (Rik) Faith <faith@valinux.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmRandom.c,v 1.3 2000/02/23 04:47:23 martin Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmRandom.c,v 1.4 2000/06/17 00:03:34 martin Exp $ * * DESCRIPTION * diff --git a/libdrm/xf86drmSL.c b/libdrm/xf86drmSL.c index f67434be..dd634c30 100644 --- a/libdrm/xf86drmSL.c +++ b/libdrm/xf86drmSL.c @@ -25,7 +25,7 @@ * * Authors: Rickard E. (Rik) Faith <faith@valinux.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSL.c,v 1.2 2000/02/23 04:47:24 martin Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSL.c,v 1.3 2000/06/17 00:03:34 martin Exp $ * * DESCRIPTION * diff --git a/linux-core/Makefile.kernel b/linux-core/Makefile.kernel index 9f8b702d..0791af45 100644 --- a/linux-core/Makefile.kernel +++ b/linux-core/Makefile.kernel @@ -1,4 +1,4 @@ -# $XFree86$ +# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.8 2000/08/28 02:43:14 tsi Exp $ # # Makefile for the drm device driver. This driver provides support for # the Direct Rendering Infrastructure (DRI) in XFree86 4.x. diff --git a/linux-core/README.drm b/linux-core/README.drm index b48b7b67..97dd0d84 100644 --- a/linux-core/README.drm +++ b/linux-core/README.drm @@ -1,4 +1,4 @@ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/README.drm,v 1.4 2000/08/28 02:43:14 tsi Exp $ */ ************************************************************ * For the very latest on DRI development, please see: * diff --git a/linux-core/drmP.h b/linux-core/drmP.h index e47c0892..3d5219db 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.9 2000/08/28 02:43:14 tsi Exp $ */ #ifndef _DRM_P_H_ #define _DRM_P_H_ diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c index 1a8290df..12945310 100644 --- a/linux-core/i810_dma.c +++ b/linux-core/i810_dma.c @@ -29,7 +29,7 @@ * Keith Whitwell <keithw@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c,v 1.6 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux-core/i810_drv.c b/linux-core/i810_drv.c index 3dc5c6af..5e86ea49 100644 --- a/linux-core/i810_drv.c +++ b/linux-core/i810_drv.c @@ -28,7 +28,7 @@ * Jeff Hartmann <jhartmann@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux-core/i810_drv.h b/linux-core/i810_drv.h index 5586a6a6..9f46be50 100644 --- a/linux-core/i810_drv.h +++ b/linux-core/i810_drv.h @@ -28,7 +28,7 @@ * Jeff Hartmann <jhartmann@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h,v 1.5 2000/08/28 02:43:15 tsi Exp $ */ #ifndef _I810_DRV_H_ #define _I810_DRV_H_ diff --git a/linux-core/mga_drv.c b/linux-core/mga_drv.c index ab1bc127..38bc716b 100644 --- a/linux-core/mga_drv.c +++ b/linux-core/mga_drv.c @@ -29,7 +29,7 @@ * * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c,v 1.4 2000/08/28 02:43:15 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux-core/r128_drv.c b/linux-core/r128_drv.c index 9d768ce1..94ee806c 100644 --- a/linux-core/r128_drv.c +++ b/linux-core/r128_drv.c @@ -28,7 +28,7 @@ * Kevin E. Martin <martin@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c,v 1.3 2000/08/28 02:43:16 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux-core/sis_drv.c b/linux-core/sis_drv.c index 9acfc1e4..c5103d58 100644 --- a/linux-core/sis_drv.c +++ b/linux-core/sis_drv.c @@ -30,7 +30,7 @@ * Sung-Ching Lin <sclin@sis.com.tw> * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c,v 1.6 2000/08/28 02:43:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c,v 1.5 2000/09/22 11:35:47 alanh Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux-core/tdfx_drv.c b/linux-core/tdfx_drv.c index 9cc3c993..0fef5f7e 100644 --- a/linux-core/tdfx_drv.c +++ b/linux-core/tdfx_drv.c @@ -29,7 +29,7 @@ * Daryll Strauss <daryll@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c,v 1.6 2000/08/28 02:43:16 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux/Makefile.kernel b/linux/Makefile.kernel index 9f8b702d..0791af45 100644 --- a/linux/Makefile.kernel +++ b/linux/Makefile.kernel @@ -1,4 +1,4 @@ -# $XFree86$ +# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.8 2000/08/28 02:43:14 tsi Exp $ # # Makefile for the drm device driver. This driver provides support for # the Direct Rendering Infrastructure (DRI) in XFree86 4.x. diff --git a/linux/Makefile.linux b/linux/Makefile.linux index afdde702..ae08f3e8 100644 --- a/linux/Makefile.linux +++ b/linux/Makefile.linux @@ -24,7 +24,7 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # -# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.10 2000/08/25 13:42:39 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.11 2000/09/01 02:31:38 tsi Exp $ # # ***** NOTE NOTE NOTE NOTE NOTE ***** # To override the automatic Linux source tree determination, pass the diff --git a/linux/README.drm b/linux/README.drm index b48b7b67..97dd0d84 100644 --- a/linux/README.drm +++ b/linux/README.drm @@ -1,4 +1,4 @@ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/README.drm,v 1.4 2000/08/28 02:43:14 tsi Exp $ */ ************************************************************ * For the very latest on DRI development, please see: * diff --git a/linux/agpsupport.c b/linux/agpsupport.c index 6a9f78c2..f7e1cd25 100644 --- a/linux/agpsupport.c +++ b/linux/agpsupport.c @@ -28,7 +28,7 @@ * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/agpsupport.c,v 1.4 2000/08/28 02:43:14 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/auth.c b/linux/auth.c index a58bdd01..ec13a0de 100644 --- a/linux/auth.c +++ b/linux/auth.c @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/auth.c,v 1.5 2000/08/28 02:43:14 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/bufs.c b/linux/bufs.c index 66bfc19e..964287ed 100644 --- a/linux/bufs.c +++ b/linux/bufs.c @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/bufs.c,v 1.8 2000/08/28 02:43:14 tsi Exp $ */ #define __NO_VERSION__ #include <linux/config.h> diff --git a/linux/drm.h b/linux/drm.h index 44e2d397..6cfe88fa 100644 --- a/linux/drm.h +++ b/linux/drm.h @@ -31,7 +31,7 @@ * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg. * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.9 2000/08/24 22:20:18 tsi Exp $ */ #ifndef _DRM_H_ #define _DRM_H_ diff --git a/linux/drmP.h b/linux/drmP.h index e47c0892..3d5219db 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.9 2000/08/28 02:43:14 tsi Exp $ */ #ifndef _DRM_P_H_ #define _DRM_P_H_ diff --git a/linux/fops.c b/linux/fops.c index a839a6d9..bbb91f27 100644 --- a/linux/fops.c +++ b/linux/fops.c @@ -29,7 +29,7 @@ * Daryll Strauss <daryll@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.9 2000/08/28 02:43:14 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/gamma_drv.c b/linux/gamma_drv.c index 5d4c3ba9..ecdc6e1c 100644 --- a/linux/gamma_drv.c +++ b/linux/gamma_drv.c @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.c,v 1.8 2000/08/28 02:43:14 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux/gamma_drv.h b/linux/gamma_drv.h index e50fb3f7..f8bbe077 100644 --- a/linux/gamma_drv.h +++ b/linux/gamma_drv.h @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_drv.h,v 1.6 2000/08/28 02:43:15 tsi Exp $ */ #ifndef _GAMMA_DRV_H_ #define _GAMMA_DRV_H_ diff --git a/linux/i810_context.c b/linux/i810_context.c index 5dd440cb..8f01d295 100644 --- a/linux/i810_context.c +++ b/linux/i810_context.c @@ -28,7 +28,7 @@ * Jeff Hartmann <jhartmann@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_context.c,v 1.3 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/i810_dma.c b/linux/i810_dma.c index 1a8290df..12945310 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -29,7 +29,7 @@ * Keith Whitwell <keithw@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c,v 1.6 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/i810_drv.c b/linux/i810_drv.c index 3dc5c6af..5e86ea49 100644 --- a/linux/i810_drv.c +++ b/linux/i810_drv.c @@ -28,7 +28,7 @@ * Jeff Hartmann <jhartmann@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux/i810_drv.h b/linux/i810_drv.h index 5586a6a6..9f46be50 100644 --- a/linux/i810_drv.h +++ b/linux/i810_drv.h @@ -28,7 +28,7 @@ * Jeff Hartmann <jhartmann@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drv.h,v 1.5 2000/08/28 02:43:15 tsi Exp $ */ #ifndef _I810_DRV_H_ #define _I810_DRV_H_ diff --git a/linux/init.c b/linux/init.c index 98189580..81cbd8ff 100644 --- a/linux/init.c +++ b/linux/init.c @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/init.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/lists.c b/linux/lists.c index 2850d3b3..0a21a910 100644 --- a/linux/lists.c +++ b/linux/lists.c @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/lists.c,v 1.9 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/memory.c b/linux/memory.c index 3416698a..36d424fd 100644 --- a/linux/memory.c +++ b/linux/memory.c @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/memory.c,v 1.8 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include <linux/config.h> diff --git a/linux/mga_context.c b/linux/mga_context.c index 004fec14..546aac16 100644 --- a/linux/mga_context.c +++ b/linux/mga_context.c @@ -28,7 +28,7 @@ * Jeff Hartmann <jhartmann@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_context.c,v 1.4 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/mga_dma.c b/linux/mga_dma.c index 1a1041a3..7fd84698 100644 --- a/linux/mga_dma.c +++ b/linux/mga_dma.c @@ -29,7 +29,7 @@ * Keith Whitwell <keithw@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_dma.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/mga_drv.c b/linux/mga_drv.c index ab1bc127..38bc716b 100644 --- a/linux/mga_drv.c +++ b/linux/mga_drv.c @@ -29,7 +29,7 @@ * * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.c,v 1.4 2000/08/28 02:43:15 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux/mga_drv.h b/linux/mga_drv.h index 8ba77224..101409cb 100644 --- a/linux/mga_drv.h +++ b/linux/mga_drv.h @@ -28,7 +28,7 @@ * Jeff Hartmann <jhartmann@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_drv.h,v 1.4 2000/08/28 02:43:15 tsi Exp $ */ #ifndef _MGA_DRV_H_ #define _MGA_DRV_H_ diff --git a/linux/mga_state.c b/linux/mga_state.c index 45e93868..b4c16434 100644 --- a/linux/mga_state.c +++ b/linux/mga_state.c @@ -28,7 +28,7 @@ * Keith Whitwell <keithw@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mga_state.c,v 1.5 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/picker.c b/linux/picker.c index 11912740..ada14374 100644 --- a/linux/picker.c +++ b/linux/picker.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/picker.c,v 1.3 2000/09/01 02:31:40 tsi Exp $ */ #include <linux/autoconf.h> #include <linux/version.h> diff --git a/linux/proc.c b/linux/proc.c index 25822fd5..f585e915 100644 --- a/linux/proc.c +++ b/linux/proc.c @@ -27,7 +27,7 @@ * Authors: * Rickard E. (Rik) Faith <faith@valinux.com> */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/proc.c,v 1.9 2000/08/28 02:43:15 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/r128_bufs.c b/linux/r128_bufs.c index 19e389de..d9e5d07e 100644 --- a/linux/r128_bufs.c +++ b/linux/r128_bufs.c @@ -29,7 +29,7 @@ * Jeff Hartmann <jhartmann@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_bufs.c,v 1.3 2000/08/28 02:43:16 tsi Exp $ */ #define __NO_VERSION__ #include <linux/config.h> diff --git a/linux/r128_context.c b/linux/r128_context.c index a0df4d69..7eb8bf25 100644 --- a/linux/r128_context.c +++ b/linux/r128_context.c @@ -27,7 +27,7 @@ * Author: Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_context.c,v 1.3 2000/08/28 02:43:16 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/r128_drv.c b/linux/r128_drv.c index 9d768ce1..94ee806c 100644 --- a/linux/r128_drv.c +++ b/linux/r128_drv.c @@ -28,7 +28,7 @@ * Kevin E. Martin <martin@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c,v 1.3 2000/08/28 02:43:16 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux/r128_drv.h b/linux/r128_drv.h index 2e17ed1c..58442849 100644 --- a/linux/r128_drv.h +++ b/linux/r128_drv.h @@ -28,7 +28,7 @@ * Kevin E. Martin <martin@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.h,v 1.4 2000/08/28 02:43:16 tsi Exp $ */ #ifndef _R128_DRV_H_ #define _R128_DRV_H_ diff --git a/linux/sis_context.c b/linux/sis_context.c new file mode 100644 index 00000000..e13bd853 --- /dev/null +++ b/linux/sis_context.c @@ -0,0 +1,214 @@ +/* sis_context.c -- IOCTLs for sis contexts -*- linux-c -*- + * Created: Thu Oct 7 10:50:22 1999 by faith@precisioninsight.com + * + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: + * Rickard E. (Rik) Faith <faith@valinux.com> + * Daryll Strauss <daryll@valinux.com> + * Sung-Ching Lin <sclin@sis.com.tw> + * + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c,v 1.3 2000/09/22 11:35:47 alanh Exp $ */ + +#define __NO_VERSION__ +#include "drmP.h" +#include "sis_drv.h" + +extern drm_ctx_t sis_res_ctx; + +static int sis_alloc_queue(drm_device_t *dev) +{ + return drm_ctxbitmap_next(dev); +} + +int sis_context_switch(drm_device_t *dev, int old, int new) +{ + char buf[64]; + + atomic_inc(&dev->total_ctx); + + if (test_and_set_bit(0, &dev->context_flag)) { + DRM_ERROR("Reentering -- FIXME\n"); + return -EBUSY; + } + +#if DRM_DMA_HISTOGRAM + dev->ctx_start = get_cycles(); +#endif + + DRM_DEBUG("Context switch from %d to %d\n", old, new); + + if (new == dev->last_context) { + clear_bit(0, &dev->context_flag); + return 0; + } + + if (drm_flags & DRM_FLAG_NOCTX) { + sis_context_switch_complete(dev, new); + } else { + sprintf(buf, "C %d %d\n", old, new); + drm_write_string(dev, buf); + } + + return 0; +} + +int sis_context_switch_complete(drm_device_t *dev, int new) +{ + dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ + dev->last_switch = jiffies; + + if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { + DRM_ERROR("Lock isn't held after context switch\n"); + } + + /* If a context switch is ever initiated + when the kernel holds the lock, release + that lock here. */ +#if DRM_DMA_HISTOGRAM + atomic_inc(&dev->histo.ctx[drm_histogram_slot(get_cycles() + - dev->ctx_start)]); + +#endif + clear_bit(0, &dev->context_flag); + wake_up(&dev->context_wait); + + return 0; +} + + +int sis_resctx(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg) +{ + drm_ctx_res_t res; + drm_ctx_t ctx; + int i; + + DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS); + copy_from_user_ret(&res, (drm_ctx_res_t *)arg, sizeof(res), -EFAULT); + if (res.count >= DRM_RESERVED_CONTEXTS) { + memset(&ctx, 0, sizeof(ctx)); + for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { + ctx.handle = i; + copy_to_user_ret(&res.contexts[i], + &i, + sizeof(i), + -EFAULT); + } + } + res.count = DRM_RESERVED_CONTEXTS; + copy_to_user_ret((drm_ctx_res_t *)arg, &res, sizeof(res), -EFAULT); + return 0; +} + + +int sis_addctx(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg) +{ + drm_file_t *priv = filp->private_data; + drm_device_t *dev = priv->dev; + drm_ctx_t ctx; + + copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT); + if ((ctx.handle = sis_alloc_queue(dev)) == DRM_KERNEL_CONTEXT) { + /* Skip kernel's context and get a new one. */ + ctx.handle = sis_alloc_queue(dev); + } + DRM_DEBUG("%d\n", ctx.handle); + if (ctx.handle == -1) { + DRM_DEBUG("Not enough free contexts.\n"); + /* Should this return -EBUSY instead? */ + return -ENOMEM; + } + + /* new added */ + sis_init_context(ctx.handle); + + copy_to_user_ret((drm_ctx_t *)arg, &ctx, sizeof(ctx), -EFAULT); + return 0; +} + +int sis_modctx(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg) +{ + drm_ctx_t ctx; + + copy_from_user_ret(&ctx, (drm_ctx_t*)arg, sizeof(ctx), -EFAULT); + if (ctx.flags==_DRM_CONTEXT_PRESERVED) + sis_res_ctx.handle=ctx.handle; + return 0; +} + +int sis_getctx(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg) +{ + drm_ctx_t ctx; + + copy_from_user_ret(&ctx, (drm_ctx_t*)arg, sizeof(ctx), -EFAULT); + /* This is 0, because we don't hanlde any context flags */ + ctx.flags = 0; + copy_to_user_ret((drm_ctx_t*)arg, &ctx, sizeof(ctx), -EFAULT); + return 0; +} + +int sis_switchctx(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg) +{ + drm_file_t *priv = filp->private_data; + drm_device_t *dev = priv->dev; + drm_ctx_t ctx; + + copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT); + DRM_DEBUG("%d\n", ctx.handle); + return sis_context_switch(dev, dev->last_context, ctx.handle); +} + +int sis_newctx(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg) +{ + drm_file_t *priv = filp->private_data; + drm_device_t *dev = priv->dev; + drm_ctx_t ctx; + + copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT); + DRM_DEBUG("%d\n", ctx.handle); + sis_context_switch_complete(dev, ctx.handle); + + return 0; +} + +int sis_rmctx(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg) +{ + drm_file_t *priv = filp->private_data; + drm_device_t *dev = priv->dev; + drm_ctx_t ctx; + + copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT); + DRM_DEBUG("%d\n", ctx.handle); + drm_ctxbitmap_free(dev, ctx.handle); + + return 0; +} diff --git a/linux/sis_drm_public.h b/linux/sis_drm_public.h index 4d2447d2..1e7399ff 100644 --- a/linux/sis_drm_public.h +++ b/linux/sis_drm_public.h @@ -27,7 +27,7 @@ * Sung-Ching Lin <sclin@sis.com.tw> * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm_public.h,v 1.2 2000/08/04 03:51:47 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm_public.h,v 1.3 2000/09/22 11:35:47 alanh Exp $ */ #ifndef _sis_drm_public_h_ #define _sis_drm_public_h_ diff --git a/linux/sis_drv.c b/linux/sis_drv.c index 9acfc1e4..c5103d58 100644 --- a/linux/sis_drv.c +++ b/linux/sis_drv.c @@ -30,7 +30,7 @@ * Sung-Ching Lin <sclin@sis.com.tw> * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c,v 1.6 2000/08/28 02:43:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c,v 1.5 2000/09/22 11:35:47 alanh Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux/sis_drv.h b/linux/sis_drv.h index 95236977..496c5655 100644 --- a/linux/sis_drv.h +++ b/linux/sis_drv.h @@ -30,7 +30,7 @@ * Sung-Ching Lin <sclin@sis.com.tw> * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h,v 1.5 2000/08/28 02:43:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h,v 1.3 2000/09/22 11:35:47 alanh Exp $ */ #ifndef _SIS_DRV_H_ #define _SIS_DRV_H_ diff --git a/linux/sis_ds.c b/linux/sis_ds.c new file mode 100644 index 00000000..a946a41f --- /dev/null +++ b/linux/sis_ds.c @@ -0,0 +1,408 @@ +/* sis_ds.c -- Private header for Direct Rendering Manager -*- linux-c -*- + * Created: Mon Jan 4 10:05:05 1999 by sclin@sis.com.tw + * + * Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: + * Sung-Ching Lin <sclin@sis.com.tw> + * + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c,v 1.2 2000/09/22 11:35:47 alanh Exp $ */ + +#define __NO_VERSION__ +#include <linux/module.h> +#include <linux/delay.h> +#include <linux/errno.h> +#include <linux/kernel.h> +#include <linux/malloc.h> +#include <linux/poll.h> +#include <asm/io.h> +#include <linux/pci.h> + +#include "sis_ds.h" + +/* Set Data Structure, not check repeated value + * temporarily used + */ + +set_t *setInit(void) +{ + int i; + set_t *set; + + set = (set_t *)MALLOC(sizeof(set_t)); + for(i = 0; i < SET_SIZE; i++){ + set->list[i].free_next = i+1; + set->list[i].alloc_next = -1; + } + set->list[SET_SIZE-1].free_next = -1; + set->free = 0; + set->alloc = -1; + set->trace = -1; + + return set; +} + +int setAdd(set_t *set, ITEM_TYPE item) +{ + int free = set->free; + + if(free != -1){ + set->list[free].val = item; + set->free = set->list[free].free_next; + } + else{ + return 0; + } + + set->list[free].alloc_next = set->alloc; + set->alloc = free; + set->list[free].free_next = -1; + + return 1; +} + +int setDel(set_t *set, ITEM_TYPE item) +{ + int alloc = set->alloc; + int prev = -1; + + while(alloc != -1){ + if(set->list[alloc].val == item){ + if(prev != -1) + set->list[prev].alloc_next = set->list[alloc].alloc_next; + else + set->alloc = set->list[alloc].alloc_next; + break; + } + prev = alloc; + alloc = set->list[alloc].alloc_next; + } + + if(alloc == -1) + return 0; + + set->list[alloc].free_next = set->free; + set->free = alloc; + set->list[alloc].alloc_next = -1; + + return 1; +} + +/* setFirst -> setAdd -> setNext is wrong */ + +int setFirst(set_t *set, ITEM_TYPE *item) +{ + if(set->alloc == -1) + return 0; + + *item = set->list[set->alloc].val; + set->trace = set->list[set->alloc].alloc_next; + + return 1; +} + +int setNext(set_t *set, ITEM_TYPE *item) +{ + if(set->trace == -1) + return 0; + + *item = set->list[set->trace].val; + set->trace = set->list[set->trace].alloc_next; + + return 1; +} + +int setDestroy(set_t *set) +{ + FREE(set); + + return 1; +} + +/* + * GLX Hardware Device Driver common code + * Copyright (C) 1999 Keith Whitwell + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c,v 1.2 2000/09/22 11:35:47 alanh Exp $ */ + +#define ISFREE(bptr) ((bptr)->free) + +#define PRINTF(fmt, arg...) do{}while(0) +#define fprintf(fmt, arg...) do{}while(0) + +static void *calloc(size_t nmemb, size_t size) +{ + void *addr; + addr = kmalloc(nmemb*size, GFP_KERNEL); + memset(addr, 0, nmemb*size); + return addr; +} +#define free(n) kfree(n) + +void mmDumpMemInfo( memHeap_t *heap ) +{ + TMemBlock *p; + + PRINTF ("Memory heap %p:\n", heap); + if (heap == 0) { + PRINTF (" heap == 0\n"); + } else { + p = (TMemBlock *)heap; + while (p) { + PRINTF (" Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size, + p->free ? '.':'U', + p->reserved ? 'R':'.'); + p = p->next; + } + } + PRINTF ("End of memory blocks\n"); +} + +memHeap_t *mmInit(int ofs, + int size) +{ + PMemBlock blocks; + + if (size <= 0) { + return 0; + } + blocks = (TMemBlock *) calloc(1,sizeof(TMemBlock)); + if (blocks) { + blocks->ofs = ofs; + blocks->size = size; + blocks->free = 1; + return (memHeap_t *)blocks; + } else + return 0; +} + +/* Kludgey workaround for existing i810 server. Remove soon. + */ +memHeap_t *mmAddRange( memHeap_t *heap, + int ofs, + int size ) +{ + PMemBlock blocks; + blocks = (TMemBlock *) calloc(2,sizeof(TMemBlock)); + if (blocks) { + blocks[0].size = size; + blocks[0].free = 1; + blocks[0].ofs = ofs; + blocks[0].next = &blocks[1]; + + /* Discontinuity - stops JoinBlock from trying to join non-adjacent + * ranges. + */ + blocks[1].size = 0; + blocks[1].free = 0; + blocks[1].ofs = ofs+size; + blocks[1].next = (PMemBlock) heap; + return (memHeap_t *)blocks; + } + else + return heap; +} + +static TMemBlock* SliceBlock(TMemBlock *p, + int startofs, int size, + int reserved, int alignment) +{ + TMemBlock *newblock; + + /* break left */ + if (startofs > p->ofs) { + newblock = (TMemBlock*) calloc(1,sizeof(TMemBlock)); + newblock->ofs = startofs; + newblock->size = p->size - (startofs - p->ofs); + newblock->free = 1; + newblock->next = p->next; + p->size -= newblock->size; + p->next = newblock; + p = newblock; + } + + /* break right */ + if (size < p->size) { + newblock = (TMemBlock*) calloc(1,sizeof(TMemBlock)); + newblock->ofs = startofs + size; + newblock->size = p->size - size; + newblock->free = 1; + newblock->next = p->next; + p->size = size; + p->next = newblock; + } + + /* p = middle block */ + p->align = alignment; + p->free = 0; + p->reserved = reserved; + return p; +} + +PMemBlock mmAllocMem( memHeap_t *heap, int size, int align2, int startSearch) +{ + int mask,startofs,endofs; + TMemBlock *p; + + if (!heap || align2 < 0 || size <= 0) + return NULL; + mask = (1 << align2)-1; + startofs = 0; + p = (TMemBlock *)heap; + while (p) { + if (ISFREE(p)) { + startofs = (p->ofs + mask) & ~mask; + if ( startofs < startSearch ) { + startofs = startSearch; + } + endofs = startofs+size; + if (endofs <= (p->ofs+p->size)) + break; + } + p = p->next; + } + if (!p) + return NULL; + p = SliceBlock(p,startofs,size,0,mask+1); + p->heap = heap; + return p; +} + +static __inline__ int Join2Blocks(TMemBlock *p) +{ + if (p->free && p->next && p->next->free) { + TMemBlock *q = p->next; + p->size += q->size; + p->next = q->next; + free(q); + return 1; + } + return 0; +} + +int mmFreeMem(PMemBlock b) +{ + TMemBlock *p,*prev; + + if (!b) + return 0; + if (!b->heap) { + fprintf(stderr, "no heap\n"); + return -1; + } + p = b->heap; + prev = NULL; + while (p && p != b) { + prev = p; + p = p->next; + } + if (!p || p->free || p->reserved) { + if (!p) + fprintf(stderr, "block not found in heap\n"); + else if (p->free) + fprintf(stderr, "block already free\n"); + else + fprintf(stderr, "block is reserved\n"); + return -1; + } + p->free = 1; + Join2Blocks(p); + if (prev) + Join2Blocks(prev); + return 0; +} + +int mmReserveMem(memHeap_t *heap, int offset,int size) +{ + int endofs; + TMemBlock *p; + + if (!heap || size <= 0) + return -1; + endofs = offset+size; + p = (TMemBlock *)heap; + while (p && p->ofs <= offset) { + if (ISFREE(p) && endofs <= (p->ofs+p->size)) { + SliceBlock(p,offset,size,1,1); + return 0; + } + p = p->next; + } + return -1; +} + +int mmFreeReserved(memHeap_t *heap, int offset) +{ + TMemBlock *p,*prev; + + if (!heap) + return -1; + p = (TMemBlock *)heap; + prev = NULL; + while (p && p->ofs != offset) { + prev = p; + p = p->next; + } + if (!p || !p->reserved) + return -1; + p->free = 1; + p->reserved = 0; + Join2Blocks(p); + if (prev) + Join2Blocks(prev); + return 0; +} + +void mmDestroy(memHeap_t *heap) +{ + TMemBlock *p,*q; + + if (!heap) + return; + p = (TMemBlock *)heap; + while (p) { + q = p->next; + free(p); + p = q; + } +} diff --git a/linux/sis_ds.h b/linux/sis_ds.h new file mode 100644 index 00000000..59d58b8c --- /dev/null +++ b/linux/sis_ds.h @@ -0,0 +1,164 @@ +/* sis_ds.h -- Private header for Direct Rendering Manager -*- linux-c -*- + * Created: Mon Jan 4 10:05:05 1999 by sclin@sis.com.tw + * + * Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: + * Sung-Ching Lin <sclin@sis.com.tw> + * + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h,v 1.3 2000/09/22 11:35:47 alanh Exp $ */ + +#ifndef _sis_ds_h_ +#define _sis_ds_h_ + +/* Set Data Structure */ + +#define SET_SIZE 5000 +#define MALLOC(s) kmalloc(s, GFP_KERNEL) +#define FREE(s) kfree(s) + +typedef unsigned int ITEM_TYPE; + +typedef struct { + ITEM_TYPE val; + int alloc_next, free_next; +} list_item_t; + +typedef struct { + int alloc; + int free; + int trace; + list_item_t list[SET_SIZE]; +} set_t; + +set_t *setInit(void); +int setAdd(set_t *set, ITEM_TYPE item); +int setDel(set_t *set, ITEM_TYPE item); +int setFirst(set_t *set, ITEM_TYPE *item); +int setNext(set_t *set, ITEM_TYPE *item); +int setDestroy(set_t *set); + +#endif + +/* + * GLX Hardware Device Driver common code + * Copyright (C) 1999 Keith Whitwell + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef MM_INC +#define MM_INC + +struct mem_block_t { + struct mem_block_t *next; + struct mem_block_t *heap; + int ofs,size; + int align; + int free:1; + int reserved:1; +}; +typedef struct mem_block_t TMemBlock; +typedef struct mem_block_t *PMemBlock; + +/* a heap is just the first block in a chain */ +typedef struct mem_block_t memHeap_t; + +static __inline__ int mmBlockSize(PMemBlock b) +{ return b->size; } + +static __inline__ int mmOffset(PMemBlock b) +{ return b->ofs; } + +static __inline__ void mmMarkReserved(PMemBlock b) +{ b->reserved = 1; } + +/* + * input: total size in bytes + * return: a heap pointer if OK, NULL if error + */ +memHeap_t *mmInit( int ofs, int size ); + + + +memHeap_t *mmAddRange( memHeap_t *heap, + int ofs, + int size ); + + +/* + * Allocate 'size' bytes with 2^align2 bytes alignment, + * restrict the search to free memory after 'startSearch' + * depth and back buffers should be in different 4mb banks + * to get better page hits if possible + * input: size = size of block + * align2 = 2^align2 bytes alignment + * startSearch = linear offset from start of heap to begin search + * return: pointer to the allocated block, 0 if error + */ +PMemBlock mmAllocMem( memHeap_t *heap, int size, int align2, int startSearch ); + +/* + * Free block starts at offset + * input: pointer to a block + * return: 0 if OK, -1 if error + */ +int mmFreeMem( PMemBlock b ); + +/* + * Reserve 'size' bytes block start at offset + * This is used to prevent allocation of memory already used + * by the X server for the front buffer, pixmaps, and cursor + * input: size, offset + * output: 0 if OK, -1 if error + */ +int mmReserveMem( memHeap_t *heap, int offset,int size ); +int mmFreeReserved( memHeap_t *heap, int offset ); + +/* + * destroy MM + */ +void mmDestroy( memHeap_t *mmInit ); + +/* For debuging purpose. */ +void mmDumpMemInfo( memHeap_t *mmInit ); + +#endif diff --git a/linux/sis_mm.c b/linux/sis_mm.c index 35a21bfe..1d909785 100644 --- a/linux/sis_mm.c +++ b/linux/sis_mm.c @@ -27,7 +27,7 @@ * Sung-Ching Lin <sclin@sis.com.tw> * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c,v 1.3 2000/08/25 13:42:46 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c,v 1.4 2000/09/22 11:35:47 alanh Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/tdfx_context.c b/linux/tdfx_context.c index 6371cfc4..96e27679 100644 --- a/linux/tdfx_context.c +++ b/linux/tdfx_context.c @@ -29,7 +29,7 @@ * Daryll Strauss <daryll@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_context.c,v 1.5 2000/08/28 02:43:16 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/linux/tdfx_drv.c b/linux/tdfx_drv.c index 9cc3c993..0fef5f7e 100644 --- a/linux/tdfx_drv.c +++ b/linux/tdfx_drv.c @@ -29,7 +29,7 @@ * Daryll Strauss <daryll@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c,v 1.6 2000/08/28 02:43:16 tsi Exp $ */ #include <linux/config.h> #include "drmP.h" diff --git a/linux/tdfx_drv.h b/linux/tdfx_drv.h index a5cef652..e6ec7aa4 100644 --- a/linux/tdfx_drv.h +++ b/linux/tdfx_drv.h @@ -29,7 +29,7 @@ * Daryll Strauss <daryll@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.h,v 1.5 2000/08/28 02:43:16 tsi Exp $ */ #ifndef _TDFX_DRV_H_ #define _TDFX_DRV_H_ @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/vm.c,v 1.8 2000/08/28 02:43:16 tsi Exp $ */ #define __NO_VERSION__ #include "drmP.h" diff --git a/shared-core/drm.h b/shared-core/drm.h index 44e2d397..6cfe88fa 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -31,7 +31,7 @@ * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg. * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.9 2000/08/24 22:20:18 tsi Exp $ */ #ifndef _DRM_H_ #define _DRM_H_ diff --git a/shared/drm.h b/shared/drm.h index 44e2d397..6cfe88fa 100644 --- a/shared/drm.h +++ b/shared/drm.h @@ -31,7 +31,7 @@ * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg. * */ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v 1.9 2000/08/24 22:20:18 tsi Exp $ */ #ifndef _DRM_H_ #define _DRM_H_ |