diff options
author | Jose Fonseca <jrfonseca@users.sourceforge.net> | 2003-02-27 12:52:42 +0000 |
---|---|---|
committer | Jose Fonseca <jrfonseca@users.sourceforge.net> | 2003-02-27 12:52:42 +0000 |
commit | 47c25e23394666a21934da5d63bb65e085b73aed (patch) | |
tree | 49adad28ec2cd6a994f305221db4a7cd46b500e8 | |
parent | 344c7f6b412c19c963c33709f0d4a3a7205e1d79 (diff) |
Bootstrapped a Savage kernel module from the tdfx (Andreas Karrenbauer)
-rw-r--r-- | linux-core/Makefile.kernel | 7 | ||||
-rw-r--r-- | linux-core/savage.h | 42 | ||||
-rw-r--r-- | linux-core/savage_drv.c | 78 | ||||
-rw-r--r-- | linux/Makefile.kernel | 7 | ||||
-rw-r--r-- | linux/Makefile.linux | 11 | ||||
-rw-r--r-- | linux/gamma_drm.h | 10 | ||||
-rw-r--r-- | linux/savage.h | 42 | ||||
-rw-r--r-- | linux/savage_drv.c | 78 |
8 files changed, 272 insertions, 3 deletions
diff --git a/linux-core/Makefile.kernel b/linux-core/Makefile.kernel index 1060d4cba..92fed6b79 100644 --- a/linux-core/Makefile.kernel +++ b/linux-core/Makefile.kernel @@ -3,10 +3,11 @@ # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. O_TARGET := drm.o -list-multi := gamma.o tdfx.o r128.o mga.o i810.o i830.o ffb.o radeon.o +list-multi := gamma.o tdfx.o r128.o mga.o i810.o i830.o ffb.o radeon.o savage.o gamma-objs := gamma_drv.o gamma_dma.o tdfx-objs := tdfx_drv.o +savage-objs := savage_drv.o r128-objs := r128_drv.o r128_cce.o r128_state.o mga-objs := mga_drv.o mga_dma.o mga_state.o mga_warp.o i810-objs := i810_drv.o i810_dma.o @@ -16,6 +17,7 @@ ffb-objs := ffb_drv.o ffb_context.o obj-$(CONFIG_DRM_GAMMA) += gamma.o obj-$(CONFIG_DRM_TDFX) += tdfx.o +obj-$(CONFIG_DRM_SAVAGE)+= savage.o obj-$(CONFIG_DRM_R128) += r128.o obj-$(CONFIG_DRM_RADEON)+= radeon.o obj-$(CONFIG_DRM_MGA) += mga.o @@ -31,6 +33,9 @@ gamma.o: $(gamma-objs) $(lib) tdfx.o: $(tdfx-objs) $(lib) $(LD) -r -o $@ $(tdfx-objs) $(lib) +savage.o: $(savage-objs) $(lib) + $(LD) -r -o $@ $(savage-objs) $(lib) + mga.o: $(mga-objs) $(lib) $(LD) -r -o $@ $(mga-objs) $(lib) diff --git a/linux-core/savage.h b/linux-core/savage.h new file mode 100644 index 000000000..4fd588c6a --- /dev/null +++ b/linux-core/savage.h @@ -0,0 +1,42 @@ +/* savage.h -- 3dfx DRM template customization -*- linux-c -*- + * Created: Wed Feb 14 12:32:32 2001 by gareth@valinux.com + * + * 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 + * VA LINUX SYSTEMS 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: + * Gareth Hughes <gareth@valinux.com> + */ + +#ifndef __SAVAGE_H__ +#define __SAVAGE_H__ + +/* This remains constant for all DRM template files. + */ +#define DRM(x) savage_##x + +/* General customization: + */ +#define __HAVE_MTRR 1 +#define __HAVE_CTX_BITMAP 1 + +#endif diff --git a/linux-core/savage_drv.c b/linux-core/savage_drv.c new file mode 100644 index 000000000..aacf3b778 --- /dev/null +++ b/linux-core/savage_drv.c @@ -0,0 +1,78 @@ +/* savage_drv.c -- savage driver -*- linux-c -*- + * Created: Thu Oct 7 10:38:32 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 of the original tdfx driver: + * Rickard E. (Rik) Faith <faith@valinux.com> + * Daryll Strauss <daryll@valinux.com> + * Gareth Hughes <gareth@valinux.com> + * Modified for Savage by: + * Andreas Karrenbauer <A.Karrenbauer@gmx.de> + */ + +#include <linux/config.h> +#include "savage.h" +#include "drmP.h" + +#define DRIVER_AUTHOR "bootstraped by Andreas Karrenbauer" + +#define DRIVER_NAME "savage" +#define DRIVER_DESC "alpha savage dr" +#define DRIVER_DATE "20030226" + +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 0 +#define DRIVER_PATCHLEVEL 0 + +#ifndef PCI_VENDOR_ID_SAVAGE +#define PCI_VENDOR_ID_SAVAGE 0x5333 +#endif +#ifndef PCI_DEVICE_ID_SAVAGE_VT8751 +#define PCI_DEVICE_ID_SAVAGE_VT8751 0x8d03 +#endif + +static drm_pci_list_t DRM(idlist)[] = { + { PCI_VENDOR_ID_SAVAGE, PCI_DEVICE_ID_SAVAGE_VT8751 }, + { 0, 0 } +}; + +#define DRIVER_CARD_LIST DRM(idlist) + + +#include "drm_auth.h" +#include "drm_bufs.h" +#include "drm_context.h" +#include "drm_dma.h" +#include "drm_drawable.h" +#include "drm_drv.h" + +#include "drm_fops.h" +#include "drm_init.h" +#include "drm_ioctl.h" +#include "drm_lock.h" +#include "drm_memory.h" +#include "drm_proc.h" +#include "drm_vm.h" +#include "drm_stub.h" diff --git a/linux/Makefile.kernel b/linux/Makefile.kernel index 1060d4cba..92fed6b79 100644 --- a/linux/Makefile.kernel +++ b/linux/Makefile.kernel @@ -3,10 +3,11 @@ # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. O_TARGET := drm.o -list-multi := gamma.o tdfx.o r128.o mga.o i810.o i830.o ffb.o radeon.o +list-multi := gamma.o tdfx.o r128.o mga.o i810.o i830.o ffb.o radeon.o savage.o gamma-objs := gamma_drv.o gamma_dma.o tdfx-objs := tdfx_drv.o +savage-objs := savage_drv.o r128-objs := r128_drv.o r128_cce.o r128_state.o mga-objs := mga_drv.o mga_dma.o mga_state.o mga_warp.o i810-objs := i810_drv.o i810_dma.o @@ -16,6 +17,7 @@ ffb-objs := ffb_drv.o ffb_context.o obj-$(CONFIG_DRM_GAMMA) += gamma.o obj-$(CONFIG_DRM_TDFX) += tdfx.o +obj-$(CONFIG_DRM_SAVAGE)+= savage.o obj-$(CONFIG_DRM_R128) += r128.o obj-$(CONFIG_DRM_RADEON)+= radeon.o obj-$(CONFIG_DRM_MGA) += mga.o @@ -31,6 +33,9 @@ gamma.o: $(gamma-objs) $(lib) tdfx.o: $(tdfx-objs) $(lib) $(LD) -r -o $@ $(tdfx-objs) $(lib) +savage.o: $(savage-objs) $(lib) + $(LD) -r -o $@ $(savage-objs) $(lib) + mga.o: $(mga-objs) $(lib) $(LD) -r -o $@ $(mga-objs) $(lib) diff --git a/linux/Makefile.linux b/linux/Makefile.linux index a498ed8c3..df8197505 100644 --- a/linux/Makefile.linux +++ b/linux/Makefile.linux @@ -38,7 +38,7 @@ # **** End of SMP/MODVERSIONS detection -MODS = gamma.o tdfx.o r128.o radeon.o +MODS = gamma.o tdfx.o r128.o radeon.o savage.o LIBS = DRMTEMPLATES = drm_auth.h drm_bufs.h drm_context.h drm_dma.h drm_drawable.h \ @@ -52,6 +52,9 @@ GAMMAHEADERS = gamma_drv.h $(DRMHEADERS) $(DRMTEMPLATES) TDFXOBJS = tdfx_drv.o TDFXHEADERS = tdfx.h $(DRMHEADERS) $(DRMTEMPLATES) +SAVAGEOBJS = savage_drv.o +SAVAGEHEADERS = savage.h $(DRMHEADERS) $(DRMTEMPLATES) + R128OBJS = r128_drv.o r128_cce.o r128_state.o R128HEADERS = r128.h r128_drv.h r128_drm.h $(DRMHEADERS) $(DRMTEMPLATES) @@ -224,6 +227,11 @@ tdfx_drv.o: tdfx_drv.c tdfx.o: $(TDFXOBJS) $(LIBS) $(LD) -r $^ -o $@ +savage_drv.o: savage_drv.c + $(CC) $(MODCFLAGS) -DEXPORT_SYMTAB -I$(TREE) -c $< -o $@ +savage.o: $(SAVAGEOBJS) $(LIBS) + $(LD) -r $^ -o $@ + sis.o: $(SISOBJS) $(LIBS) $(LD) -r $^ -o $@ @@ -270,6 +278,7 @@ ChangeLog: $(GAMMAOBJS): $(GAMMAHEADERS) $(TDFXOBJS): $(TDFXHEADERS) +$(SAVAGEOBJS): $(SAVAGEHEADERS) $(R128OBJS): $(R128HEADERS) $(RADEONOBJS): $(RADEONHEADERS) ifeq ($(AGP),1) diff --git a/linux/gamma_drm.h b/linux/gamma_drm.h index d06763ae9..0d58b07b5 100644 --- a/linux/gamma_drm.h +++ b/linux/gamma_drm.h @@ -48,6 +48,16 @@ typedef struct _drm_gamma_sarea { int vertex_prim; } drm_gamma_sarea_t; +/* WARNING: If you change any of these defines, make sure to change the + * defines in the Xserver file (xf86drmGamma.h) + */ + +/* Gamma specific ioctls + * The device specific ioctl range is 0x40 to 0x79. + */ +#define DRM_IOCTL_GAMMA_INIT DRM_IOW( 0x40, drm_gamma_init_t) +#define DRM_IOCTL_GAMMA_COPY DRM_IOW( 0x41, drm_gamma_copy_t) + typedef struct drm_gamma_copy { unsigned int DMAOutputAddress; unsigned int DMAOutputCount; diff --git a/linux/savage.h b/linux/savage.h new file mode 100644 index 000000000..4fd588c6a --- /dev/null +++ b/linux/savage.h @@ -0,0 +1,42 @@ +/* savage.h -- 3dfx DRM template customization -*- linux-c -*- + * Created: Wed Feb 14 12:32:32 2001 by gareth@valinux.com + * + * 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 + * VA LINUX SYSTEMS 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: + * Gareth Hughes <gareth@valinux.com> + */ + +#ifndef __SAVAGE_H__ +#define __SAVAGE_H__ + +/* This remains constant for all DRM template files. + */ +#define DRM(x) savage_##x + +/* General customization: + */ +#define __HAVE_MTRR 1 +#define __HAVE_CTX_BITMAP 1 + +#endif diff --git a/linux/savage_drv.c b/linux/savage_drv.c new file mode 100644 index 000000000..aacf3b778 --- /dev/null +++ b/linux/savage_drv.c @@ -0,0 +1,78 @@ +/* savage_drv.c -- savage driver -*- linux-c -*- + * Created: Thu Oct 7 10:38:32 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 of the original tdfx driver: + * Rickard E. (Rik) Faith <faith@valinux.com> + * Daryll Strauss <daryll@valinux.com> + * Gareth Hughes <gareth@valinux.com> + * Modified for Savage by: + * Andreas Karrenbauer <A.Karrenbauer@gmx.de> + */ + +#include <linux/config.h> +#include "savage.h" +#include "drmP.h" + +#define DRIVER_AUTHOR "bootstraped by Andreas Karrenbauer" + +#define DRIVER_NAME "savage" +#define DRIVER_DESC "alpha savage dr" +#define DRIVER_DATE "20030226" + +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 0 +#define DRIVER_PATCHLEVEL 0 + +#ifndef PCI_VENDOR_ID_SAVAGE +#define PCI_VENDOR_ID_SAVAGE 0x5333 +#endif +#ifndef PCI_DEVICE_ID_SAVAGE_VT8751 +#define PCI_DEVICE_ID_SAVAGE_VT8751 0x8d03 +#endif + +static drm_pci_list_t DRM(idlist)[] = { + { PCI_VENDOR_ID_SAVAGE, PCI_DEVICE_ID_SAVAGE_VT8751 }, + { 0, 0 } +}; + +#define DRIVER_CARD_LIST DRM(idlist) + + +#include "drm_auth.h" +#include "drm_bufs.h" +#include "drm_context.h" +#include "drm_dma.h" +#include "drm_drawable.h" +#include "drm_drv.h" + +#include "drm_fops.h" +#include "drm_init.h" +#include "drm_ioctl.h" +#include "drm_lock.h" +#include "drm_memory.h" +#include "drm_proc.h" +#include "drm_vm.h" +#include "drm_stub.h" |