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/i810_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/i810_drv.c')
-rw-r--r-- | drivers/char/drm/i810_drv.c | 59 |
1 files changed, 16 insertions, 43 deletions
diff --git a/drivers/char/drm/i810_drv.c b/drivers/char/drm/i810_drv.c index 070cef6c2b46..e73b731c3be9 100644 --- a/drivers/char/drm/i810_drv.c +++ b/drivers/char/drm/i810_drv.c | |||
@@ -38,38 +38,6 @@ | |||
38 | 38 | ||
39 | #include "drm_pciids.h" | 39 | #include "drm_pciids.h" |
40 | 40 | ||
41 | static int postinit(struct drm_device *dev, unsigned long flags) | ||
42 | { | ||
43 | /* i810 has 4 more counters */ | ||
44 | dev->counters += 4; | ||
45 | dev->types[6] = _DRM_STAT_IRQ; | ||
46 | dev->types[7] = _DRM_STAT_PRIMARY; | ||
47 | dev->types[8] = _DRM_STAT_SECONDARY; | ||
48 | dev->types[9] = _DRM_STAT_DMA; | ||
49 | |||
50 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n", | ||
51 | DRIVER_NAME, | ||
52 | DRIVER_MAJOR, | ||
53 | DRIVER_MINOR, | ||
54 | DRIVER_PATCHLEVEL, | ||
55 | DRIVER_DATE, dev->primary.minor, pci_pretty_name(dev->pdev) | ||
56 | ); | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | static int version(drm_version_t * version) | ||
61 | { | ||
62 | int len; | ||
63 | |||
64 | version->version_major = DRIVER_MAJOR; | ||
65 | version->version_minor = DRIVER_MINOR; | ||
66 | version->version_patchlevel = DRIVER_PATCHLEVEL; | ||
67 | DRM_COPY(version->name, DRIVER_NAME); | ||
68 | DRM_COPY(version->date, DRIVER_DATE); | ||
69 | DRM_COPY(version->desc, DRIVER_DESC); | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static struct pci_device_id pciidlist[] = { | 41 | static struct pci_device_id pciidlist[] = { |
74 | i810_PCI_IDS | 42 | i810_PCI_IDS |
75 | }; | 43 | }; |
@@ -79,16 +47,15 @@ static struct drm_driver driver = { | |||
79 | DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | | 47 | DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | |
80 | DRIVER_HAVE_DMA | DRIVER_DMA_QUEUE, | 48 | DRIVER_HAVE_DMA | DRIVER_DMA_QUEUE, |
81 | .dev_priv_size = sizeof(drm_i810_buf_priv_t), | 49 | .dev_priv_size = sizeof(drm_i810_buf_priv_t), |
82 | .pretakedown = i810_driver_pretakedown, | 50 | .load = i810_driver_load, |
83 | .prerelease = i810_driver_prerelease, | 51 | .lastclose = i810_driver_lastclose, |
52 | .preclose = i810_driver_preclose, | ||
84 | .device_is_agp = i810_driver_device_is_agp, | 53 | .device_is_agp = i810_driver_device_is_agp, |
85 | .release = i810_driver_release, | 54 | .reclaim_buffers_locked = i810_driver_reclaim_buffers_locked, |
86 | .dma_quiescent = i810_driver_dma_quiescent, | 55 | .dma_quiescent = i810_driver_dma_quiescent, |
87 | .reclaim_buffers = i810_reclaim_buffers, | 56 | .reclaim_buffers = i810_reclaim_buffers, |
88 | .get_map_ofs = drm_core_get_map_ofs, | 57 | .get_map_ofs = drm_core_get_map_ofs, |
89 | .get_reg_ofs = drm_core_get_reg_ofs, | 58 | .get_reg_ofs = drm_core_get_reg_ofs, |
90 | .postinit = postinit, | ||
91 | .version = version, | ||
92 | .ioctls = i810_ioctls, | 59 | .ioctls = i810_ioctls, |
93 | .fops = { | 60 | .fops = { |
94 | .owner = THIS_MODULE, | 61 | .owner = THIS_MODULE, |
@@ -98,13 +65,19 @@ static struct drm_driver driver = { | |||
98 | .mmap = drm_mmap, | 65 | .mmap = drm_mmap, |
99 | .poll = drm_poll, | 66 | .poll = drm_poll, |
100 | .fasync = drm_fasync, | 67 | .fasync = drm_fasync, |
101 | } | 68 | }, |
102 | , | 69 | |
103 | .pci_driver = { | 70 | .pci_driver = { |
104 | .name = DRIVER_NAME, | 71 | .name = DRIVER_NAME, |
105 | .id_table = pciidlist, | 72 | .id_table = pciidlist, |
106 | } | 73 | }, |
107 | , | 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, | ||
108 | }; | 81 | }; |
109 | 82 | ||
110 | static int __init i810_init(void) | 83 | static int __init i810_init(void) |