From patchwork Wed Dec 12 01:58:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Peethambaran X-Patchwork-Id: 13485 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2CB8523E27 for ; Wed, 12 Dec 2012 01:58:37 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 9E95BA1837F for ; Wed, 12 Dec 2012 01:58:36 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so194022iag.25 for ; Tue, 11 Dec 2012 17:58:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:mime-version:date:message-id:from:to:subject :x-beenthere:x-mailman-version:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=1P30ZZM/f6SonSFDbRHripdEJtblsbMLXUXNdMKNXJk=; b=UyOncS9dlLbAT2jp30uJCV5pIDQEzslWDleLGfD1izt19iAajTeIo5noIhUUucsLQP FDejSuBOx+idnbXcwqGTXsXozl1dYYDnYVC0m/bP93zWOVmjEgjTIl3DItkLxN+0/nrt IUnp1M8qDBivIDwV8fh4N5Ol7725TJvjzYvxQauGDB/4NHzcxUcbPrQvFgb1G63GWj1+ hwLHzZCrbc7OrL4m8MJjhOO3FQRS+rrwijGg+aqkVvCe05FV8KXeAUK62RtLICnSVdpf eCGbxMq5M7vhN2pvcoHEQ13+gxfcGCmQXPBBNH3m2BVgPV+1GaYyTfEPScdtyMmhwInv ENsw== Received: by 10.50.152.137 with SMTP id uy9mr11775247igb.62.1355277516001; Tue, 11 Dec 2012 17:58:36 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp170399igt; Tue, 11 Dec 2012 17:58:35 -0800 (PST) Received: by 10.14.215.194 with SMTP id e42mr410982eep.32.1355277514484; Tue, 11 Dec 2012 17:58:34 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id g47si59392603eep.75.2012.12.11.17.58.32; Tue, 11 Dec 2012 17:58:34 -0800 (PST) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tibag-0008Qc-BS; Wed, 12 Dec 2012 01:58:30 +0000 Received: from mail-ie0-f176.google.com ([209.85.223.176]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tibae-0008Ok-Ho for linaro-mm-sig@lists.linaro.org; Wed, 12 Dec 2012 01:58:28 +0000 Received: by mail-ie0-f176.google.com with SMTP id 13so504004iea.21 for ; Tue, 11 Dec 2012 17:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=v78xHVhmWVouZiZ8XYYmVeKdKmvraaGtUmiFKG9FB4U=; b=HorlZMEeLgPSuFoQHU64m/tOfqMxMdkpbrWtvokCEue9LOuRQwg14XMyZ4cG38Y8GJ gX0LjH0MBHyhm9E0UFajKTMKCI9sSNqkmsKpRZvfTqkF/QXqL0ERIzAMWm4bdxBshv5A df1pXNjZy06+GFL0qX8OjhSq3ytMzwbCRk6EJAWVIBO0GCMpRXvLKWg5YmF5ePptAdfB 8TElYoRXiOl47RhLEo+QjRdHcc3z86TLN2ylDB6diPK4YU5YbnWRFgX0YuGl6N1kp75W l45fWqXSDsC1pEo42DX2Jz/RboYJMuZDkh5eOdLEPU4nqI1eiWRihVVKYjbnf70Vetmi z5Vw== MIME-Version: 1.0 Received: by 10.50.15.134 with SMTP id x6mr12073301igc.27.1355277507614; Tue, 11 Dec 2012 17:58:27 -0800 (PST) Received: by 10.64.34.170 with HTTP; Tue, 11 Dec 2012 17:58:27 -0800 (PST) Date: Wed, 12 Dec 2012 07:28:27 +0530 Message-ID: From: Nishanth Peethambaran To: linaro-mm-sig@lists.linaro.org, Rebecca Zavin Subject: [Linaro-mm-sig] [PATCH] gpu: ion: Update debugfs show functions to show heap specific info X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQmnv610/Pg1g33fCFT+zGHm9SLFX6OjLq0zGslnUQz9Zx3JQYbxaliE07GEJ3gGO88SmV9A The debugfs show functions for client and heap were showing info for the heap type instead of showing info of the individual heap. Change-Id: Id5afe7963c8ddfafae1f959ce48dd5c2a5fcca07 Signed-off-by: Nishanth Peethambaran --- drivers/gpu/ion/ion.c | 18 +++++++++--------- include/linux/ion.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) * to this allocation diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 6aa817a..48cda5d 100644 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -413,7 +413,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len, /* if the client doesn't support this heap type */ if (!((1 << heap->type) & client->heap_mask)) continue; - /* if the caller didn't specify this heap type */ + /* if the caller didn't specify this heap id */ if (!((1 << heap->id) & heap_mask)) continue; buffer = ion_buffer_create(heap, dev, len, align, flags); @@ -597,11 +597,11 @@ static int ion_debug_client_show(struct seq_file *s, void *unused) for (n = rb_first(&client->handles); n; n = rb_next(n)) { struct ion_handle *handle = rb_entry(n, struct ion_handle, node); - enum ion_heap_type type = handle->buffer->heap->type; + int id = handle->buffer->heap->id; - if (!names[type]) - names[type] = handle->buffer->heap->name; - sizes[type] += handle->buffer->size; + if (!names[id]) + names[id] = handle->buffer->heap->name; + sizes[id] += handle->buffer->size; } mutex_unlock(&client->lock); @@ -1176,7 +1176,7 @@ static const struct file_operations ion_fops = { }; static size_t ion_debug_heap_total(struct ion_client *client, - enum ion_heap_type type) + int id) { size_t size = 0; struct rb_node *n; @@ -1186,7 +1186,7 @@ static size_t ion_debug_heap_total(struct ion_client *client, 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); @@ -1207,7 +1207,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused) 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) { @@ -1228,7 +1228,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused) 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) { diff --git a/include/linux/ion.h b/include/linux/ion.h index a7d399c..d8168fb 100644 --- a/include/linux/ion.h +++ b/include/linux/ion.h @@ -135,7 +135,7 @@ void ion_client_destroy(struct ion_client *client); * @len: size of the allocation * @align: requested allocation alignment, lots of hardware blocks have * alignment requirements of some kind - * @heap_mask: mask of heaps to allocate from, if multiple bits are set + * @heap_mask: mask of heap ids to allocate from, if multiple bits are set * heaps will be tried in order from lowest to highest order bit * @flags: heap flags, the low 16 bits are consumed by ion, the high 16 * bits are passed on to the respective heap and can be heap @@ -236,7 +236,7 @@ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd); * struct ion_allocation_data - metadata passed from userspace for allocations * @len: size of the allocation * @align: required alignment of the allocation - * @heap_mask: mask of heaps to allocate from + * @heap_mask: mask of heap ids to allocate from * @flags: flags passed to heap * @handle: pointer that will be populated with a cookie to use to refer