summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shared-core/radeon_cp.c7
-rw-r--r--shared/radeon.h35
-rw-r--r--shared/radeon_cp.c7
3 files changed, 20 insertions, 29 deletions
diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c
index 7047a4b0..f7b99e8a 100644
--- a/shared-core/radeon_cp.c
+++ b/shared-core/radeon_cp.c
@@ -1398,9 +1398,10 @@ void radeon_do_release( drm_device_t *dev )
/* Disable *all* interrupts */
RADEON_WRITE( RADEON_GEN_INT_CNTL, 0 );
-
- /* Destroy agp heap ??? */
-/* radeon_mem_takedown( &(dev_priv->agp_heap) ); */
+
+ /* Free memory heap structures */
+ radeon_mem_takedown( &(dev_priv->agp_heap) );
+ radeon_mem_takedown( &(dev_priv->fb_heap) );
/* deallocate kernel resources */
radeon_do_cleanup_cp( dev );
diff --git a/shared/radeon.h b/shared/radeon.h
index d46b6d9c..2b5131a9 100644
--- a/shared/radeon.h
+++ b/shared/radeon.h
@@ -106,11 +106,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_RADEON_IRQ_WAIT)] = { radeon_irq_wait, 1, 0 },
-#define USE_IRQS 1
-#if USE_IRQS
-#define __HAVE_DMA_IRQ 1
-#define __HAVE_VBL_IRQ 1
-#define __HAVE_SHARED_IRQ 1
/* When a client dies:
* - Check for and clean up flipped page state
@@ -118,41 +113,35 @@
*
* DRM infrastructure takes care of reclaiming dma buffers.
*/
-#define DRIVER_PRERELEASE() do { \
+#define DRIVER_PRERELEASE() \
+do { \
if ( dev->dev_private ) { \
drm_radeon_private_t *dev_priv = dev->dev_private; \
if ( dev_priv->page_flipping ) { \
radeon_do_cleanup_pageflip( dev ); \
} \
radeon_mem_release( dev_priv->agp_heap ); \
+ radeon_mem_release( dev_priv->fb_heap ); \
} \
} while (0)
+/* When the last client dies, shut down the CP and free dev->dev_priv.
+ */
#define __HAVE_RELEASE 1
-#define DRIVER_RELEASE() do { \
- if ( dev->open_count == 1) \
+#define DRIVER_RELEASE() \
+do { \
+ if ( dev->open_count == 1) \
radeon_do_release( dev ); \
- } while (0)
-
-/* On unloading the module:
- * - Free memory heap structure
- * - Remove mappings made at startup and free dev_private.
- */
-#define DRIVER_PRETAKEDOWN() do { \
- if ( dev->dev_private ) { \
- drm_radeon_private_t *dev_priv = dev->dev_private; \
- radeon_mem_takedown( &(dev_priv->agp_heap) ); \
- radeon_do_cleanup_cp( dev ); \
- } \
} while (0)
-#else
-#define __HAVE_DMA_IRQ 0
-#endif
+
/* DMA customization:
*/
#define __HAVE_DMA 1
+#define __HAVE_DMA_IRQ 1
+#define __HAVE_VBL_IRQ 1
+#define __HAVE_SHARED_IRQ 1
/* Buffer customization:
diff --git a/shared/radeon_cp.c b/shared/radeon_cp.c
index 7047a4b0..f7b99e8a 100644
--- a/shared/radeon_cp.c
+++ b/shared/radeon_cp.c
@@ -1398,9 +1398,10 @@ void radeon_do_release( drm_device_t *dev )
/* Disable *all* interrupts */
RADEON_WRITE( RADEON_GEN_INT_CNTL, 0 );
-
- /* Destroy agp heap ??? */
-/* radeon_mem_takedown( &(dev_priv->agp_heap) ); */
+
+ /* Free memory heap structures */
+ radeon_mem_takedown( &(dev_priv->agp_heap) );
+ radeon_mem_takedown( &(dev_priv->fb_heap) );
/* deallocate kernel resources */
radeon_do_cleanup_cp( dev );