Commit 2bb9f503 authored by Rebecca Schultz Zavin's avatar Rebecca Schultz Zavin Committed by Greg Kroah-Hartman

gpu: ion: Remove heapmask from client

The heapmask in the client generally wasn't being used.  This
patch removes it.
Signed-off-by: default avatarRebecca Schultz Zavin <rebecca@android.com>
[jstultz: modified patch to apply to staging directory]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9122fe86
...@@ -63,7 +63,6 @@ struct ion_device { ...@@ -63,7 +63,6 @@ struct ion_device {
* @dev: backpointer to ion device * @dev: backpointer to ion device
* @handles: an rb tree of all the handles in this client * @handles: an rb tree of all the handles in this client
* @lock: lock protecting the tree of handles * @lock: lock protecting the tree of handles
* @heap_type_mask: mask of all supported heap types
* @name: used for debugging * @name: used for debugging
* @task: used for debugging * @task: used for debugging
* *
...@@ -76,7 +75,6 @@ struct ion_client { ...@@ -76,7 +75,6 @@ struct ion_client {
struct ion_device *dev; struct ion_device *dev;
struct rb_root handles; struct rb_root handles;
struct mutex lock; struct mutex lock;
unsigned int heap_type_mask;
const char *name; const char *name;
struct task_struct *task; struct task_struct *task;
pid_t pid; pid_t pid;
...@@ -410,9 +408,6 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len, ...@@ -410,9 +408,6 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
down_read(&dev->lock); down_read(&dev->lock);
plist_for_each_entry(heap, &dev->heaps, node) { plist_for_each_entry(heap, &dev->heaps, node) {
/* if the client doesn't support this heap type */
if (!((1 << heap->type) & client->heap_type_mask))
continue;
/* if the caller didn't specify this heap id */ /* if the caller didn't specify this heap id */
if (!((1 << heap->id) & heap_id_mask)) if (!((1 << heap->id) & heap_id_mask))
continue; continue;
...@@ -627,7 +622,6 @@ static const struct file_operations debug_client_fops = { ...@@ -627,7 +622,6 @@ static const struct file_operations debug_client_fops = {
}; };
struct ion_client *ion_client_create(struct ion_device *dev, struct ion_client *ion_client_create(struct ion_device *dev,
unsigned int heap_type_mask,
const char *name) const char *name)
{ {
struct ion_client *client; struct ion_client *client;
...@@ -662,7 +656,6 @@ struct ion_client *ion_client_create(struct ion_device *dev, ...@@ -662,7 +656,6 @@ struct ion_client *ion_client_create(struct ion_device *dev,
client->handles = RB_ROOT; client->handles = RB_ROOT;
mutex_init(&client->lock); mutex_init(&client->lock);
client->name = name; client->name = name;
client->heap_type_mask = heap_type_mask;
client->task = task; client->task = task;
client->pid = pid; client->pid = pid;
...@@ -1162,7 +1155,7 @@ static int ion_open(struct inode *inode, struct file *file) ...@@ -1162,7 +1155,7 @@ static int ion_open(struct inode *inode, struct file *file)
struct ion_client *client; struct ion_client *client;
pr_debug("%s: %d\n", __func__, __LINE__); pr_debug("%s: %d\n", __func__, __LINE__);
client = ion_client_create(dev, -1, "user"); client = ion_client_create(dev, "user");
if (IS_ERR_OR_NULL(client)) if (IS_ERR_OR_NULL(client))
return PTR_ERR(client); return PTR_ERR(client);
file->private_data = client; file->private_data = client;
...@@ -1178,7 +1171,7 @@ static const struct file_operations ion_fops = { ...@@ -1178,7 +1171,7 @@ static const struct file_operations ion_fops = {
}; };
static size_t ion_debug_heap_total(struct ion_client *client, static size_t ion_debug_heap_total(struct ion_client *client,
enum ion_heap_type type) unsigned int id)
{ {
size_t size = 0; size_t size = 0;
struct rb_node *n; struct rb_node *n;
...@@ -1188,7 +1181,7 @@ static size_t ion_debug_heap_total(struct ion_client *client, ...@@ -1188,7 +1181,7 @@ static size_t ion_debug_heap_total(struct ion_client *client,
struct ion_handle *handle = rb_entry(n, struct ion_handle *handle = rb_entry(n,
struct ion_handle, struct ion_handle,
node); node);
if (handle->buffer->heap->type == type) if (handle->buffer->heap->id == id)
size += handle->buffer->size; size += handle->buffer->size;
} }
mutex_unlock(&client->lock); mutex_unlock(&client->lock);
...@@ -1209,7 +1202,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused) ...@@ -1209,7 +1202,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
for (n = rb_first(&dev->clients); n; n = rb_next(n)) { for (n = rb_first(&dev->clients); n; n = rb_next(n)) {
struct ion_client *client = rb_entry(n, struct ion_client, struct ion_client *client = rb_entry(n, struct ion_client,
node); node);
size_t size = ion_debug_heap_total(client, heap->type); size_t size = ion_debug_heap_total(client, heap->id);
if (!size) if (!size)
continue; continue;
if (client->task) { if (client->task) {
...@@ -1230,7 +1223,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused) ...@@ -1230,7 +1223,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
for (n = rb_first(&dev->buffers); n; n = rb_next(n)) { for (n = rb_first(&dev->buffers); n; n = rb_next(n)) {
struct ion_buffer *buffer = rb_entry(n, struct ion_buffer, struct ion_buffer *buffer = rb_entry(n, struct ion_buffer,
node); node);
if (buffer->heap->type != heap->type) if (buffer->heap->id != heap->id)
continue; continue;
total_size += buffer->size; total_size += buffer->size;
if (!buffer->handle_count) { if (!buffer->handle_count) {
......
...@@ -124,7 +124,6 @@ void ion_reserve(struct ion_platform_data *data); ...@@ -124,7 +124,6 @@ void ion_reserve(struct ion_platform_data *data);
* @name: used for debugging * @name: used for debugging
*/ */
struct ion_client *ion_client_create(struct ion_device *dev, struct ion_client *ion_client_create(struct ion_device *dev,
unsigned int heap_type_mask,
const char *name); const char *name);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment