aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-10-04 07:53:41 -0400
committerDave Airlie <airlied@redhat.com>2013-10-09 01:55:33 -0400
commit0111be42186fc5461b9e9d579014c70869ab3152 (patch)
treed557ba527f1df28ef5ed22a0e1abacbb9ea110cd /drivers
parentffbab09bf939975b62ec233c426bf7df0dd4cea8 (diff)
drm: Kill drm perf counter leftovers
The user of these counters was killed in commit d79cdc8312689b39c6d83718c1c196af4b3cd18c Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Thu Aug 8 15:41:32 2013 +0200 drm: no-op out GET_STATS ioctl so clean up the leftovers as well. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_drv.c1
-rw-r--r--drivers/gpu/drm/drm_fops.c7
-rw-r--r--drivers/gpu/drm/drm_lock.c3
-rw-r--r--drivers/gpu/drm/drm_stub.c9
-rw-r--r--drivers/gpu/drm/i810/i810_dma.c11
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c7
-rw-r--r--drivers/gpu/drm/mga/mga_dma.c5
7 files changed, 0 insertions, 43 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 34d372ed904c..6495bdfd35dc 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -315,7 +315,6 @@ long drm_ioctl(struct file *filp,
315 return -ENODEV; 315 return -ENODEV;
316 316
317 atomic_inc(&dev->ioctl_count); 317 atomic_inc(&dev->ioctl_count);
318 atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]);
319 ++file_priv->ioctl_count; 318 ++file_priv->ioctl_count;
320 319
321 if ((nr >= DRM_CORE_IOCTL_COUNT) && 320 if ((nr >= DRM_CORE_IOCTL_COUNT) &&
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 621b45e08bd1..d0e27667a4eb 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -113,7 +113,6 @@ int drm_open(struct inode *inode, struct file *filp)
113 retcode = drm_open_helper(inode, filp, dev); 113 retcode = drm_open_helper(inode, filp, dev);
114 if (retcode) 114 if (retcode)
115 goto err_undo; 115 goto err_undo;
116 atomic_inc(&dev->counts[_DRM_STAT_OPENS]);
117 if (need_setup) { 116 if (need_setup) {
118 retcode = drm_setup(dev); 117 retcode = drm_setup(dev);
119 if (retcode) 118 if (retcode)
@@ -392,17 +391,12 @@ static void drm_events_release(struct drm_file *file_priv)
392 */ 391 */
393static void drm_legacy_dev_reinit(struct drm_device *dev) 392static void drm_legacy_dev_reinit(struct drm_device *dev)
394{ 393{
395 int i;
396
397 if (drm_core_check_feature(dev, DRIVER_MODESET)) 394 if (drm_core_check_feature(dev, DRIVER_MODESET))
398 return; 395 return;
399 396
400 atomic_set(&dev->ioctl_count, 0); 397 atomic_set(&dev->ioctl_count, 0);
401 atomic_set(&dev->vma_count, 0); 398 atomic_set(&dev->vma_count, 0);
402 399
403 for (i = 0; i < ARRAY_SIZE(dev->counts); i++)
404 atomic_set(&dev->counts[i], 0);
405
406 dev->sigdata.lock = NULL; 400 dev->sigdata.lock = NULL;
407 401
408 dev->context_flag = 0; 402 dev->context_flag = 0;
@@ -585,7 +579,6 @@ int drm_release(struct inode *inode, struct file *filp)
585 * End inline drm_release 579 * End inline drm_release
586 */ 580 */
587 581
588 atomic_inc(&dev->counts[_DRM_STAT_CLOSES]);
589 if (!--dev->open_count) { 582 if (!--dev->open_count) {
590 if (atomic_read(&dev->ioctl_count)) { 583 if (atomic_read(&dev->ioctl_count)) {
591 DRM_ERROR("Device busy: %d\n", 584 DRM_ERROR("Device busy: %d\n",
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
index d752c96d6090..f6452682141b 100644
--- a/drivers/gpu/drm/drm_lock.c
+++ b/drivers/gpu/drm/drm_lock.c
@@ -86,7 +86,6 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
86 if (drm_lock_take(&master->lock, lock->context)) { 86 if (drm_lock_take(&master->lock, lock->context)) {
87 master->lock.file_priv = file_priv; 87 master->lock.file_priv = file_priv;
88 master->lock.lock_time = jiffies; 88 master->lock.lock_time = jiffies;
89 atomic_inc(&dev->counts[_DRM_STAT_LOCKS]);
90 break; /* Got lock */ 89 break; /* Got lock */
91 } 90 }
92 91
@@ -157,8 +156,6 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
157 return -EINVAL; 156 return -EINVAL;
158 } 157 }
159 158
160 atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]);
161
162 if (drm_lock_free(&master->lock, lock->context)) { 159 if (drm_lock_free(&master->lock, lock->context)) {
163 /* FIXME: Should really bail out here. */ 160 /* FIXME: Should really bail out here. */
164 } 161 }
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 2badef766d20..26055abf94ee 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -431,15 +431,6 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver,
431 mutex_init(&dev->struct_mutex); 431 mutex_init(&dev->struct_mutex);
432 mutex_init(&dev->ctxlist_mutex); 432 mutex_init(&dev->ctxlist_mutex);
433 433
434 /* the DRM has 6 basic counters */
435 dev->counters = 6;
436 dev->types[0] = _DRM_STAT_LOCK;
437 dev->types[1] = _DRM_STAT_OPENS;
438 dev->types[2] = _DRM_STAT_CLOSES;
439 dev->types[3] = _DRM_STAT_IOCTLS;
440 dev->types[4] = _DRM_STAT_LOCKS;
441 dev->types[5] = _DRM_STAT_UNLOCKS;
442
443 if (drm_ht_create(&dev->map_hash, 12)) 434 if (drm_ht_create(&dev->map_hash, 12))
444 goto err_free; 435 goto err_free;
445 436
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
index ab1892eb1074..249fdff305c6 100644
--- a/drivers/gpu/drm/i810/i810_dma.c
+++ b/drivers/gpu/drm/i810/i810_dma.c
@@ -944,8 +944,6 @@ static int i810_dma_vertex(struct drm_device *dev, void *data,
944 dma->buflist[vertex->idx], 944 dma->buflist[vertex->idx],
945 vertex->discard, vertex->used); 945 vertex->discard, vertex->used);
946 946
947 atomic_add(vertex->used, &dev->counts[_DRM_STAT_SECONDARY]);
948 atomic_inc(&dev->counts[_DRM_STAT_DMA]);
949 sarea_priv->last_enqueue = dev_priv->counter - 1; 947 sarea_priv->last_enqueue = dev_priv->counter - 1;
950 sarea_priv->last_dispatch = (int)hw_status[5]; 948 sarea_priv->last_dispatch = (int)hw_status[5];
951 949
@@ -1105,8 +1103,6 @@ static int i810_dma_mc(struct drm_device *dev, void *data,
1105 i810_dma_dispatch_mc(dev, dma->buflist[mc->idx], mc->used, 1103 i810_dma_dispatch_mc(dev, dma->buflist[mc->idx], mc->used,
1106 mc->last_render); 1104 mc->last_render);
1107 1105
1108 atomic_add(mc->used, &dev->counts[_DRM_STAT_SECONDARY]);
1109 atomic_inc(&dev->counts[_DRM_STAT_DMA]);
1110 sarea_priv->last_enqueue = dev_priv->counter - 1; 1106 sarea_priv->last_enqueue = dev_priv->counter - 1;
1111 sarea_priv->last_dispatch = (int)hw_status[5]; 1107 sarea_priv->last_dispatch = (int)hw_status[5];
1112 1108
@@ -1197,13 +1193,6 @@ static int i810_flip_bufs(struct drm_device *dev, void *data,
1197 1193
1198int i810_driver_load(struct drm_device *dev, unsigned long flags) 1194int i810_driver_load(struct drm_device *dev, unsigned long flags)
1199{ 1195{
1200 /* i810 has 4 more counters */
1201 dev->counters += 4;
1202 dev->types[6] = _DRM_STAT_IRQ;
1203 dev->types[7] = _DRM_STAT_PRIMARY;
1204 dev->types[8] = _DRM_STAT_SECONDARY;
1205 dev->types[9] = _DRM_STAT_DMA;
1206
1207 pci_set_master(dev->pdev); 1196 pci_set_master(dev->pdev);
1208 1197
1209 return 0; 1198 return 0;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index d8478f7cdbf0..637b695eafbd 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1473,13 +1473,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1473 if (info->gen >= 6 && !drm_core_check_feature(dev, DRIVER_MODESET)) 1473 if (info->gen >= 6 && !drm_core_check_feature(dev, DRIVER_MODESET))
1474 return -ENODEV; 1474 return -ENODEV;
1475 1475
1476 /* i915 has 4 more counters */
1477 dev->counters += 4;
1478 dev->types[6] = _DRM_STAT_IRQ;
1479 dev->types[7] = _DRM_STAT_PRIMARY;
1480 dev->types[8] = _DRM_STAT_SECONDARY;
1481 dev->types[9] = _DRM_STAT_DMA;
1482
1483 dev_priv = kzalloc(sizeof(drm_i915_private_t), GFP_KERNEL); 1476 dev_priv = kzalloc(sizeof(drm_i915_private_t), GFP_KERNEL);
1484 if (dev_priv == NULL) 1477 if (dev_priv == NULL)
1485 return -ENOMEM; 1478 return -ENOMEM;
diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c
index cc3166dd445a..087db33f6cff 100644
--- a/drivers/gpu/drm/mga/mga_dma.c
+++ b/drivers/gpu/drm/mga/mga_dma.c
@@ -406,11 +406,6 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags)
406 dev_priv->mmio_base = pci_resource_start(dev->pdev, 1); 406 dev_priv->mmio_base = pci_resource_start(dev->pdev, 1);
407 dev_priv->mmio_size = pci_resource_len(dev->pdev, 1); 407 dev_priv->mmio_size = pci_resource_len(dev->pdev, 1);
408 408
409 dev->counters += 3;
410 dev->types[6] = _DRM_STAT_IRQ;
411 dev->types[7] = _DRM_STAT_PRIMARY;
412 dev->types[8] = _DRM_STAT_SECONDARY;
413
414 ret = drm_vblank_init(dev, 1); 409 ret = drm_vblank_init(dev, 1);
415 410
416 if (ret) { 411 if (ret) {