aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/tdfx_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/tdfx_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/tdfx_drv.c')
-rw-r--r--drivers/char/drm/tdfx_drv.c42
1 files changed, 11 insertions, 31 deletions
diff --git a/drivers/char/drm/tdfx_drv.c b/drivers/char/drm/tdfx_drv.c
index c275cbb6e9ce..baa4416032a8 100644
--- a/drivers/char/drm/tdfx_drv.c
+++ b/drivers/char/drm/tdfx_drv.c
@@ -36,31 +36,6 @@
36 36
37#include "drm_pciids.h" 37#include "drm_pciids.h"
38 38
39static int postinit(struct drm_device *dev, unsigned long flags)
40{
41 DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n",
42 DRIVER_NAME,
43 DRIVER_MAJOR,
44 DRIVER_MINOR,
45 DRIVER_PATCHLEVEL,
46 DRIVER_DATE, dev->primary.minor, pci_pretty_name(dev->pdev)
47 );
48 return 0;
49}
50
51static int version(drm_version_t * version)
52{
53 int len;
54
55 version->version_major = DRIVER_MAJOR;
56 version->version_minor = DRIVER_MINOR;
57 version->version_patchlevel = DRIVER_PATCHLEVEL;
58 DRM_COPY(version->name, DRIVER_NAME);
59 DRM_COPY(version->date, DRIVER_DATE);
60 DRM_COPY(version->desc, DRIVER_DESC);
61 return 0;
62}
63
64static struct pci_device_id pciidlist[] = { 39static struct pci_device_id pciidlist[] = {
65 tdfx_PCI_IDS 40 tdfx_PCI_IDS
66}; 41};
@@ -70,8 +45,6 @@ static struct drm_driver driver = {
70 .reclaim_buffers = drm_core_reclaim_buffers, 45 .reclaim_buffers = drm_core_reclaim_buffers,
71 .get_map_ofs = drm_core_get_map_ofs, 46 .get_map_ofs = drm_core_get_map_ofs,
72 .get_reg_ofs = drm_core_get_reg_ofs, 47 .get_reg_ofs = drm_core_get_reg_ofs,
73 .postinit = postinit,
74 .version = version,
75 .fops = { 48 .fops = {
76 .owner = THIS_MODULE, 49 .owner = THIS_MODULE,
77 .open = drm_open, 50 .open = drm_open,
@@ -80,11 +53,18 @@ static struct drm_driver driver = {
80 .mmap = drm_mmap, 53 .mmap = drm_mmap,
81 .poll = drm_poll, 54 .poll = drm_poll,
82 .fasync = drm_fasync, 55 .fasync = drm_fasync,
83 }, 56 },
84 .pci_driver = { 57 .pci_driver = {
85 .name = DRIVER_NAME, 58 .name = DRIVER_NAME,
86 .id_table = pciidlist, 59 .id_table = pciidlist,
87 } 60 },
61
62 .name = DRIVER_NAME,
63 .desc = DRIVER_DESC,
64 .date = DRIVER_DATE,
65 .major = DRIVER_MAJOR,
66 .minor = DRIVER_MINOR,
67 .patchlevel = DRIVER_PATCHLEVEL,
88}; 68};
89 69
90static int __init tdfx_init(void) 70static int __init tdfx_init(void)