aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRebecca Schultz Zavin2012-12-11 17:23:14 -0600
committerArve Hjønnevåg2013-02-19 19:56:05 -0600
commit68d0fcfb4ec48060f00052ac965c6067326c4d47 (patch)
treeb719a6905b646af1dc928b495b8909ed5e32adca
parentceb0878df2a696c772ac6e2fe1c1f7851a2eef7c (diff)
downloadkernel-common-68d0fcfb4ec48060f00052ac965c6067326c4d47.tar.gz
kernel-common-68d0fcfb4ec48060f00052ac965c6067326c4d47.tar.xz
kernel-common-68d0fcfb4ec48060f00052ac965c6067326c4d47.zip
gpu: ion: Remove heapmask from client
The heapmask in the client generally wasn't being used. This patch removes it. Change-Id: I3526723fbf8f2e81c28c0733deb583ea14bdd837 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
-rw-r--r--drivers/gpu/ion/ion.c17
-rw-r--r--include/linux/ion.h1
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index f6c2a474160..34264edc6ee 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -63,7 +63,6 @@ struct ion_device {
63 * @dev: backpointer to ion device 63 * @dev: backpointer to ion device
64 * @handles: an rb tree of all the handles in this client 64 * @handles: an rb tree of all the handles in this client
65 * @lock: lock protecting the tree of handles 65 * @lock: lock protecting the tree of handles
66 * @heap_type_mask: mask of all supported heap types
67 * @name: used for debugging 66 * @name: used for debugging
68 * @task: used for debugging 67 * @task: used for debugging
69 * 68 *
@@ -76,7 +75,6 @@ struct ion_client {
76 struct ion_device *dev; 75 struct ion_device *dev;
77 struct rb_root handles; 76 struct rb_root handles;
78 struct mutex lock; 77 struct mutex lock;
79 unsigned int heap_type_mask;
80 const char *name; 78 const char *name;
81 struct task_struct *task; 79 struct task_struct *task;
82 pid_t pid; 80 pid_t pid;
@@ -410,9 +408,6 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
410 408
411 down_read(&dev->lock); 409 down_read(&dev->lock);
412 plist_for_each_entry(heap, &dev->heaps, node) { 410 plist_for_each_entry(heap, &dev->heaps, node) {
413 /* if the client doesn't support this heap type */
414 if (!((1 << heap->type) & client->heap_type_mask))
415 continue;
416 /* if the caller didn't specify this heap id */ 411 /* if the caller didn't specify this heap id */
417 if (!((1 << heap->id) & heap_id_mask)) 412 if (!((1 << heap->id) & heap_id_mask))
418 continue; 413 continue;
@@ -627,7 +622,6 @@ static const struct file_operations debug_client_fops = {
627}; 622};
628 623
629struct ion_client *ion_client_create(struct ion_device *dev, 624struct ion_client *ion_client_create(struct ion_device *dev,
630 unsigned int heap_type_mask,
631 const char *name) 625 const char *name)
632{ 626{
633 struct ion_client *client; 627 struct ion_client *client;
@@ -662,7 +656,6 @@ struct ion_client *ion_client_create(struct ion_device *dev,
662 client->handles = RB_ROOT; 656 client->handles = RB_ROOT;
663 mutex_init(&client->lock); 657 mutex_init(&client->lock);
664 client->name = name; 658 client->name = name;
665 client->heap_type_mask = heap_type_mask;
666 client->task = task; 659 client->task = task;
667 client->pid = pid; 660 client->pid = pid;
668 661
@@ -1162,7 +1155,7 @@ static int ion_open(struct inode *inode, struct file *file)
1162 struct ion_client *client; 1155 struct ion_client *client;
1163 1156
1164 pr_debug("%s: %d\n", __func__, __LINE__); 1157 pr_debug("%s: %d\n", __func__, __LINE__);
1165 client = ion_client_create(dev, -1, "user"); 1158 client = ion_client_create(dev, "user");
1166 if (IS_ERR_OR_NULL(client)) 1159 if (IS_ERR_OR_NULL(client))
1167 return PTR_ERR(client); 1160 return PTR_ERR(client);
1168 file->private_data = client; 1161 file->private_data = client;
@@ -1178,7 +1171,7 @@ static const struct file_operations ion_fops = {
1178}; 1171};
1179 1172
1180static size_t ion_debug_heap_total(struct ion_client *client, 1173static size_t ion_debug_heap_total(struct ion_client *client,
1181 enum ion_heap_type type) 1174 unsigned int id)
1182{ 1175{
1183 size_t size = 0; 1176 size_t size = 0;
1184 struct rb_node *n; 1177 struct rb_node *n;
@@ -1188,7 +1181,7 @@ static size_t ion_debug_heap_total(struct ion_client *client,
1188 struct ion_handle *handle = rb_entry(n, 1181 struct ion_handle *handle = rb_entry(n,
1189 struct ion_handle, 1182 struct ion_handle,
1190 node); 1183 node);
1191 if (handle->buffer->heap->type == type) 1184 if (handle->buffer->heap->id == id)
1192 size += handle->buffer->size; 1185 size += handle->buffer->size;
1193 } 1186 }
1194 mutex_unlock(&client->lock); 1187 mutex_unlock(&client->lock);
@@ -1209,7 +1202,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
1209 for (n = rb_first(&dev->clients); n; n = rb_next(n)) { 1202 for (n = rb_first(&dev->clients); n; n = rb_next(n)) {
1210 struct ion_client *client = rb_entry(n, struct ion_client, 1203 struct ion_client *client = rb_entry(n, struct ion_client,
1211 node); 1204 node);
1212 size_t size = ion_debug_heap_total(client, heap->type); 1205 size_t size = ion_debug_heap_total(client, heap->id);
1213 if (!size) 1206 if (!size)
1214 continue; 1207 continue;
1215 if (client->task) { 1208 if (client->task) {
@@ -1230,7 +1223,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
1230 for (n = rb_first(&dev->buffers); n; n = rb_next(n)) { 1223 for (n = rb_first(&dev->buffers); n; n = rb_next(n)) {
1231 struct ion_buffer *buffer = rb_entry(n, struct ion_buffer, 1224 struct ion_buffer *buffer = rb_entry(n, struct ion_buffer,
1232 node); 1225 node);
1233 if (buffer->heap->type != heap->type) 1226 if (buffer->heap->id != heap->id)
1234 continue; 1227 continue;
1235 total_size += buffer->size; 1228 total_size += buffer->size;
1236 if (!buffer->handle_count) { 1229 if (!buffer->handle_count) {
diff --git a/include/linux/ion.h b/include/linux/ion.h
index 610665d2be7..a55d11fbcbd 100644
--- a/include/linux/ion.h
+++ b/include/linux/ion.h
@@ -126,7 +126,6 @@ void ion_reserve(struct ion_platform_data *data);
126 * @name: used for debugging 126 * @name: used for debugging
127 */ 127 */
128struct ion_client *ion_client_create(struct ion_device *dev, 128struct ion_client *ion_client_create(struct ion_device *dev,
129 unsigned int heap_type_mask,
130 const char *name); 129 const char *name);
131 130
132/** 131/**