aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/i915_dma.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/i915_dma.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/i915_dma.c')
-rw-r--r--drivers/char/drm/i915_dma.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c
index f3aa0c370127..9ef3be31a812 100644
--- a/drivers/char/drm/i915_dma.c
+++ b/drivers/char/drm/i915_dma.c
@@ -699,7 +699,19 @@ static int i915_setparam(DRM_IOCTL_ARGS)
699 return 0; 699 return 0;
700} 700}
701 701
702void i915_driver_pretakedown(drm_device_t * dev) 702int i915_driver_load(drm_device_t *dev, unsigned long flags)
703{
704 /* i915 has 4 more counters */
705 dev->counters += 4;
706 dev->types[6] = _DRM_STAT_IRQ;
707 dev->types[7] = _DRM_STAT_PRIMARY;
708 dev->types[8] = _DRM_STAT_SECONDARY;
709 dev->types[9] = _DRM_STAT_DMA;
710
711 return 0;
712}
713
714void i915_driver_lastclose(drm_device_t * dev)
703{ 715{
704 if (dev->dev_private) { 716 if (dev->dev_private) {
705 drm_i915_private_t *dev_priv = dev->dev_private; 717 drm_i915_private_t *dev_priv = dev->dev_private;
@@ -708,7 +720,7 @@ void i915_driver_pretakedown(drm_device_t * dev)
708 i915_dma_cleanup(dev); 720 i915_dma_cleanup(dev);
709} 721}
710 722
711void i915_driver_prerelease(drm_device_t * dev, DRMFILE filp) 723void i915_driver_preclose(drm_device_t * dev, DRMFILE filp)
712{ 724{
713 if (dev->dev_private) { 725 if (dev->dev_private) {
714 drm_i915_private_t *dev_priv = dev->dev_private; 726 drm_i915_private_t *dev_priv = dev->dev_private;