diff options
author | Felix Kuehling <fxkuehl@gmx.de> | 2004-10-31 15:16:44 +0000 |
---|---|---|
committer | Felix Kuehling <fxkuehl@gmx.de> | 2004-10-31 15:16:44 +0000 |
commit | 5128542814215b26ed342e3a4ac2217606fe5e76 (patch) | |
tree | 28c7727811940e5285c41928b112ca059dcac67c | |
parent | 8264e2c8aa6b2811bca0e45c50ac3328d14bfbf7 (diff) |
Allow drivers to override reclaim_buffers in an OS-independent way by
passing drm_device_t* as first parameter, like in the BSD version.
-rw-r--r-- | linux-core/drmP.h | 4 | ||||
-rw-r--r-- | linux-core/drm_dma.c | 4 | ||||
-rw-r--r-- | linux-core/drm_fops.c | 2 | ||||
-rw-r--r-- | linux-core/i810_dma.c | 6 | ||||
-rw-r--r-- | linux-core/i810_drv.h | 2 | ||||
-rw-r--r-- | linux-core/i830_dma.c | 6 | ||||
-rw-r--r-- | linux-core/i830_drv.h | 2 | ||||
-rw-r--r-- | linux/drmP.h | 4 | ||||
-rw-r--r-- | linux/drm_dma.h | 4 | ||||
-rw-r--r-- | linux/drm_drv.h | 2 | ||||
-rw-r--r-- | linux/i810_dma.c | 6 | ||||
-rw-r--r-- | linux/i810_drv.h | 2 | ||||
-rw-r--r-- | linux/i830_dma.c | 6 | ||||
-rw-r--r-- | linux/i830_drv.h | 2 |
14 files changed, 20 insertions, 32 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h index b8d817ba..80c6c19e 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -536,7 +536,7 @@ struct drm_driver { void (*irq_preinstall) (struct drm_device * dev); void (*irq_postinstall) (struct drm_device * dev); void (*irq_uninstall) (struct drm_device * dev); - void (*reclaim_buffers) (struct file * filp); + void (*reclaim_buffers) (struct drm_device *dev, struct file * filp); unsigned long (*get_map_ofs) (drm_map_t * map); unsigned long (*get_reg_ofs) (struct drm_device * dev); void (*set_version) (struct drm_device * dev, drm_set_version_t * sv); @@ -866,7 +866,7 @@ extern int drm_order(unsigned long size); extern int drm_dma_setup(drm_device_t * dev); extern void drm_dma_takedown(drm_device_t * dev); extern void drm_free_buffer(drm_device_t * dev, drm_buf_t * buf); -extern void drm_core_reclaim_buffers(struct file *filp); +extern void drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp); /* IRQ support (drm_irq.h) */ extern int drm_control(struct inode *inode, struct file *filp, diff --git a/linux-core/drm_dma.c b/linux-core/drm_dma.c index cf7f404d..e7d9e826 100644 --- a/linux-core/drm_dma.c +++ b/linux-core/drm_dma.c @@ -154,10 +154,8 @@ void drm_free_buffer(drm_device_t * dev, drm_buf_t * buf) * * Frees each buffer associated with \p filp not already on the hardware. */ -void drm_core_reclaim_buffers(struct file *filp) +void drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->head->dev; drm_device_dma_t *dma = dev->dma; int i; diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c index 1209a8ab..27da405c 100644 --- a/linux-core/drm_fops.c +++ b/linux-core/drm_fops.c @@ -393,7 +393,7 @@ int drm_release(struct inode *inode, struct file *filp) } if (drm_core_check_feature(dev, DRIVER_HAVE_DMA)) { - dev->driver->reclaim_buffers(filp); + dev->driver->reclaim_buffers(dev, filp); } drm_fasync(-1, filp, 0); diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c index 81551be8..e9831352 100644 --- a/linux-core/i810_dma.c +++ b/linux-core/i810_dma.c @@ -972,10 +972,8 @@ static int i810_flush_queue(drm_device_t * dev) } /* Must be called with the lock held */ -void i810_reclaim_buffers(struct file *filp) +void i810_reclaim_buffers(drm_device_t *dev, struct file *filp) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->head->dev; drm_device_dma_t *dma = dev->dma; int i; @@ -1366,7 +1364,7 @@ void i810_driver_pretakedown(drm_device_t * dev) void i810_driver_release(drm_device_t * dev, struct file *filp) { - i810_reclaim_buffers(filp); + i810_reclaim_buffers(dev, filp); } int i810_driver_dma_quiescent(drm_device_t * dev) diff --git a/linux-core/i810_drv.h b/linux-core/i810_drv.h index e09ffe92..76f2749c 100644 --- a/linux-core/i810_drv.h +++ b/linux-core/i810_drv.h @@ -121,7 +121,7 @@ extern int i810_dma_init(struct inode *inode, struct file *filp, extern int i810_dma_cleanup(drm_device_t * dev); extern int i810_flush_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void i810_reclaim_buffers(struct file *filp); +extern void i810_reclaim_buffers(drm_device_t *dev, struct file *filp); extern int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma); diff --git a/linux-core/i830_dma.c b/linux-core/i830_dma.c index a753ffd8..c2a003ee 100644 --- a/linux-core/i830_dma.c +++ b/linux-core/i830_dma.c @@ -1252,10 +1252,8 @@ static int i830_flush_queue(drm_device_t * dev) } /* Must be called with the lock held */ -void i830_reclaim_buffers(struct file *filp) +void i830_reclaim_buffers(drm_device_t *dev, struct file *filp) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->head->dev; drm_device_dma_t *dma = dev->dma; int i; @@ -1556,7 +1554,7 @@ void i830_driver_pretakedown(drm_device_t * dev) void i830_driver_release(drm_device_t * dev, struct file *filp) { - i830_reclaim_buffers(filp); + i830_reclaim_buffers(dev, filp); } int i830_driver_dma_quiescent(drm_device_t * dev) diff --git a/linux-core/i830_drv.h b/linux-core/i830_drv.h index 91f11a72..d520bba4 100644 --- a/linux-core/i830_drv.h +++ b/linux-core/i830_drv.h @@ -129,7 +129,7 @@ extern int i830_dma_init(struct inode *inode, struct file *filp, extern int i830_dma_cleanup(drm_device_t * dev); extern int i830_flush_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void i830_reclaim_buffers(struct file *filp); +extern void i830_reclaim_buffers(drm_device_t *dev, struct file *filp); extern int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma); diff --git a/linux/drmP.h b/linux/drmP.h index 6717d2c9..4d136bf5 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -528,7 +528,7 @@ struct drm_driver_fn { void (*irq_preinstall)(struct drm_device *dev); void (*irq_postinstall)(struct drm_device *dev); void (*irq_uninstall)(struct drm_device *dev); - void (*reclaim_buffers)(struct file *filp); + void (*reclaim_buffers)(struct drm_device *dev, struct file *filp); unsigned long (*get_map_ofs)(drm_map_t *map); unsigned long (*get_reg_ofs)(struct drm_device *dev); void (*set_version)(struct drm_device *dev, drm_set_version_t *sv); @@ -870,7 +870,7 @@ extern int DRM(mapbufs)( struct inode *inode, struct file *filp, extern int DRM(dma_setup)(drm_device_t *dev); extern void DRM(dma_takedown)(drm_device_t *dev); extern void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf); -extern void DRM(reclaim_buffers)( struct file *filp ); +extern void DRM(core_reclaim_buffers)(drm_device_t *dev, struct file *filp); /* IRQ support (drm_irq.h) */ extern int DRM(control)( struct inode *inode, struct file *filp, diff --git a/linux/drm_dma.h b/linux/drm_dma.h index 5cbdc931..dbf38dbf 100644 --- a/linux/drm_dma.h +++ b/linux/drm_dma.h @@ -154,10 +154,8 @@ void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf) * * Frees each buffer associated with \p filp not already on the hardware. */ -void DRM(core_reclaim_buffers)( struct file *filp ) +void DRM(core_reclaim_buffers)( drm_device_t *dev, struct file *filp ) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; drm_device_dma_t *dma = dev->dma; int i; diff --git a/linux/drm_drv.h b/linux/drm_drv.h index 39b6a755..6e8a9ea5 100644 --- a/linux/drm_drv.h +++ b/linux/drm_drv.h @@ -857,7 +857,7 @@ int DRM(release)( struct inode *inode, struct file *filp ) if (drm_core_check_feature(dev, DRIVER_HAVE_DMA)) { - dev->fn_tbl.reclaim_buffers(filp); + dev->fn_tbl.reclaim_buffers(dev, filp); } DRM(fasync)( -1, filp, 0 ); diff --git a/linux/i810_dma.c b/linux/i810_dma.c index 5d2165c6..621be7a9 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -996,10 +996,8 @@ static int i810_flush_queue(drm_device_t *dev) } /* Must be called with the lock held */ -void i810_reclaim_buffers(struct file *filp) +void i810_reclaim_buffers(drm_device_t *dev, struct file *filp) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; drm_device_dma_t *dma = dev->dma; int i; @@ -1395,7 +1393,7 @@ static void i810_driver_pretakedown(drm_device_t *dev) static void i810_driver_release(drm_device_t *dev, struct file *filp) { - i810_reclaim_buffers(filp); + i810_reclaim_buffers(dev, filp); } static int i810_driver_dma_quiescent(drm_device_t *dev) diff --git a/linux/i810_drv.h b/linux/i810_drv.h index 67c5c88b..6578d3b5 100644 --- a/linux/i810_drv.h +++ b/linux/i810_drv.h @@ -99,7 +99,7 @@ extern int i810_dma_init(struct inode *inode, struct file *filp, extern int i810_dma_cleanup(drm_device_t *dev); extern int i810_flush_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void i810_reclaim_buffers(struct file *filp); +extern void i810_reclaim_buffers(drm_device_t *dev, struct file *filp); extern int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma); diff --git a/linux/i830_dma.c b/linux/i830_dma.c index 1ce2a357..caae802f 100644 --- a/linux/i830_dma.c +++ b/linux/i830_dma.c @@ -1285,10 +1285,8 @@ static int i830_flush_queue(drm_device_t *dev) } /* Must be called with the lock held */ -void i830_reclaim_buffers( struct file *filp ) +void i830_reclaim_buffers( drm_device_t *dev, struct file *filp ) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; drm_device_dma_t *dma = dev->dma; int i; @@ -1590,7 +1588,7 @@ static void i830_driver_pretakedown(drm_device_t *dev) static void i830_driver_release(drm_device_t *dev, struct file *filp) { - i830_reclaim_buffers(filp); + i830_reclaim_buffers(dev, filp); } static int i830_driver_dma_quiescent(drm_device_t *dev) diff --git a/linux/i830_drv.h b/linux/i830_drv.h index c3cab2d8..4e684ce8 100644 --- a/linux/i830_drv.h +++ b/linux/i830_drv.h @@ -99,7 +99,7 @@ extern int i830_dma_init(struct inode *inode, struct file *filp, extern int i830_dma_cleanup(drm_device_t *dev); extern int i830_flush_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void i830_reclaim_buffers(struct file *filp); +extern void i830_reclaim_buffers(drm_device_t *dev, struct file *filp); extern int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma); |