Commit 99c09e74 authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie

drm: remove dev->vma_count

This is just used for a debugfs file, and we can easily reconstruct
this number by just walking the list twice. Which isn't really bad for
a debugfs file anyway.

So let's rip this out.

There's the other issue that the dev->vmalist itself is a bit useless,
since that can be reconstructed with all the memory mapping
information from proc. But remove that is a different topic entirely.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 5952fba5
...@@ -391,8 +391,6 @@ static void drm_legacy_dev_reinit(struct drm_device *dev) ...@@ -391,8 +391,6 @@ static void drm_legacy_dev_reinit(struct drm_device *dev)
if (drm_core_check_feature(dev, DRIVER_MODESET)) if (drm_core_check_feature(dev, DRIVER_MODESET))
return; return;
atomic_set(&dev->vma_count, 0);
dev->sigdata.lock = NULL; dev->sigdata.lock = NULL;
dev->context_flag = 0; dev->context_flag = 0;
......
...@@ -234,14 +234,18 @@ int drm_vma_info(struct seq_file *m, void *data) ...@@ -234,14 +234,18 @@ int drm_vma_info(struct seq_file *m, void *data)
struct drm_device *dev = node->minor->dev; struct drm_device *dev = node->minor->dev;
struct drm_vma_entry *pt; struct drm_vma_entry *pt;
struct vm_area_struct *vma; struct vm_area_struct *vma;
unsigned long vma_count = 0;
#if defined(__i386__) #if defined(__i386__)
unsigned int pgprot; unsigned int pgprot;
#endif #endif
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
seq_printf(m, "vma use count: %d, high_memory = %pK, 0x%pK\n", list_for_each_entry(pt, &dev->vmalist, head)
atomic_read(&dev->vma_count), vma_count++;
high_memory, (void *)(unsigned long)virt_to_phys(high_memory));
seq_printf(m, "vma use count: %lu, high_memory = %pK, 0x%pK\n",
vma_count, high_memory,
(void *)(unsigned long)virt_to_phys(high_memory));
list_for_each_entry(pt, &dev->vmalist, head) { list_for_each_entry(pt, &dev->vmalist, head) {
vma = pt->vma; vma = pt->vma;
......
...@@ -220,7 +220,6 @@ static void drm_vm_shm_close(struct vm_area_struct *vma) ...@@ -220,7 +220,6 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
DRM_DEBUG("0x%08lx,0x%08lx\n", DRM_DEBUG("0x%08lx,0x%08lx\n",
vma->vm_start, vma->vm_end - vma->vm_start); vma->vm_start, vma->vm_end - vma->vm_start);
atomic_dec(&dev->vma_count);
map = vma->vm_private_data; map = vma->vm_private_data;
...@@ -405,7 +404,6 @@ void drm_vm_open_locked(struct drm_device *dev, ...@@ -405,7 +404,6 @@ void drm_vm_open_locked(struct drm_device *dev,
DRM_DEBUG("0x%08lx,0x%08lx\n", DRM_DEBUG("0x%08lx,0x%08lx\n",
vma->vm_start, vma->vm_end - vma->vm_start); vma->vm_start, vma->vm_end - vma->vm_start);
atomic_inc(&dev->vma_count);
vma_entry = kmalloc(sizeof(*vma_entry), GFP_KERNEL); vma_entry = kmalloc(sizeof(*vma_entry), GFP_KERNEL);
if (vma_entry) { if (vma_entry) {
...@@ -433,7 +431,6 @@ void drm_vm_close_locked(struct drm_device *dev, ...@@ -433,7 +431,6 @@ void drm_vm_close_locked(struct drm_device *dev,
DRM_DEBUG("0x%08lx,0x%08lx\n", DRM_DEBUG("0x%08lx,0x%08lx\n",
vma->vm_start, vma->vm_end - vma->vm_start); vma->vm_start, vma->vm_end - vma->vm_start);
atomic_dec(&dev->vma_count);
list_for_each_entry_safe(pt, temp, &dev->vmalist, head) { list_for_each_entry_safe(pt, temp, &dev->vmalist, head) {
if (pt->vma == vma) { if (pt->vma == vma) {
......
...@@ -1109,7 +1109,6 @@ struct drm_device { ...@@ -1109,7 +1109,6 @@ struct drm_device {
/** \name Usage Counters */ /** \name Usage Counters */
/*@{ */ /*@{ */
int open_count; /**< Outstanding files open */ int open_count; /**< Outstanding files open */
atomic_t vma_count; /**< Outstanding vma areas open */
int buf_use; /**< Buffers in use -- cannot alloc */ int buf_use; /**< Buffers in use -- cannot alloc */
atomic_t buf_alloc; /**< Buffer allocation in progress */ atomic_t buf_alloc; /**< Buffer allocation in progress */
/*@} */ /*@} */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment