aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/radeon_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-11-10 06:16:34 -0500
committerDave Airlie <airlied@linux.ie>2005-11-10 06:16:34 -0500
commit22eae947bf76e236ba972f2f11cfd1b083b736ad (patch)
treee18a2cdfef9ac0f606eb249df4924fef5e7daebd /drivers/char/drm/radeon_drv.c
parent3b44f137b9a846c5452d9e6e1271b79b1dbcc942 (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/radeon_drv.c')
-rw-r--r--drivers/char/drm/radeon_drv.c57
1 files changed, 19 insertions, 38 deletions
diff --git a/drivers/char/drm/radeon_drv.c b/drivers/char/drm/radeon_drv.c
index ee49670d8162..999d74512362 100644
--- a/drivers/char/drm/radeon_drv.c
+++ b/drivers/char/drm/radeon_drv.c
@@ -42,30 +42,6 @@ int radeon_no_wb;
42MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n"); 42MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n");
43module_param_named(no_wb, radeon_no_wb, int, 0444); 43module_param_named(no_wb, radeon_no_wb, int, 0444);
44 44
45static int postinit(struct drm_device *dev, unsigned long flags)
46{
47 DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n",
48 DRIVER_NAME,
49 DRIVER_MAJOR,
50 DRIVER_MINOR,
51 DRIVER_PATCHLEVEL,
52 DRIVER_DATE, dev->primary.minor, pci_pretty_name(dev->pdev)
53 );
54 return 0;
55}
56
57static int version(drm_version_t * version)
58{
59 int len;
60
61 version->version_major = DRIVER_MAJOR;
62 version->version_minor = DRIVER_MINOR;
63 version->version_patchlevel = DRIVER_PATCHLEVEL;
64 DRM_COPY(version->name, DRIVER_NAME);
65 DRM_COPY(version->date, DRIVER_DATE);
66 DRM_COPY(version->desc, DRIVER_DESC);
67 return 0;
68}
69 45
70static struct pci_device_id pciidlist[] = { 46static struct pci_device_id pciidlist[] = {
71 radeon_PCI_IDS 47 radeon_PCI_IDS
@@ -77,23 +53,21 @@ static struct drm_driver driver = {
77 DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | 53 DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED |
78 DRIVER_IRQ_VBL, 54 DRIVER_IRQ_VBL,
79 .dev_priv_size = sizeof(drm_radeon_buf_priv_t), 55 .dev_priv_size = sizeof(drm_radeon_buf_priv_t),
80 .preinit = radeon_driver_preinit, 56 .load = radeon_driver_load,
81 .presetup = radeon_presetup, 57 .firstopen = radeon_driver_firstopen,
82 .postcleanup = radeon_driver_postcleanup, 58 .open = radeon_driver_open,
83 .prerelease = radeon_driver_prerelease, 59 .preclose = radeon_driver_preclose,
84 .pretakedown = radeon_driver_pretakedown, 60 .postclose = radeon_driver_postclose,
85 .open_helper = radeon_driver_open_helper, 61 .lastclose = radeon_driver_lastclose,
62 .unload = radeon_driver_unload,
86 .vblank_wait = radeon_driver_vblank_wait, 63 .vblank_wait = radeon_driver_vblank_wait,
87 .irq_preinstall = radeon_driver_irq_preinstall, 64 .irq_preinstall = radeon_driver_irq_preinstall,
88 .irq_postinstall = radeon_driver_irq_postinstall, 65 .irq_postinstall = radeon_driver_irq_postinstall,
89 .irq_uninstall = radeon_driver_irq_uninstall, 66 .irq_uninstall = radeon_driver_irq_uninstall,
90 .irq_handler = radeon_driver_irq_handler, 67 .irq_handler = radeon_driver_irq_handler,
91 .free_filp_priv = radeon_driver_free_filp_priv,
92 .reclaim_buffers = drm_core_reclaim_buffers, 68 .reclaim_buffers = drm_core_reclaim_buffers,
93 .get_map_ofs = drm_core_get_map_ofs, 69 .get_map_ofs = drm_core_get_map_ofs,
94 .get_reg_ofs = drm_core_get_reg_ofs, 70 .get_reg_ofs = drm_core_get_reg_ofs,
95 .postinit = postinit,
96 .version = version,
97 .ioctls = radeon_ioctls, 71 .ioctls = radeon_ioctls,
98 .dma_ioctl = radeon_cp_buffers, 72 .dma_ioctl = radeon_cp_buffers,
99 .fops = { 73 .fops = {
@@ -107,12 +81,19 @@ static struct drm_driver driver = {
107#ifdef CONFIG_COMPAT 81#ifdef CONFIG_COMPAT
108 .compat_ioctl = radeon_compat_ioctl, 82 .compat_ioctl = radeon_compat_ioctl,
109#endif 83#endif
110 } 84 },
111 , 85
112 .pci_driver = { 86 .pci_driver = {
113 .name = DRIVER_NAME, 87 .name = DRIVER_NAME,
114 .id_table = pciidlist, 88 .id_table = pciidlist,
115 } 89 },
90
91 .name = DRIVER_NAME,
92 .desc = DRIVER_DESC,
93 .date = DRIVER_DATE,
94 .major = DRIVER_MAJOR,
95 .minor = DRIVER_MINOR,
96 .patchlevel = DRIVER_PATCHLEVEL,
116}; 97};
117 98
118static int __init radeon_init(void) 99static int __init radeon_init(void)