]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/drm/gamma_drv.c
This commit was generated by cvs2svn to compensate for changes in r105081,
[FreeBSD/FreeBSD.git] / sys / dev / drm / gamma_drv.c
1 /* gamma.c -- 3dlabs GMX 2000 driver -*- linux-c -*-
2  * Created: Mon Jan  4 08:58:31 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  * PRECISION INSIGHT 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 OTHER
25  * DEALINGS IN THE SOFTWARE.
26  *
27  * Authors:
28  *    Rickard E. (Rik) Faith <faith@valinux.com>
29  *    Gareth Hughes <gareth@valinux.com>
30  *
31  * $FreeBSD$
32  */
33
34 #ifdef __linux__
35 #include <linux/config.h>
36 #endif /* __linux__ */
37 #ifdef __FreeBSD__
38 #include <sys/types.h>
39 #include <sys/bus.h>
40 #include <pci/pcivar.h>
41 #endif /* __FreeBSD__ */
42 #include "dev/drm/gamma.h"
43 #include "dev/drm/drmP.h"
44 #include "dev/drm/gamma_drv.h"
45
46 #define DRIVER_AUTHOR           "VA Linux Systems Inc."
47
48 #define DRIVER_NAME             "gamma"
49 #define DRIVER_DESC             "3DLabs gamma"
50 #define DRIVER_DATE             "20010216"
51
52 #define DRIVER_MAJOR            1
53 #define DRIVER_MINOR            0
54 #define DRIVER_PATCHLEVEL       0
55
56 #define DRIVER_IOCTLS                                                     \
57         [DRM_IOCTL_NR(DRM_IOCTL_DMA)]        = { gamma_dma,       1, 0 }
58
59 #ifdef __FreeBSD__
60 /* List acquired from xc/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h
61  * Please report to eanholt@gladstone.uoregon.edu if your chip isn't
62  * represented in the list or if the information is incorrect.
63  */
64 drm_chipinfo_t DRM(devicelist)[] = {
65         {0x3d3d, 0x0008, 1, "3DLabs Gamma"},
66         {0, 0, 0, NULL}
67 };
68 #endif /* __FreeBSD__ */
69
70
71 #define __HAVE_COUNTERS         5
72 #define __HAVE_COUNTER6         _DRM_STAT_IRQ
73 #define __HAVE_COUNTER7         _DRM_STAT_DMA
74 #define __HAVE_COUNTER8         _DRM_STAT_PRIMARY
75 #define __HAVE_COUNTER9         _DRM_STAT_SPECIAL
76 #define __HAVE_COUNTER10        _DRM_STAT_MISSED
77
78
79 #include "dev/drm/drm_auth.h"
80 #include "dev/drm/drm_bufs.h"
81 #include "dev/drm/drm_context.h"
82 #include "dev/drm/drm_dma.h"
83 #include "dev/drm/drm_drawable.h"
84 #include "dev/drm/drm_drv.h"
85
86 #ifdef __linux__
87 #ifndef MODULE
88 /* DRM(options) is called by the kernel to parse command-line options
89  * passed via the boot-loader (e.g., LILO).  It calls the insmod option
90  * routine, drm_parse_drm.
91  */
92
93 /* JH- We have to hand expand the string ourselves because of the cpp.  If
94  * anyone can think of a way that we can fit into the __setup macro without
95  * changing it, then please send the solution my way.
96  */
97 static int __init gamma_options( char *str )
98 {
99         DRM(parse_options)( str );
100         return 1;
101 }
102
103 __setup( DRIVER_NAME "=", gamma_options );
104 #endif
105 #endif /* __linux__ */
106
107 #include "dev/drm/drm_fops.h"
108 #include "dev/drm/drm_init.h"
109 #include "dev/drm/drm_ioctl.h"
110 #include "dev/drm/drm_lists.h"
111 #include "dev/drm/drm_lock.h"
112 #include "dev/drm/drm_memory.h"
113 #ifdef __linux__
114 #include "dev/drm/drm_proc.h"
115 #endif /* __linux__ */
116 #include "dev/drm/drm_vm.h"
117 #ifdef __linux__
118 #include "dev/drm/drm_stub.h"
119 #endif /* __linux__ */
120 #ifdef __FreeBSD__
121 #include "dev/drm/drm_sysctl.h"
122
123 DRIVER_MODULE(gamma, pci, gamma_driver, gamma_devclass, 0, 0);
124 #endif /* __FreeBSD__ */