kernel tree reorganization stage 1: Major cvs repository work (not logged as
[dragonfly.git] / sys / dev / drm / r128 / r128_drv.c
1 /* r128_drv.c -- ATI Rage 128 driver -*- linux-c -*-
2  * Created: Mon Dec 13 09:47:27 1999 by faith@precisioninsight.com
3  *
4  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5  * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
6  * All Rights Reserved.
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a
9  * copy of this software and associated documentation files (the "Software"),
10  * to deal in the Software without restriction, including without limitation
11  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12  * and/or sell copies of the Software, and to permit persons to whom the
13  * Software is furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice (including the next
16  * paragraph) shall be included in all copies or substantial portions of the
17  * Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
22  * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Authors:
28  *    Rickard E. (Rik) Faith <faith@valinux.com>
29  *    Gareth Hughes <gareth@valinux.com>
30  *
31  * $FreeBSD: src/sys/dev/drm/r128_drv.c,v 1.5.2.1 2003/04/26 07:05:29 anholt Exp $
32  * $DragonFly: src/sys/dev/drm/r128/Attic/r128_drv.c,v 1.3 2003/08/07 21:16:55 dillon Exp $
33  */
34
35 #include "r128.h"
36 #include "dev/drm/drmP.h"
37 #include "dev/drm/drm.h"
38 #include "r128_drm.h"
39 #include "r128_drv.h"
40 #if __REALLY_HAVE_SG
41 #include "dev/drm/ati_pcigart.h"
42 #endif
43
44 /* List acquired from http://www.yourvote.com/pci/pcihdr.h and xc/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
45  * Please report to eta@lclark.edu inaccuracies or if a chip you have works that is marked unsupported here.
46  */
47 drm_chipinfo_t DRM(devicelist)[] = {
48         {0x1002, 0x4c45, __REALLY_HAVE_SG, "ATI Rage 128 Mobility LE (PCI)"},
49         {0x1002, 0x4c46, 1, "ATI Rage 128 Mobility LF (AGP)"},
50         {0x1002, 0x4d46, 1, "ATI Rage 128 Mobility MF (AGP)"},
51         {0x1002, 0x4d4c, 1, "ATI Rage 128 Mobility ML (AGP)"},
52         {0x1002, 0x5044, __REALLY_HAVE_SG, "ATI Rage 128 Pro PD (PCI)"},
53         {0x1002, 0x5046, 1, "ATI Rage 128 Pro PF (AGP)"},
54         {0x1002, 0x5050, __REALLY_HAVE_SG, "ATI Rage 128 Pro PP (PCI)"},
55         {0x1002, 0x5052, __REALLY_HAVE_SG, "ATI Rage 128 Pro PR (PCI)"},
56         {0x1002, 0x5245, __REALLY_HAVE_SG, "ATI Rage 128 RE (PCI)"},
57         {0x1002, 0x5246, 1, "ATI Rage 128 RF (AGP)"},
58         {0x1002, 0x5247, 1, "ATI Rage 128 RG (AGP)"},
59         {0x1002, 0x524b, __REALLY_HAVE_SG, "ATI Rage 128 RK (PCI)"},
60         {0x1002, 0x524c, 1, "ATI Rage 128 RL (AGP)"},
61         {0x1002, 0x534d, 1, "ATI Rage 128 SM (AGP)"},
62         {0x1002, 0x5446, 1, "ATI Rage 128 Pro Ultra TF (AGP)"},
63         {0x1002, 0x544C, 1, "ATI Rage 128 Pro Ultra TL (AGP)"},
64         {0x1002, 0x5452, 1, "ATI Rage 128 Pro Ultra TR (AGP)"},
65         {0, 0, 0, NULL}
66 };
67
68 #include "dev/drm/drm_agpsupport.h"
69 #include "dev/drm/drm_auth.h"
70 #include "dev/drm/drm_bufs.h"
71 #include "dev/drm/drm_context.h"
72 #include "dev/drm/drm_dma.h"
73 #include "dev/drm/drm_drawable.h"
74 #include "dev/drm/drm_drv.h"
75 #include "dev/drm/drm_fops.h"
76 #include "dev/drm/drm_ioctl.h"
77 #include "dev/drm/drm_lock.h"
78 #include "dev/drm/drm_memory.h"
79 #include "dev/drm/drm_sysctl.h"
80 #include "dev/drm/drm_vm.h"
81 #if __HAVE_SG
82 #include "dev/drm/drm_scatter.h"
83 #endif
84
85 #ifdef __FreeBSD__
86 DRIVER_MODULE(r128, pci, r128_driver, r128_devclass, 0, 0);
87 #elif defined(__NetBSD__)
88 CFDRIVER_DECL(r128, DV_TTY, NULL);
89 #endif /* __FreeBSD__ */