summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2004-08-19 12:26:12 +0000
committerDave Airlie <airlied@linux.ie>2004-08-19 12:26:12 +0000
commit6978e5afbd8197fe0d9269bfe4177ea80f682fd9 (patch)
treefaef87dfbac48d8e22a5f0c49dd0697c204f034a
parent8a39241a1d85be8c1ac51a23bbd6b3ce1702cea2 (diff)
add free filp private pointer to cleanup after open_helperdrmfntbl-0-0-2-20040824-freeze
-rw-r--r--linux-core/drmP.h4
-rw-r--r--linux-core/drm_drv.c2
-rw-r--r--linux/drmP.h4
-rw-r--r--linux/drm_drv.h2
-rw-r--r--shared-core/radeon_state.c8
-rw-r--r--shared/radeon_state.c8
6 files changed, 28 insertions, 0 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 1be3375cd..a7a0e32b3 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -517,7 +517,11 @@ struct drm_driver_fn {
int (*postcleanup)(struct drm_device *);
int (*presetup)(struct drm_device *);
int (*postsetup)(struct drm_device *);
+
+ /* these are opposites at the moment */
int (*open_helper)(struct drm_device *, drm_file_t *);
+ void (*free_filp_private)(struct drm_device *, drm_file_t *);
+
void (*release)(struct drm_device *, struct file *filp);
void (*dma_ready)(struct drm_device *);
int (*dma_quiescent)(struct drm_device *);
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 7a165d5c3..8b07a298c 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -941,6 +941,8 @@ int DRM(release)( struct inode *inode, struct file *filp )
}
up( &dev->struct_sem );
+ if (dev->fn_tbl.free_filp_private)
+ dev->fn_tbl.free_filp_private( dev, priv );
DRM(free)( priv, sizeof(*priv), DRM_MEM_FILES );
/* ========================================================
diff --git a/linux/drmP.h b/linux/drmP.h
index 1be3375cd..a7a0e32b3 100644
--- a/linux/drmP.h
+++ b/linux/drmP.h
@@ -517,7 +517,11 @@ struct drm_driver_fn {
int (*postcleanup)(struct drm_device *);
int (*presetup)(struct drm_device *);
int (*postsetup)(struct drm_device *);
+
+ /* these are opposites at the moment */
int (*open_helper)(struct drm_device *, drm_file_t *);
+ void (*free_filp_private)(struct drm_device *, drm_file_t *);
+
void (*release)(struct drm_device *, struct file *filp);
void (*dma_ready)(struct drm_device *);
int (*dma_quiescent)(struct drm_device *);
diff --git a/linux/drm_drv.h b/linux/drm_drv.h
index 7a165d5c3..8b07a298c 100644
--- a/linux/drm_drv.h
+++ b/linux/drm_drv.h
@@ -941,6 +941,8 @@ int DRM(release)( struct inode *inode, struct file *filp )
}
up( &dev->struct_sem );
+ if (dev->fn_tbl.free_filp_private)
+ dev->fn_tbl.free_filp_private( dev, priv );
DRM(free)( priv, sizeof(*priv), DRM_MEM_FILES );
/* ========================================================
diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c
index 80c095847..cdbd7a8ea 100644
--- a/shared-core/radeon_state.c
+++ b/shared-core/radeon_state.c
@@ -2595,6 +2595,13 @@ static int radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv)
return 0;
}
+static void radeon_driver_free_filp_private(drm_device_t *dev, drm_file_t *filp_priv)
+{
+ struct drm_radeon_driver_file_fields *radeon_priv = filp_priv->driver_priv;
+
+ DRM(free)(radeon_priv, sizeof(*radeon_priv), DRM_MEM_FILES);
+}
+
void radeon_driver_register_fns(struct drm_device *dev)
{
dev->driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL;
@@ -2610,4 +2617,5 @@ void radeon_driver_register_fns(struct drm_device *dev)
dev->fn_tbl.irq_postinstall = radeon_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = radeon_driver_irq_uninstall;
dev->fn_tbl.irq_handler = radeon_driver_irq_handler;
+ dev->fn_tbl.free_filp_private = radeon_driver_free_filp_private;
}
diff --git a/shared/radeon_state.c b/shared/radeon_state.c
index 80c095847..cdbd7a8ea 100644
--- a/shared/radeon_state.c
+++ b/shared/radeon_state.c
@@ -2595,6 +2595,13 @@ static int radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv)
return 0;
}
+static void radeon_driver_free_filp_private(drm_device_t *dev, drm_file_t *filp_priv)
+{
+ struct drm_radeon_driver_file_fields *radeon_priv = filp_priv->driver_priv;
+
+ DRM(free)(radeon_priv, sizeof(*radeon_priv), DRM_MEM_FILES);
+}
+
void radeon_driver_register_fns(struct drm_device *dev)
{
dev->driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL;
@@ -2610,4 +2617,5 @@ void radeon_driver_register_fns(struct drm_device *dev)
dev->fn_tbl.irq_postinstall = radeon_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = radeon_driver_irq_uninstall;
dev->fn_tbl.irq_handler = radeon_driver_irq_handler;
+ dev->fn_tbl.free_filp_private = radeon_driver_free_filp_private;
}