1 /* gamma.c -- 3dlabs GMX 2000 driver -*- linux-c -*-
2 * Created: Mon Jan 4 08:58:31 1999 by faith@precisioninsight.com
4 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
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:
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
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.
28 * Rickard E. (Rik) Faith <faith@valinux.com>
29 * Gareth Hughes <gareth@valinux.com>
35 #include <linux/config.h>
36 #endif /* __linux__ */
38 #include <sys/types.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"
46 #define DRIVER_AUTHOR "VA Linux Systems Inc."
48 #define DRIVER_NAME "gamma"
49 #define DRIVER_DESC "3DLabs gamma"
50 #define DRIVER_DATE "20010216"
52 #define DRIVER_MAJOR 1
53 #define DRIVER_MINOR 0
54 #define DRIVER_PATCHLEVEL 0
56 #define DRIVER_IOCTLS \
57 [DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { gamma_dma, 1, 0 }
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.
64 drm_chipinfo_t DRM(devicelist)[] = {
65 {0x3d3d, 0x0008, 1, "3DLabs Gamma"},
68 #endif /* __FreeBSD__ */
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
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"
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.
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.
97 static int __init gamma_options( char *str )
99 DRM(parse_options)( str );
103 __setup( DRIVER_NAME "=", gamma_options );
105 #endif /* __linux__ */
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"
114 #include "dev/drm/drm_proc.h"
115 #endif /* __linux__ */
116 #include "dev/drm/drm_vm.h"
118 #include "dev/drm/drm_stub.h"
119 #endif /* __linux__ */
121 #include "dev/drm/drm_sysctl.h"
123 DRIVER_MODULE(gamma, pci, gamma_driver, gamma_devclass, 0, 0);
124 #endif /* __FreeBSD__ */