diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-11-10 06:16:34 -0500 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-11-10 06:16:34 -0500 |
commit | 22eae947bf76e236ba972f2f11cfd1b083b736ad (patch) | |
tree | e18a2cdfef9ac0f606eb249df4924fef5e7daebd /drivers/char/drm/i915_drv.c | |
parent | 3b44f137b9a846c5452d9e6e1271b79b1dbcc942 (diff) |
drm: rename driver hooks more understandably
Rename the driver hooks in the DRM to something a little more understandable:
preinit -> load
postinit -> (removed)
presetup -> firstopen
postsetup -> (removed)
open_helper -> open
prerelease -> preclose
free_filp_priv -> postclose
pretakedown -> lastclose
postcleanup -> unload
release -> reclaim_buffers_locked
version -> (removed)
postinit and version were replaced with generic code in the Linux DRM (drivers
now set their version numbers and description in the driver structure, like on
BSD). postsetup wasn't used at all. Fixes the savage hooks for
initializing and tearing down mappings at the right times. Testing involved at
least starting X, running glxgears, killing glxgears, exiting X, and repeating.
Tested on: FreeBSD (g200, g400, r200, r128)
Linux (r200, savage4)
From: Eric Anholt <anholt@freebsd.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/i915_drv.c')
-rw-r--r-- | drivers/char/drm/i915_drv.c | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/drivers/char/drm/i915_drv.c b/drivers/char/drm/i915_drv.c index 0508240f4e3b..32b7f8bb420d 100644 --- a/drivers/char/drm/i915_drv.c +++ b/drivers/char/drm/i915_drv.c | |||
@@ -34,37 +34,6 @@ | |||
34 | 34 | ||
35 | #include "drm_pciids.h" | 35 | #include "drm_pciids.h" |
36 | 36 | ||
37 | static int postinit(struct drm_device *dev, unsigned long flags) | ||
38 | { | ||
39 | dev->counters += 4; | ||
40 | dev->types[6] = _DRM_STAT_IRQ; | ||
41 | dev->types[7] = _DRM_STAT_PRIMARY; | ||
42 | dev->types[8] = _DRM_STAT_SECONDARY; | ||
43 | dev->types[9] = _DRM_STAT_DMA; | ||
44 | |||
45 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n", | ||
46 | DRIVER_NAME, | ||
47 | DRIVER_MAJOR, | ||
48 | DRIVER_MINOR, | ||
49 | DRIVER_PATCHLEVEL, | ||
50 | DRIVER_DATE, dev->primary.minor, pci_pretty_name(dev->pdev) | ||
51 | ); | ||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | static int version(drm_version_t * version) | ||
56 | { | ||
57 | int len; | ||
58 | |||
59 | version->version_major = DRIVER_MAJOR; | ||
60 | version->version_minor = DRIVER_MINOR; | ||
61 | version->version_patchlevel = DRIVER_PATCHLEVEL; | ||
62 | DRM_COPY(version->name, DRIVER_NAME); | ||
63 | DRM_COPY(version->date, DRIVER_DATE); | ||
64 | DRM_COPY(version->desc, DRIVER_DESC); | ||
65 | return 0; | ||
66 | } | ||
67 | |||
68 | static struct pci_device_id pciidlist[] = { | 37 | static struct pci_device_id pciidlist[] = { |
69 | i915_PCI_IDS | 38 | i915_PCI_IDS |
70 | }; | 39 | }; |
@@ -73,8 +42,9 @@ static struct drm_driver driver = { | |||
73 | .driver_features = | 42 | .driver_features = |
74 | DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | | 43 | DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | |
75 | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, | 44 | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, |
76 | .pretakedown = i915_driver_pretakedown, | 45 | .load = i915_driver_load, |
77 | .prerelease = i915_driver_prerelease, | 46 | .lastclose = i915_driver_lastclose, |
47 | .preclose = i915_driver_preclose, | ||
78 | .device_is_agp = i915_driver_device_is_agp, | 48 | .device_is_agp = i915_driver_device_is_agp, |
79 | .irq_preinstall = i915_driver_irq_preinstall, | 49 | .irq_preinstall = i915_driver_irq_preinstall, |
80 | .irq_postinstall = i915_driver_irq_postinstall, | 50 | .irq_postinstall = i915_driver_irq_postinstall, |
@@ -83,8 +53,6 @@ static struct drm_driver driver = { | |||
83 | .reclaim_buffers = drm_core_reclaim_buffers, | 53 | .reclaim_buffers = drm_core_reclaim_buffers, |
84 | .get_map_ofs = drm_core_get_map_ofs, | 54 | .get_map_ofs = drm_core_get_map_ofs, |
85 | .get_reg_ofs = drm_core_get_reg_ofs, | 55 | .get_reg_ofs = drm_core_get_reg_ofs, |
86 | .postinit = postinit, | ||
87 | .version = version, | ||
88 | .ioctls = i915_ioctls, | 56 | .ioctls = i915_ioctls, |
89 | .fops = { | 57 | .fops = { |
90 | .owner = THIS_MODULE, | 58 | .owner = THIS_MODULE, |
@@ -97,11 +65,19 @@ static struct drm_driver driver = { | |||
97 | #ifdef CONFIG_COMPAT | 65 | #ifdef CONFIG_COMPAT |
98 | .compat_ioctl = i915_compat_ioctl, | 66 | .compat_ioctl = i915_compat_ioctl, |
99 | #endif | 67 | #endif |
100 | }, | 68 | }, |
69 | |||
101 | .pci_driver = { | 70 | .pci_driver = { |
102 | .name = DRIVER_NAME, | 71 | .name = DRIVER_NAME, |
103 | .id_table = pciidlist, | 72 | .id_table = pciidlist, |
104 | } | 73 | }, |
74 | |||
75 | .name = DRIVER_NAME, | ||
76 | .desc = DRIVER_DESC, | ||
77 | .date = DRIVER_DATE, | ||
78 | .major = DRIVER_MAJOR, | ||
79 | .minor = DRIVER_MINOR, | ||
80 | .patchlevel = DRIVER_PATCHLEVEL, | ||
105 | }; | 81 | }; |
106 | 82 | ||
107 | static int __init i915_init(void) | 83 | static int __init i915_init(void) |