drm: remove unused "struct drm_freelist"
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 23 Jul 2014 15:26:36 +0000 (17:26 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 1 Aug 2014 20:43:10 +0000 (06:43 +1000)
This object is not used except for static fields in drm_bufs *cough*.
Inline the watermark fields and drop the unused structure definition.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_bufs.c
drivers/gpu/drm/drm_info.c
include/drm/drmP.h

index 68175b54504bf1518b294402b824666c19c60b6f..61acb8f6756d1f14caca006cd48e88ab8c6786c6 100644 (file)
@@ -1217,7 +1217,6 @@ int drm_infobufs(struct drm_device *dev, void *data,
                                struct drm_buf_desc __user *to =
                                    &request->list[count];
                                struct drm_buf_entry *from = &dma->bufs[i];
-                               struct drm_freelist *list = &dma->bufs[i].freelist;
                                if (copy_to_user(&to->count,
                                                 &from->buf_count,
                                                 sizeof(from->buf_count)) ||
@@ -1225,19 +1224,19 @@ int drm_infobufs(struct drm_device *dev, void *data,
                                                 &from->buf_size,
                                                 sizeof(from->buf_size)) ||
                                    copy_to_user(&to->low_mark,
-                                                &list->low_mark,
-                                                sizeof(list->low_mark)) ||
+                                                &from->low_mark,
+                                                sizeof(from->low_mark)) ||
                                    copy_to_user(&to->high_mark,
-                                                &list->high_mark,
-                                                sizeof(list->high_mark)))
+                                                &from->high_mark,
+                                                sizeof(from->high_mark)))
                                        return -EFAULT;
 
                                DRM_DEBUG("%d %d %d %d %d\n",
                                          i,
                                          dma->bufs[i].buf_count,
                                          dma->bufs[i].buf_size,
-                                         dma->bufs[i].freelist.low_mark,
-                                         dma->bufs[i].freelist.high_mark);
+                                         dma->bufs[i].low_mark,
+                                         dma->bufs[i].high_mark);
                                ++count;
                        }
                }
@@ -1290,8 +1289,8 @@ int drm_markbufs(struct drm_device *dev, void *data,
        if (request->high_mark < 0 || request->high_mark > entry->buf_count)
                return -EINVAL;
 
-       entry->freelist.low_mark = request->low_mark;
-       entry->freelist.high_mark = request->high_mark;
+       entry->low_mark = request->low_mark;
+       entry->high_mark = request->high_mark;
 
        return 0;
 }
index 86feedd5e6f696f521e5fa0619c2f86b64598f60..ecaf0fa2eec8fe5d3c95ea324b6d6e0510003dec 100644 (file)
@@ -132,7 +132,7 @@ int drm_bufs_info(struct seq_file *m, void *data)
                                   i,
                                   dma->bufs[i].buf_size,
                                   dma->bufs[i].buf_count,
-                                  atomic_read(&dma->bufs[i].freelist.count),
+                                  0,
                                   dma->bufs[i].seg_count,
                                   seg_pages,
                                   seg_pages * PAGE_SIZE / 1024);
index 9b6a445f8602753f168d7dbf593c7c96a00b6289..335b7b8f5e7d9d5d24ba27e00bef8d9a6cd14c2f 100644 (file)
@@ -346,18 +346,6 @@ struct drm_waitlist {
        spinlock_t write_lock;
 };
 
-struct drm_freelist {
-       int initialized;               /**< Freelist in use */
-       atomic_t count;                /**< Number of free buffers */
-       struct drm_buf *next;          /**< End pointer */
-
-       wait_queue_head_t waiting;     /**< Processes waiting on free bufs */
-       int low_mark;                  /**< Low water mark */
-       int high_mark;                 /**< High water mark */
-       atomic_t wfh;                  /**< If waiting for high mark */
-       spinlock_t lock;
-};
-
 typedef struct drm_dma_handle {
        dma_addr_t busaddr;
        void *vaddr;
@@ -375,7 +363,8 @@ struct drm_buf_entry {
        int page_order;
        struct drm_dma_handle **seglist;
 
-       struct drm_freelist freelist;
+       int low_mark;                   /**< Low water mark */
+       int high_mark;                  /**< High water mark */
 };
 
 /* Event queued up for userspace to read */