summaryrefslogtreecommitdiff
path: root/linux-core/i830_dma.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-08-05 03:50:23 +0000
committerEric Anholt <anholt@freebsd.org>2005-08-05 03:50:23 +0000
commitc789ea1521ac9e935f2a1c6c043619d89bae9c16 (patch)
treebb8bcecf000f78f71db8dc70484d7ea82cc0b260 /linux-core/i830_dma.c
parent143622a987745ca2084f7a188e9993ffd5f28fe3 (diff)
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)
Diffstat (limited to 'linux-core/i830_dma.c')
-rw-r--r--linux-core/i830_dma.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/linux-core/i830_dma.c b/linux-core/i830_dma.c
index 10d9dff6..1c44f70d 100644
--- a/linux-core/i830_dma.c
+++ b/linux-core/i830_dma.c
@@ -1524,12 +1524,24 @@ static int i830_setparam(struct inode *inode, struct file *filp,
return 0;
}
-void i830_driver_pretakedown(drm_device_t * dev)
+int i830_driver_load(drm_device_t *dev, unsigned long flags)
+{
+ /* i830 has 4 more counters */
+ dev->counters += 4;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
+ dev->types[9] = _DRM_STAT_DMA;
+
+ return 0;
+}
+
+void i830_driver_lastclose(drm_device_t * dev)
{
i830_dma_cleanup(dev);
}
-void i830_driver_prerelease(drm_device_t * dev, DRMFILE filp)
+void i830_driver_preclose(drm_device_t * dev, DRMFILE filp)
{
if (dev->dev_private) {
drm_i830_private_t *dev_priv = dev->dev_private;
@@ -1539,7 +1551,7 @@ void i830_driver_prerelease(drm_device_t * dev, DRMFILE filp)
}
}
-void i830_driver_release(drm_device_t * dev, struct file *filp)
+void i830_driver_reclaim_buffers_locked(drm_device_t * dev, struct file *filp)
{
i830_reclaim_buffers(dev, filp);
}