summaryrefslogtreecommitdiff
path: root/bsd
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2003-03-29 18:22:28 +0000
committerEric Anholt <anholt@freebsd.org>2003-03-29 18:22:28 +0000
commitaea0418d0db3338b81f83abf26df99dfd7ac85bc (patch)
treef650b40186e73c15787df90dc43d3edc05aa6b34 /bsd
parent6ef79263b68402687ccc2b7447dd908c00e35057 (diff)
Remove dead vma code and remove the unused devstate struct definition.
Diffstat (limited to 'bsd')
-rw-r--r--bsd/drmP.h42
-rw-r--r--bsd/drm_drv.h12
-rw-r--r--bsd/drm_memory.h1
-rw-r--r--bsd/drm_sysctl.h92
4 files changed, 14 insertions, 133 deletions
diff --git a/bsd/drmP.h b/bsd/drmP.h
index a673ecda..96dd52d8 100644
--- a/bsd/drmP.h
+++ b/bsd/drmP.h
@@ -96,21 +96,20 @@ typedef struct drm_file drm_file_t;
#define DRM_MEM_MAGIC 3
#define DRM_MEM_IOCTLS 4
#define DRM_MEM_MAPS 5
-#define DRM_MEM_VMAS 6
-#define DRM_MEM_BUFS 7
-#define DRM_MEM_SEGS 8
-#define DRM_MEM_PAGES 9
-#define DRM_MEM_FILES 10
-#define DRM_MEM_QUEUES 11
-#define DRM_MEM_CMDS 12
-#define DRM_MEM_MAPPINGS 13
-#define DRM_MEM_BUFLISTS 14
-#define DRM_MEM_AGPLISTS 15
-#define DRM_MEM_TOTALAGP 16
-#define DRM_MEM_BOUNDAGP 17
-#define DRM_MEM_CTXBITMAP 18
-#define DRM_MEM_STUB 19
-#define DRM_MEM_SGLISTS 20
+#define DRM_MEM_BUFS 6
+#define DRM_MEM_SEGS 7
+#define DRM_MEM_PAGES 8
+#define DRM_MEM_FILES 9
+#define DRM_MEM_QUEUES 10
+#define DRM_MEM_CMDS 11
+#define DRM_MEM_MAPPINGS 12
+#define DRM_MEM_BUFLISTS 13
+#define DRM_MEM_AGPLISTS 14
+#define DRM_MEM_TOTALAGP 15
+#define DRM_MEM_BOUNDAGP 16
+#define DRM_MEM_CTXBITMAP 17
+#define DRM_MEM_STUB 18
+#define DRM_MEM_SGLISTS 19
#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8)
@@ -158,11 +157,6 @@ typedef struct drm_ioctl_desc {
int root_only;
} drm_ioctl_desc_t;
-typedef struct drm_devstate {
- pid_t owner; /* X server pid holding x_lock */
-
-} drm_devstate_t;
-
typedef struct drm_magic_entry {
drm_magic_t magic;
struct drm_file *priv;
@@ -174,12 +168,6 @@ typedef struct drm_magic_head {
struct drm_magic_entry *tail;
} drm_magic_head_t;
-typedef struct drm_vma_entry {
- struct vm_area_struct *vma;
- struct drm_vma_entry *next;
- pid_t pid;
-} drm_vma_entry_t;
-
typedef struct drm_buf {
int idx; /* Index into master buflist */
int total; /* Buffer size */
@@ -436,7 +424,6 @@ struct drm_device {
/* Usage Counters */
int open_count; /* Outstanding files open */
atomic_t ioctl_count; /* Outstanding IOCTLs pending */
- atomic_t vma_count; /* Outstanding vma areas open */
int buf_use; /* Buffers in use -- cannot alloc */
atomic_t buf_alloc; /* Buffer allocation in progress */
@@ -456,7 +443,6 @@ struct drm_device {
drm_local_map_t **context_sareas;
int max_context;
- drm_vma_entry_t *vmalist; /* List of vmas (for debugging) */
drm_lock_data_t lock; /* Information on hardware lock */
/* DMA queues (contexts) */
diff --git a/bsd/drm_drv.h b/bsd/drm_drv.h
index 74655ee9..d43a4666 100644
--- a/bsd/drm_drv.h
+++ b/bsd/drm_drv.h
@@ -433,7 +433,6 @@ static int DRM(setup)( drm_device_t *dev )
DRIVER_PRESETUP();
atomic_set( &dev->ioctl_count, 0 );
- atomic_set( &dev->vma_count, 0 );
dev->buf_use = 0;
atomic_set( &dev->buf_alloc, 0 );
@@ -496,7 +495,6 @@ static int DRM(setup)( drm_device_t *dev )
TAILQ_INIT(dev->maplist);
dev->map_count = 0;
- dev->vmalist = NULL;
dev->lock.hw_lock = NULL;
dev->lock.lock_queue = 0;
dev->queue_count = 0;
@@ -550,7 +548,6 @@ static int DRM(takedown)( drm_device_t *dev )
drm_magic_entry_t *pt, *next;
drm_local_map_t *map;
drm_map_list_entry_t *list;
- drm_vma_entry_t *vma, *vma_next;
int i;
DRM_DEBUG( "\n" );
@@ -607,15 +604,6 @@ static int DRM(takedown)( drm_device_t *dev )
}
#endif
- /* Clear vma list (only built for debugging) */
- if ( dev->vmalist ) {
- for ( vma = dev->vmalist ; vma ; vma = vma_next ) {
- vma_next = vma->next;
- DRM(free)( vma, sizeof(*vma), DRM_MEM_VMAS );
- }
- dev->vmalist = NULL;
- }
-
if( dev->maplist ) {
while ((list=TAILQ_FIRST(dev->maplist))) {
map = list->map;
diff --git a/bsd/drm_memory.h b/bsd/drm_memory.h
index 95d6110d..0df7ee72 100644
--- a/bsd/drm_memory.h
+++ b/bsd/drm_memory.h
@@ -61,7 +61,6 @@ static drm_mem_stats_t DRM(mem_stats)[] = {
[DRM_MEM_MAGIC] = { "magic" },
[DRM_MEM_IOCTLS] = { "ioctltab" },
[DRM_MEM_MAPS] = { "maplist" },
- [DRM_MEM_VMAS] = { "vmalist" },
[DRM_MEM_BUFS] = { "buflist" },
[DRM_MEM_SEGS] = { "seglist" },
[DRM_MEM_PAGES] = { "pagelist" },
diff --git a/bsd/drm_sysctl.h b/bsd/drm_sysctl.h
index 627b78c9..2ca187d8 100644
--- a/bsd/drm_sysctl.h
+++ b/bsd/drm_sysctl.h
@@ -11,9 +11,6 @@ static int DRM(vm_info)DRM_SYSCTL_HANDLER_ARGS;
static int DRM(clients_info)DRM_SYSCTL_HANDLER_ARGS;
static int DRM(queues_info)DRM_SYSCTL_HANDLER_ARGS;
static int DRM(bufs_info)DRM_SYSCTL_HANDLER_ARGS;
-#if DRM_DEBUG_CODExx
-static int DRM(vma_info)DRM_SYSCTL_HANDLER_ARGS;
-#endif
#if DRM_DMA_HISTOGRAM
static int DRM(histo_info)DRM_SYSCTL_HANDLER_ARGS;
#endif
@@ -28,9 +25,6 @@ struct DRM(sysctl_list) {
{ "clients", DRM(clients_info) },
{ "queues", DRM(queues_info) },
{ "bufs", DRM(bufs_info) },
-#if DRM_DEBUG_CODExx
- { "vma", DRM(vma_info) },
-#endif
#if DRM_DMA_HISTOGRAM
{ "histo", drm_histo_info) },
#endif
@@ -309,92 +303,6 @@ static int DRM(clients_info)DRM_SYSCTL_HANDLER_ARGS
return ret;
}
-#if DRM_DEBUG_CODExx
-
-static int DRM(_vma_info)DRM_SYSCTL_HANDLER_ARGS
-{
- drm_device_t *dev = arg1;
- drm_vma_entry_t *pt;
- pgd_t *pgd;
- pmd_t *pmd;
- pte_t *pte;
- unsigned long i;
- struct vm_area_struct *vma;
- unsigned long address;
-#if defined(__i386__)
- unsigned int pgprot;
-#endif
- char buf[128];
- int error;
-
- DRM_SYSCTL_PRINT("vma use count: %d, high_memory = %p, 0x%08lx\n",
- atomic_read(&dev->vma_count),
- high_memory, virt_to_phys(high_memory));
- for (pt = dev->vmalist; pt; pt = pt->next) {
- if (!(vma = pt->vma)) continue;
- DRM_SYSCTL_PRINT("\n%5d 0x%08lx-0x%08lx %c%c%c%c%c%c 0x%08lx",
- pt->pid,
- vma->vm_start,
- vma->vm_end,
- vma->vm_flags & VM_READ ? 'r' : '-',
- vma->vm_flags & VM_WRITE ? 'w' : '-',
- vma->vm_flags & VM_EXEC ? 'x' : '-',
- vma->vm_flags & VM_MAYSHARE ? 's' : 'p',
- vma->vm_flags & VM_LOCKED ? 'l' : '-',
- vma->vm_flags & VM_IO ? 'i' : '-',
- vma->vm_offset );
-#if defined(__i386__)
- pgprot = pgprot_val(vma->vm_page_prot);
- DRM_SYSCTL_PRINT(" %c%c%c%c%c%c%c%c%c",
- pgprot & _PAGE_PRESENT ? 'p' : '-',
- pgprot & _PAGE_RW ? 'w' : 'r',
- pgprot & _PAGE_USER ? 'u' : 's',
- pgprot & _PAGE_PWT ? 't' : 'b',
- pgprot & _PAGE_PCD ? 'u' : 'c',
- pgprot & _PAGE_ACCESSED ? 'a' : '-',
- pgprot & _PAGE_DIRTY ? 'd' : '-',
- pgprot & _PAGE_4M ? 'm' : 'k',
- pgprot & _PAGE_GLOBAL ? 'g' : 'l' );
-#endif
- DRM_SYSCTL_PRINT("\n");
- for (i = vma->vm_start; i < vma->vm_end; i += PAGE_SIZE) {
- pgd = pgd_offset(vma->vm_mm, i);
- pmd = pmd_offset(pgd, i);
- pte = pte_offset(pmd, i);
- if (pte_present(*pte)) {
- address = __pa(pte_page(*pte))
- + (i & (PAGE_SIZE-1));
- DRM_SYSCTL_PRINT(" 0x%08lx -> 0x%08lx"
- " %c%c%c%c%c\n",
- i,
- address,
- pte_read(*pte) ? 'r' : '-',
- pte_write(*pte) ? 'w' : '-',
- pte_exec(*pte) ? 'x' : '-',
- pte_dirty(*pte) ? 'd' : '-',
- pte_young(*pte) ? 'a' : '-' );
- } else {
- DRM_SYSCTL_PRINT(" 0x%08lx\n", i);
- }
- }
- }
-
- SYSCTL_OUT(req, "", 1);
- return 0;
-}
-
-static int DRM(vma_info)DRM_SYSCTL_HANDLER_ARGS
-{
- drm_device_t *dev = arg1;
- int ret;
-
- DRM_LOCK;
- ret = DRM(_vma_info)(oidp, arg1, arg2, req);
- DRM_UNLOCK;
- return ret;
-}
-#endif
-
#if DRM_DMA_HISTOGRAM
static int DRM(_histo_info)DRM_SYSCTL_HANDLER_ARGS