* @dev: backpointer to ion device
* @handles: an rb tree of all the handles in this client
* @lock: lock protecting the tree of handles
- * @heap_type_mask: mask of all supported heap types
* @name: used for debugging
* @task: used for debugging
*
struct ion_device *dev;
struct rb_root handles;
struct mutex lock;
- unsigned int heap_type_mask;
const char *name;
struct task_struct *task;
pid_t pid;
down_read(&dev->lock);
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 (!((1 << heap->id) & heap_id_mask))
continue;
};
struct ion_client *ion_client_create(struct ion_device *dev,
- unsigned int heap_type_mask,
const char *name)
{
struct ion_client *client;
client->handles = RB_ROOT;
mutex_init(&client->lock);
client->name = name;
- client->heap_type_mask = heap_type_mask;
client->task = task;
client->pid = pid;
struct ion_client *client;
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))
return PTR_ERR(client);
file->private_data = client;
};
static size_t ion_debug_heap_total(struct ion_client *client,
- enum ion_heap_type type)
+ unsigned int id)
{
size_t size = 0;
struct rb_node *n;
struct ion_handle *handle = rb_entry(n,
struct ion_handle,
node);
- if (handle->buffer->heap->type == type)
+ if (handle->buffer->heap->id == id)
size += handle->buffer->size;
}
mutex_unlock(&client->lock);
for (n = rb_first(&dev->clients); n; n = rb_next(n)) {
struct ion_client *client = rb_entry(n, struct ion_client,
node);
- size_t size = ion_debug_heap_total(client, heap->type);
+ size_t size = ion_debug_heap_total(client, heap->id);
if (!size)
continue;
if (client->task) {
for (n = rb_first(&dev->buffers); n; n = rb_next(n)) {
struct ion_buffer *buffer = rb_entry(n, struct ion_buffer,
node);
- if (buffer->heap->type != heap->type)
+ if (buffer->heap->id != heap->id)
continue;
total_size += buffer->size;
if (!buffer->handle_count) {