diff options
-rw-r--r-- | linux-core/drmP.h | 4 | ||||
-rw-r--r-- | linux-core/drm_drv.c | 2 | ||||
-rw-r--r-- | linux/drmP.h | 4 | ||||
-rw-r--r-- | linux/drm_drv.h | 2 | ||||
-rw-r--r-- | shared-core/radeon_state.c | 8 | ||||
-rw-r--r-- | shared/radeon_state.c | 8 |
6 files changed, 28 insertions, 0 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 1be3375c..a7a0e32b 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 7a165d5c..8b07a298 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 1be3375c..a7a0e32b 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 7a165d5c..8b07a298 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 80c09584..cdbd7a8e 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 80c09584..cdbd7a8e 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; } |