From patchwork Wed Sep 5 06:44:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 11183 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 37CF623F26 for ; Wed, 5 Sep 2012 06:45:37 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3C00DA1883C for ; Wed, 5 Sep 2012 06:44:44 +0000 (UTC) Received: by ieak11 with SMTP id k11so364320iea.11 for ; Tue, 04 Sep 2012 23:45:36 -0700 (PDT) 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:from:to :date:message-id:x-mailer:in-reply-to:references :x-originalarrivaltime:cc:subject:x-beenthere:x-mailman-version :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=j7xxshDZwMYxf/Kc9L7mfpOKimIyCTKDRFAwbzyxws8=; b=bq/ukj3MQHQB04EpOSVtEVdup9qe051NQXrR7EV/gEWnO1VNdUosF3vWYobVZbLkmY J93BO0XZhyk3nD31Qd1bhVvzZ/vpOQy+Mt0AnHg6zl5ikUC/h3yBBPwIzUJueKOIp+Mz 9wTyhVt1LprbEPrj6jojZl+w5ETYdMd9ZlfD8hUheKLSH48rcy/XgSI05o0AA2SBKJ+Y nLbMtxUOkuTWb9mFMwULaSfABbXArV7RhPnqehcvBXT7KoW2fPu7q4cbqMpSCRX4AfL4 rvdOg3cPRro9gOrxMWlQLkDi6+RBV6XzftCWHbpsro9XVzbnAlCS3lN8Oqk6xDKYx1Xt Wuqg== Received: by 10.50.45.162 with SMTP id o2mr16963857igm.0.1346827536014; Tue, 04 Sep 2012 23:45:36 -0700 (PDT) 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.184.232 with SMTP id ex8csp236076igc; Tue, 4 Sep 2012 23:45:34 -0700 (PDT) Received: by 10.216.85.130 with SMTP id u2mr12473636wee.202.1346827533745; Tue, 04 Sep 2012 23:45:33 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id h18si1138781wiw.39.2012.09.04.23.45.32; Tue, 04 Sep 2012 23:45:33 -0700 (PDT) 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 1T99Mh-0003v2-LH; Wed, 05 Sep 2012 06:45:31 +0000 Received: from na3sys009aog131.obsmtp.com ([74.125.149.247]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T99Mf-0003W5-Gf for linaro-mm-sig@lists.linaro.org; Wed, 05 Sep 2012 06:45:29 +0000 Received: from MSI-MTA.marvell.com ([65.219.4.132]) (using TLSv1) by na3sys009aob131.postini.com ([74.125.148.12]) with SMTP ID DSNKUEb053Av50bwLgCn14W1U3IewWgY87ir@postini.com; Tue, 04 Sep 2012 23:45:29 PDT Received: from maili.marvell.com ([10.68.76.210]) by MSI-MTA.marvell.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 4 Sep 2012 23:44:37 -0700 Received: from localhost (unknown [10.26.128.111]) by maili.marvell.com (Postfix) with ESMTP id 74FEE4E510; Tue, 4 Sep 2012 23:44:37 -0700 (PDT) From: Zhangfei Gao To: Rebecca Schultz Zavin , "linaro-mm-sig@lists.linaro.org" , Haojian Zhuang , Nishanth Peethambaran Date: Wed, 5 Sep 2012 14:44:33 +0800 Message-Id: <1346827474-19709-2-git-send-email-zhangfei.gao@marvell.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1346827474-19709-1-git-send-email-zhangfei.gao@marvell.com> References: <1346827474-19709-1-git-send-email-zhangfei.gao@marvell.com> X-OriginalArrivalTime: 05 Sep 2012 06:44:37.0605 (UTC) FILETIME=[EB020950:01CD8B31] Cc: Nishanth Peethambaran Subject: [Linaro-mm-sig] [PATCH 1/2] gpu: ion: Update debugfs to show for each id 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: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQkGGHWpJJxbNyo8P6+XJ46oKqq1ybx69NmS/N312udjx5dxeKmX4gY1UZ2HE84nJnDHqXz/ From: Nishanth Peethambaran Update the debugfs read of client and heap to show based on 'id' instead of 'type'. Multiple heaps of the same type can be present, but id is unique. Signed-off-by: Nishanth Peethambaran --- drivers/gpu/ion/ion.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 207d00f..96f9cd7 100644 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -579,11 +579,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); @@ -1153,7 +1153,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; @@ -1163,7 +1163,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); @@ -1184,7 +1184,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) {