aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-07-23 11:26:36 -0400
committerDave Airlie <airlied@redhat.com>2014-08-01 16:43:10 -0400
commitb008c0fc95140ca7aad65861a77f0338ce31e8b5 (patch)
tree1ef052d0abf90f1cd6815aa11c91acb875409403
parent8bed5cc765ffdd61b59f8405d38b377f5a7f0920 (diff)
drm: remove unused "struct drm_freelist"
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>
-rw-r--r--drivers/gpu/drm/drm_bufs.c17
-rw-r--r--drivers/gpu/drm/drm_info.c2
-rw-r--r--include/drm/drmP.h15
3 files changed, 11 insertions, 23 deletions
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 68175b54504b..61acb8f6756d 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -1217,7 +1217,6 @@ int drm_infobufs(struct drm_device *dev, void *data,
1217 struct drm_buf_desc __user *to = 1217 struct drm_buf_desc __user *to =
1218 &request->list[count]; 1218 &request->list[count];
1219 struct drm_buf_entry *from = &dma->bufs[i]; 1219 struct drm_buf_entry *from = &dma->bufs[i];
1220 struct drm_freelist *list = &dma->bufs[i].freelist;
1221 if (copy_to_user(&to->count, 1220 if (copy_to_user(&to->count,
1222 &from->buf_count, 1221 &from->buf_count,
1223 sizeof(from->buf_count)) || 1222 sizeof(from->buf_count)) ||
@@ -1225,19 +1224,19 @@ int drm_infobufs(struct drm_device *dev, void *data,
1225 &from->buf_size, 1224 &from->buf_size,
1226 sizeof(from->buf_size)) || 1225 sizeof(from->buf_size)) ||
1227 copy_to_user(&to->low_mark, 1226 copy_to_user(&to->low_mark,
1228 &list->low_mark, 1227 &from->low_mark,
1229 sizeof(list->low_mark)) || 1228 sizeof(from->low_mark)) ||
1230 copy_to_user(&to->high_mark, 1229 copy_to_user(&to->high_mark,
1231 &list->high_mark, 1230 &from->high_mark,
1232 sizeof(list->high_mark))) 1231 sizeof(from->high_mark)))
1233 return -EFAULT; 1232 return -EFAULT;
1234 1233
1235 DRM_DEBUG("%d %d %d %d %d\n", 1234 DRM_DEBUG("%d %d %d %d %d\n",
1236 i, 1235 i,
1237 dma->bufs[i].buf_count, 1236 dma->bufs[i].buf_count,
1238 dma->bufs[i].buf_size, 1237 dma->bufs[i].buf_size,
1239 dma->bufs[i].freelist.low_mark, 1238 dma->bufs[i].low_mark,
1240 dma->bufs[i].freelist.high_mark); 1239 dma->bufs[i].high_mark);
1241 ++count; 1240 ++count;
1242 } 1241 }
1243 } 1242 }
@@ -1290,8 +1289,8 @@ int drm_markbufs(struct drm_device *dev, void *data,
1290 if (request->high_mark < 0 || request->high_mark > entry->buf_count) 1289 if (request->high_mark < 0 || request->high_mark > entry->buf_count)
1291 return -EINVAL; 1290 return -EINVAL;
1292 1291
1293 entry->freelist.low_mark = request->low_mark; 1292 entry->low_mark = request->low_mark;
1294 entry->freelist.high_mark = request->high_mark; 1293 entry->high_mark = request->high_mark;
1295 1294
1296 return 0; 1295 return 0;
1297} 1296}
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
index 86feedd5e6f6..ecaf0fa2eec8 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -132,7 +132,7 @@ int drm_bufs_info(struct seq_file *m, void *data)
132 i, 132 i,
133 dma->bufs[i].buf_size, 133 dma->bufs[i].buf_size,
134 dma->bufs[i].buf_count, 134 dma->bufs[i].buf_count,
135 atomic_read(&dma->bufs[i].freelist.count), 135 0,
136 dma->bufs[i].seg_count, 136 dma->bufs[i].seg_count,
137 seg_pages, 137 seg_pages,
138 seg_pages * PAGE_SIZE / 1024); 138 seg_pages * PAGE_SIZE / 1024);
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 9b6a445f8602..335b7b8f5e7d 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -346,18 +346,6 @@ struct drm_waitlist {
346 spinlock_t write_lock; 346 spinlock_t write_lock;
347}; 347};
348 348
349struct drm_freelist {
350 int initialized; /**< Freelist in use */
351 atomic_t count; /**< Number of free buffers */
352 struct drm_buf *next; /**< End pointer */
353
354 wait_queue_head_t waiting; /**< Processes waiting on free bufs */
355 int low_mark; /**< Low water mark */
356 int high_mark; /**< High water mark */
357 atomic_t wfh; /**< If waiting for high mark */
358 spinlock_t lock;
359};
360
361typedef struct drm_dma_handle { 349typedef struct drm_dma_handle {
362 dma_addr_t busaddr; 350 dma_addr_t busaddr;
363 void *vaddr; 351 void *vaddr;
@@ -375,7 +363,8 @@ struct drm_buf_entry {
375 int page_order; 363 int page_order;
376 struct drm_dma_handle **seglist; 364 struct drm_dma_handle **seglist;
377 365
378 struct drm_freelist freelist; 366 int low_mark; /**< Low water mark */
367 int high_mark; /**< High water mark */
379}; 368};
380 369
381/* Event queued up for userspace to read */ 370/* Event queued up for userspace to read */