summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/drm_drv.c58
-rw-r--r--linux-core/i810_dma.c7
-rw-r--r--linux-core/i830_dma.c5
-rw-r--r--linux-core/savage_drv.c5
-rw-r--r--linux/drm_drv.h58
-rw-r--r--linux/i810.h6
-rw-r--r--linux/i810_dma.c7
-rw-r--r--linux/i830.h6
-rw-r--r--linux/i830_dma.c5
-rw-r--r--linux/savage_drv.c5
-rw-r--r--shared-core/i915_dma.c6
-rw-r--r--shared-core/mga_dma.c5
-rw-r--r--shared-core/via_drv.c2
-rw-r--r--shared/i915.h6
-rw-r--r--shared/i915_dma.c6
-rw-r--r--shared/mga.h5
-rw-r--r--shared/mga_dma.c5
-rw-r--r--shared/sis.h2
-rw-r--r--shared/via_drv.c2
19 files changed, 74 insertions, 127 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index f0485ea7..0e5524f4 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -52,10 +52,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef __HAVE_COUNTERS
-#define __HAVE_COUNTERS 0
-#endif
-
#ifndef DRIVER_IOCTLS
#define DRIVER_IOCTLS
#endif
@@ -180,42 +176,7 @@ static int DRM(setup)( drm_device_t *dev )
if ( i < 0 )
return i;
}
-
- dev->counters = 6 + __HAVE_COUNTERS;
- dev->types[0] = _DRM_STAT_LOCK;
- dev->types[1] = _DRM_STAT_OPENS;
- dev->types[2] = _DRM_STAT_CLOSES;
- dev->types[3] = _DRM_STAT_IOCTLS;
- dev->types[4] = _DRM_STAT_LOCKS;
- dev->types[5] = _DRM_STAT_UNLOCKS;
-#ifdef __HAVE_COUNTER6
- dev->types[6] = __HAVE_COUNTER6;
-#endif
-#ifdef __HAVE_COUNTER7
- dev->types[7] = __HAVE_COUNTER7;
-#endif
-#ifdef __HAVE_COUNTER8
- dev->types[8] = __HAVE_COUNTER8;
-#endif
-#ifdef __HAVE_COUNTER9
- dev->types[9] = __HAVE_COUNTER9;
-#endif
-#ifdef __HAVE_COUNTER10
- dev->types[10] = __HAVE_COUNTER10;
-#endif
-#ifdef __HAVE_COUNTER11
- dev->types[11] = __HAVE_COUNTER11;
-#endif
-#ifdef __HAVE_COUNTER12
- dev->types[12] = __HAVE_COUNTER12;
-#endif
-#ifdef __HAVE_COUNTER13
- dev->types[13] = __HAVE_COUNTER13;
-#endif
-#ifdef __HAVE_COUNTER14
- dev->types[14] = __HAVE_COUNTER14;
-#endif
-
+
for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )
atomic_set( &dev->counts[i], 0 );
@@ -461,7 +422,16 @@ int DRM(fill_in_dev)(drm_device_t *dev, struct pci_dev *pdev, const struct pci_d
/* dev_priv_size can be changed by a driver in driver_register_fns */
dev->dev_priv_size = sizeof(u32);
- DRM(init_fn_table)(dev);
+ /* the DRM has 6 counters */
+ dev->counters = 6;
+ dev->types[0] = _DRM_STAT_LOCK;
+ dev->types[1] = _DRM_STAT_OPENS;
+ dev->types[2] = _DRM_STAT_CLOSES;
+ dev->types[3] = _DRM_STAT_IOCTLS;
+ dev->types[4] = _DRM_STAT_LOCKS;
+ dev->types[5] = _DRM_STAT_UNLOCKS;
+
+ DRM(init_fn_table)(dev);
DRM(driver_register_fns)(dev);
@@ -489,8 +459,8 @@ int DRM(fill_in_dev)(drm_device_t *dev, struct pci_dev *pdev, const struct pci_d
retcode = DRM(ctxbitmap_init)( dev );
if( retcode ) {
- DRM_ERROR( "Cannot allocate memory for context bitmap.\n" );
- goto error_out_unreg;
+ DRM_ERROR( "Cannot allocate memory for context bitmap.\n" );
+ goto error_out_unreg;
}
dev->device = MKDEV(DRM_MAJOR, dev->minor );
@@ -905,7 +875,7 @@ int DRM(release)( struct inode *inode, struct file *filp )
list_del( &pos->head );
DRM(free)( pos, sizeof(*pos), DRM_MEM_CTXLIST );
- --dev->ctx_count;
+ --dev->ctx_count;
}
}
}
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index 43c044c0..0c828850 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -1417,5 +1417,12 @@ void i810_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.release = i810_driver_release;
dev->fn_tbl.dma_quiescent = i810_driver_dma_quiescent;
dev->fn_tbl.reclaim_buffers = i810_reclaim_buffers;
+
+ /* i810 has 4 more counters */
+ dev->counters += 4;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
+ dev->types[9] = _DRM_STAT_DMA;
}
diff --git a/linux-core/i830_dma.c b/linux-core/i830_dma.c
index ac12b6dd..f39611c0 100644
--- a/linux-core/i830_dma.c
+++ b/linux-core/i830_dma.c
@@ -1621,5 +1621,10 @@ void i830_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_uninstall = i830_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i830_driver_irq_handler;
#endif
+ dev->counters += 4;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
+ dev->types[9] = _DRM_STAT_DMA;
}
diff --git a/linux-core/savage_drv.c b/linux-core/savage_drv.c
index 481a3886..5d19682c 100644
--- a/linux-core/savage_drv.c
+++ b/linux-core/savage_drv.c
@@ -248,11 +248,6 @@ int savage_free_cont_mem(struct inode *inode, struct file *filp,
[DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)] = { mga_dma_blit, 1, 0 },
-#define __HAVE_COUNTERS 3
-#define __HAVE_COUNTER6 _DRM_STAT_IRQ
-#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
-#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
-
#endif /* end #if 0 */
#include "drm_agpsupport.h"
diff --git a/linux/drm_drv.h b/linux/drm_drv.h
index f0485ea7..0e5524f4 100644
--- a/linux/drm_drv.h
+++ b/linux/drm_drv.h
@@ -52,10 +52,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifndef __HAVE_COUNTERS
-#define __HAVE_COUNTERS 0
-#endif
-
#ifndef DRIVER_IOCTLS
#define DRIVER_IOCTLS
#endif
@@ -180,42 +176,7 @@ static int DRM(setup)( drm_device_t *dev )
if ( i < 0 )
return i;
}
-
- dev->counters = 6 + __HAVE_COUNTERS;
- dev->types[0] = _DRM_STAT_LOCK;
- dev->types[1] = _DRM_STAT_OPENS;
- dev->types[2] = _DRM_STAT_CLOSES;
- dev->types[3] = _DRM_STAT_IOCTLS;
- dev->types[4] = _DRM_STAT_LOCKS;
- dev->types[5] = _DRM_STAT_UNLOCKS;
-#ifdef __HAVE_COUNTER6
- dev->types[6] = __HAVE_COUNTER6;
-#endif
-#ifdef __HAVE_COUNTER7
- dev->types[7] = __HAVE_COUNTER7;
-#endif
-#ifdef __HAVE_COUNTER8
- dev->types[8] = __HAVE_COUNTER8;
-#endif
-#ifdef __HAVE_COUNTER9
- dev->types[9] = __HAVE_COUNTER9;
-#endif
-#ifdef __HAVE_COUNTER10
- dev->types[10] = __HAVE_COUNTER10;
-#endif
-#ifdef __HAVE_COUNTER11
- dev->types[11] = __HAVE_COUNTER11;
-#endif
-#ifdef __HAVE_COUNTER12
- dev->types[12] = __HAVE_COUNTER12;
-#endif
-#ifdef __HAVE_COUNTER13
- dev->types[13] = __HAVE_COUNTER13;
-#endif
-#ifdef __HAVE_COUNTER14
- dev->types[14] = __HAVE_COUNTER14;
-#endif
-
+
for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )
atomic_set( &dev->counts[i], 0 );
@@ -461,7 +422,16 @@ int DRM(fill_in_dev)(drm_device_t *dev, struct pci_dev *pdev, const struct pci_d
/* dev_priv_size can be changed by a driver in driver_register_fns */
dev->dev_priv_size = sizeof(u32);
- DRM(init_fn_table)(dev);
+ /* the DRM has 6 counters */
+ dev->counters = 6;
+ dev->types[0] = _DRM_STAT_LOCK;
+ dev->types[1] = _DRM_STAT_OPENS;
+ dev->types[2] = _DRM_STAT_CLOSES;
+ dev->types[3] = _DRM_STAT_IOCTLS;
+ dev->types[4] = _DRM_STAT_LOCKS;
+ dev->types[5] = _DRM_STAT_UNLOCKS;
+
+ DRM(init_fn_table)(dev);
DRM(driver_register_fns)(dev);
@@ -489,8 +459,8 @@ int DRM(fill_in_dev)(drm_device_t *dev, struct pci_dev *pdev, const struct pci_d
retcode = DRM(ctxbitmap_init)( dev );
if( retcode ) {
- DRM_ERROR( "Cannot allocate memory for context bitmap.\n" );
- goto error_out_unreg;
+ DRM_ERROR( "Cannot allocate memory for context bitmap.\n" );
+ goto error_out_unreg;
}
dev->device = MKDEV(DRM_MAJOR, dev->minor );
@@ -905,7 +875,7 @@ int DRM(release)( struct inode *inode, struct file *filp )
list_del( &pos->head );
DRM(free)( pos, sizeof(*pos), DRM_MEM_CTXLIST );
- --dev->ctx_count;
+ --dev->ctx_count;
}
}
}
diff --git a/linux/i810.h b/linux/i810.h
index ee682368..2ea83be8 100644
--- a/linux/i810.h
+++ b/linux/i810.h
@@ -74,10 +74,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] = { i810_flip_bufs, 1, 0 }
-#define __HAVE_COUNTERS 4
-#define __HAVE_COUNTER6 _DRM_STAT_IRQ
-#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
-#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
-#define __HAVE_COUNTER9 _DRM_STAT_DMA
-
#endif
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index 43c044c0..0c828850 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -1417,5 +1417,12 @@ void i810_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.release = i810_driver_release;
dev->fn_tbl.dma_quiescent = i810_driver_dma_quiescent;
dev->fn_tbl.reclaim_buffers = i810_reclaim_buffers;
+
+ /* i810 has 4 more counters */
+ dev->counters += 4;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
+ dev->types[9] = _DRM_STAT_DMA;
}
diff --git a/linux/i830.h b/linux/i830.h
index eb2d9449..85a1ac20 100644
--- a/linux/i830.h
+++ b/linux/i830.h
@@ -73,12 +73,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam, 1, 0 }
-#define __HAVE_COUNTERS 4
-#define __HAVE_COUNTER6 _DRM_STAT_IRQ
-#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
-#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
-#define __HAVE_COUNTER9 _DRM_STAT_DMA
-
/* Driver will work either way: IRQ's save cpu time when waiting for
* the card, but are subject to subtle interactions between bios,
* hardware and the driver.
diff --git a/linux/i830_dma.c b/linux/i830_dma.c
index ac12b6dd..f39611c0 100644
--- a/linux/i830_dma.c
+++ b/linux/i830_dma.c
@@ -1621,5 +1621,10 @@ void i830_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_uninstall = i830_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i830_driver_irq_handler;
#endif
+ dev->counters += 4;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
+ dev->types[9] = _DRM_STAT_DMA;
}
diff --git a/linux/savage_drv.c b/linux/savage_drv.c
index 481a3886..5d19682c 100644
--- a/linux/savage_drv.c
+++ b/linux/savage_drv.c
@@ -248,11 +248,6 @@ int savage_free_cont_mem(struct inode *inode, struct file *filp,
[DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)] = { mga_dma_blit, 1, 0 },
-#define __HAVE_COUNTERS 3
-#define __HAVE_COUNTER6 _DRM_STAT_IRQ
-#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
-#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
-
#endif /* end #if 0 */
#include "drm_agpsupport.h"
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 34552008..cf0333f6 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -761,4 +761,10 @@ void i915_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = i915_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = i915_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i915_driver_irq_handler;
+
+ dev->counters += 4;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
+ dev->types[9] = _DRM_STAT_DMA;
}
diff --git a/shared-core/mga_dma.c b/shared-core/mga_dma.c
index 409f0ab7..0288f1c2 100644
--- a/shared-core/mga_dma.c
+++ b/shared-core/mga_dma.c
@@ -821,4 +821,9 @@ void mga_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = mga_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = mga_driver_irq_uninstall;
dev->fn_tbl.irq_handler = mga_driver_irq_handler;
+
+ dev->counters += 3;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
}
diff --git a/shared-core/via_drv.c b/shared-core/via_drv.c
index 8c4e7480..a6321d04 100644
--- a/shared-core/via_drv.c
+++ b/shared-core/via_drv.c
@@ -52,8 +52,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_VIA_PCICMD)] = { via_pci_cmdbuffer, 1, 0}
-#define __HAVE_COUNTERS 0
-
#include "drm_auth.h"
#include "drm_agpsupport.h"
#include "drm_bufs.h"
diff --git a/shared/i915.h b/shared/i915.h
index ed4e13d7..d76d737b 100644
--- a/shared/i915.h
+++ b/shared/i915.h
@@ -45,12 +45,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I915_INIT_HEAP)] = { i915_mem_init_heap, 1, 1 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I915_CMDBUFFER)] = { i915_cmdbuffer, 1, 0 }
-#define __HAVE_COUNTERS 4
-#define __HAVE_COUNTER6 _DRM_STAT_IRQ
-#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
-#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
-#define __HAVE_COUNTER9 _DRM_STAT_DMA
-
/* We use our own dma mechanisms, not the drm template code. However,
* the shared IRQ code is useful to us:
*/
diff --git a/shared/i915_dma.c b/shared/i915_dma.c
index 34552008..cf0333f6 100644
--- a/shared/i915_dma.c
+++ b/shared/i915_dma.c
@@ -761,4 +761,10 @@ void i915_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = i915_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = i915_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i915_driver_irq_handler;
+
+ dev->counters += 4;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
+ dev->types[9] = _DRM_STAT_DMA;
}
diff --git a/shared/mga.h b/shared/mga.h
index ec63e7f4..5356519e 100644
--- a/shared/mga.h
+++ b/shared/mga.h
@@ -60,9 +60,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)] = { mga_dma_blit, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_MGA_GETPARAM)]= { mga_getparam, 1, 0 },
-#define __HAVE_COUNTERS 3
-#define __HAVE_COUNTER6 _DRM_STAT_IRQ
-#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
-#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
-
#endif
diff --git a/shared/mga_dma.c b/shared/mga_dma.c
index 409f0ab7..0288f1c2 100644
--- a/shared/mga_dma.c
+++ b/shared/mga_dma.c
@@ -821,4 +821,9 @@ void mga_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = mga_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = mga_driver_irq_uninstall;
dev->fn_tbl.irq_handler = mga_driver_irq_handler;
+
+ dev->counters += 3;
+ dev->types[6] = _DRM_STAT_IRQ;
+ dev->types[7] = _DRM_STAT_PRIMARY;
+ dev->types[8] = _DRM_STAT_SECONDARY;
}
diff --git a/shared/sis.h b/shared/sis.h
index 1b149ebc..5f703700 100644
--- a/shared/sis.h
+++ b/shared/sis.h
@@ -54,6 +54,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_SIS_AGP_FREE)] = { sis_ioctl_agp_free, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_SIS_FB_INIT)] = { sis_fb_init, 1, 1 }
-#define __HAVE_COUNTERS 5
-
#endif
diff --git a/shared/via_drv.c b/shared/via_drv.c
index 8c4e7480..a6321d04 100644
--- a/shared/via_drv.c
+++ b/shared/via_drv.c
@@ -52,8 +52,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_VIA_PCICMD)] = { via_pci_cmdbuffer, 1, 0}
-#define __HAVE_COUNTERS 0
-
#include "drm_auth.h"
#include "drm_agpsupport.h"
#include "drm_bufs.h"