diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/char/drm/i915_drv.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/char/drm/i915_drv.c')
-rw-r--r-- | drivers/char/drm/i915_drv.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/drivers/char/drm/i915_drv.c b/drivers/char/drm/i915_drv.c new file mode 100644 index 000000000000..002b7082e21b --- /dev/null +++ b/drivers/char/drm/i915_drv.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* i915_drv.c -- i830,i845,i855,i865,i915 driver -*- linux-c -*- | ||
2 | */ | ||
3 | |||
4 | /************************************************************************** | ||
5 | * | ||
6 | * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. | ||
7 | * All Rights Reserved. | ||
8 | * | ||
9 | **************************************************************************/ | ||
10 | |||
11 | #include "drmP.h" | ||
12 | #include "drm.h" | ||
13 | #include "i915_drm.h" | ||
14 | #include "i915_drv.h" | ||
15 | |||
16 | #include "drm_pciids.h" | ||
17 | |||
18 | int postinit( struct drm_device *dev, unsigned long flags ) | ||
19 | { | ||
20 | dev->counters += 4; | ||
21 | dev->types[6] = _DRM_STAT_IRQ; | ||
22 | dev->types[7] = _DRM_STAT_PRIMARY; | ||
23 | dev->types[8] = _DRM_STAT_SECONDARY; | ||
24 | dev->types[9] = _DRM_STAT_DMA; | ||
25 | |||
26 | DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", | ||
27 | DRIVER_NAME, | ||
28 | DRIVER_MAJOR, | ||
29 | DRIVER_MINOR, | ||
30 | DRIVER_PATCHLEVEL, | ||
31 | DRIVER_DATE, | ||
32 | dev->primary.minor, | ||
33 | pci_pretty_name(dev->pdev) | ||
34 | ); | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | static int version( drm_version_t *version ) | ||
39 | { | ||
40 | int len; | ||
41 | |||
42 | version->version_major = DRIVER_MAJOR; | ||
43 | version->version_minor = DRIVER_MINOR; | ||
44 | version->version_patchlevel = DRIVER_PATCHLEVEL; | ||
45 | DRM_COPY( version->name, DRIVER_NAME ); | ||
46 | DRM_COPY( version->date, DRIVER_DATE ); | ||
47 | DRM_COPY( version->desc, DRIVER_DESC ); | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | static struct pci_device_id pciidlist[] = { | ||
52 | i915_PCI_IDS | ||
53 | }; | ||
54 | |||
55 | extern drm_ioctl_desc_t i915_ioctls[]; | ||
56 | extern int i915_max_ioctl; | ||
57 | |||
58 | static struct drm_driver driver = { | ||
59 | .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | | ||
60 | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, | ||
61 | .pretakedown = i915_driver_pretakedown, | ||
62 | .prerelease = i915_driver_prerelease, | ||
63 | .irq_preinstall = i915_driver_irq_preinstall, | ||
64 | .irq_postinstall = i915_driver_irq_postinstall, | ||
65 | .irq_uninstall = i915_driver_irq_uninstall, | ||
66 | .irq_handler = i915_driver_irq_handler, | ||
67 | .reclaim_buffers = drm_core_reclaim_buffers, | ||
68 | .get_map_ofs = drm_core_get_map_ofs, | ||
69 | .get_reg_ofs = drm_core_get_reg_ofs, | ||
70 | .postinit = postinit, | ||
71 | .version = version, | ||
72 | .ioctls = i915_ioctls, | ||
73 | .fops = { | ||
74 | .owner = THIS_MODULE, | ||
75 | .open = drm_open, | ||
76 | .release = drm_release, | ||
77 | .ioctl = drm_ioctl, | ||
78 | .mmap = drm_mmap, | ||
79 | .poll = drm_poll, | ||
80 | .fasync = drm_fasync, | ||
81 | }, | ||
82 | .pci_driver = { | ||
83 | .name = DRIVER_NAME, | ||
84 | .id_table = pciidlist, | ||
85 | } | ||
86 | }; | ||
87 | |||
88 | static int __init i915_init(void) | ||
89 | { | ||
90 | driver.num_ioctls = i915_max_ioctl; | ||
91 | return drm_init(&driver); | ||
92 | } | ||
93 | |||
94 | static void __exit i915_exit(void) | ||
95 | { | ||
96 | drm_exit(&driver); | ||
97 | } | ||
98 | |||
99 | module_init(i915_init); | ||
100 | module_exit(i915_exit); | ||
101 | |||
102 | MODULE_AUTHOR( DRIVER_AUTHOR ); | ||
103 | MODULE_DESCRIPTION( DRIVER_DESC ); | ||
104 | MODULE_LICENSE("GPL and additional rights"); | ||