diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-09-06 02:54:53 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-09-06 02:54:53 +0000 |
commit | 0a0551ab33353de446e66f36295eda493f3ce4ad (patch) | |
tree | 7ca4ef91d145a32b44344cf0899f913e8750bf0a | |
parent | b3e0f5fb6df7bc3ae331ed3e101c3b25d5d5ebff (diff) |
Kill some more unused struct fields and the cases for them.
-rw-r--r-- | sys/dev/pci/drm/drmP.h | 13 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_bufs.c | 23 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_dma.c | 15 |
3 files changed, 9 insertions, 42 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index 025b5d425cf..5115722a487 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -319,24 +319,11 @@ struct drm_magic_entry { typedef struct drm_buf { int idx; /* Index into master buflist */ int total; /* Buffer size */ - int order; /* log-base-2(total) */ int used; /* Amount of buffer in use (for DMA) */ unsigned long offset; /* Byte offset (used internally) */ - void *address; /* Address of buffer */ unsigned long bus_address; /* Bus address of buffer */ __volatile__ int pending; /* On hardware DMA queue */ struct drm_file *file_priv; /* Unique identifier of holding process */ - int context; /* Kernel queue for this buffer */ - enum { - DRM_LIST_NONE = 0, - DRM_LIST_FREE = 1, - DRM_LIST_WAIT = 2, - DRM_LIST_PEND = 3, - DRM_LIST_PRIO = 4, - DRM_LIST_RECLAIM = 5 - } list; /* Which list we're on */ - - int dev_priv_size; /* Size of buffer private stoarge */ void *dev_private; /* Per-buffer private storage */ } drm_buf_t; diff --git a/sys/dev/pci/drm/drm_bufs.c b/sys/dev/pci/drm/drm_bufs.c index c3e77f08a0f..ce2987a3901 100644 --- a/sys/dev/pci/drm/drm_bufs.c +++ b/sys/dev/pci/drm/drm_bufs.c @@ -478,17 +478,14 @@ drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request) buf = &entry->buflist[entry->buf_count]; buf->idx = dma->buf_count + entry->buf_count; buf->total = alignment; - buf->order = order; buf->used = 0; buf->offset = (dma->byte_count + offset); buf->bus_address = agp_offset + offset; - buf->address = (void *)(agp_offset + offset); buf->pending = 0; buf->file_priv = NULL; - buf->dev_priv_size = dev->driver.buf_priv_size; - buf->dev_private = drm_calloc(1, buf->dev_priv_size, + buf->dev_private = drm_calloc(1, dev->driver.buf_priv_size, DRM_MEM_BUFS); if (buf->dev_private == NULL) { /* Set count correctly so we free the proper amount. */ @@ -626,17 +623,14 @@ drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request) buf = &entry->buflist[entry->buf_count]; buf->idx = dma->buf_count + entry->buf_count; buf->total = alignment; - buf->order = order; buf->used = 0; buf->offset = (dma->byte_count + byte_count + offset); - buf->address = ((char *)dmah->vaddr + offset); buf->bus_address = dmah->busaddr + offset; buf->pending = 0; buf->file_priv = NULL; - buf->dev_priv_size = dev->driver.buf_priv_size; - buf->dev_private = drm_calloc(1, buf->dev_priv_size, - DRM_MEM_BUFS); + buf->dev_private = drm_calloc(1, + dev->driver.buf_priv_size, DRM_MEM_BUFS); if (buf->dev_private == NULL) { /* Set count so we free the proper amount. */ entry->buf_count = count; @@ -649,8 +643,8 @@ drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request) return ENOMEM; } - DRM_DEBUG("buffer %d @ %p\n", - entry->buf_count, buf->address); + DRM_DEBUG("buffer %d\n", + entry->buf_count); } byte_count += PAGE_SIZE << page_order; } @@ -744,17 +738,14 @@ drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request) buf = &entry->buflist[entry->buf_count]; buf->idx = dma->buf_count + entry->buf_count; buf->total = alignment; - buf->order = order; buf->used = 0; buf->offset = (dma->byte_count + offset); buf->bus_address = agp_offset + offset; - buf->address = (void *)(agp_offset + offset + dev->sg->handle); buf->pending = 0; buf->file_priv = NULL; - buf->dev_priv_size = dev->driver.buf_priv_size; - buf->dev_private = drm_calloc(1, buf->dev_priv_size, + buf->dev_private = drm_calloc(1, dev->driver.buf_priv_size, DRM_MEM_BUFS); if (buf->dev_private == NULL) { /* Set count correctly so we free the proper amount. */ @@ -763,7 +754,7 @@ drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request) return ENOMEM; } - DRM_DEBUG("buffer %d @ %p\n", entry->buf_count, buf->address); + DRM_DEBUG("buffer %d\n", entry->buf_count); offset += alignment; entry->buf_count++; diff --git a/sys/dev/pci/drm/drm_dma.c b/sys/dev/pci/drm/drm_dma.c index 91e51cfaf96..2059abcf7a6 100644 --- a/sys/dev/pci/drm/drm_dma.c +++ b/sys/dev/pci/drm/drm_dma.c @@ -68,7 +68,7 @@ drm_cleanup_buf(struct drm_device *dev, drm_buf_entry_t *entry) if (entry->buf_count) { for (i = 0; i < entry->buf_count; i++) { drm_free(entry->buflist[i].dev_private, - entry->buflist[i].dev_priv_size, DRM_MEM_BUFS); + dev->driver.buf_priv_size, DRM_MEM_BUFS); } drm_free(entry->buflist, entry->buf_count * sizeof(*entry->buflist), DRM_MEM_BUFS); @@ -120,19 +120,8 @@ drm_reclaim_buffers(struct drm_device *dev, struct drm_file *file_priv) if (dma == NULL) return; for (i = 0; i < dma->buf_count; i++) { - if (dma->buflist[i]->file_priv == file_priv) { - switch (dma->buflist[i]->list) { - case DRM_LIST_NONE: + if (dma->buflist[i]->file_priv == file_priv) drm_free_buffer(dev, dma->buflist[i]); - break; - case DRM_LIST_WAIT: - dma->buflist[i]->list = DRM_LIST_RECLAIM; - break; - default: - /* Buffer already on hardware. */ - break; - } - } } } |