From patchwork Fri Dec 13 22:24:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22421 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D6C6C23FBA for ; Fri, 13 Dec 2013 22:27:37 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id i4sf9164122oah.2 for ; Fri, 13 Dec 2013 14:27:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=sez3T/ND4RyfunoKwj0BmqSRbzbs3ti42SI33lW2Akg=; b=UPzrbHNibQw10EmZqyln6JdePdFFanDc8EmhjLD5xBqfWRtFwg8WkoxNrjZjow+/3P iF6zFbi/WIN9q2UvYfajtrUXfyT22NBnJ9LZdOnpHuQCPL7/kitmfZBguULxr/+jeQ6P doQni0EVGfEJQB8g2zrNib087WECMzAAndUp0UlNuECxqzLEctHhi6xE3eqCHqyfufRA URHf3sfLE2dUauStEw6/oj1qEqtk0vBaLjm/uv9VmJvRfeckALjobP8RLK7yA/sR7BlW AVDWczOCcVUBXdfSY1CBMsc2KHq50HhCQ+WyAT7reJoNdzqmK35NDegTo41HAS0r0kA4 ffJA== X-Gm-Message-State: ALoCoQlY/0laJJojIOwogaYvjcDZ+XErldkuFRx51kpKy8mqLuGi7Zos8mRSpCnsVBGiPj5rtphS X-Received: by 10.182.87.225 with SMTP id bb1mr1916282obb.16.1386973657437; Fri, 13 Dec 2013 14:27:37 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.38.36 with SMTP id d4ls1188711qek.7.gmail; Fri, 13 Dec 2013 14:27:37 -0800 (PST) X-Received: by 10.52.245.132 with SMTP id xo4mr1833746vdc.64.1386973657305; Fri, 13 Dec 2013 14:27:37 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id tl2si1196338vdc.51.2013.12.13.14.27.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:37 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ks9so1765948vcb.12 for ; Fri, 13 Dec 2013 14:27:37 -0800 (PST) X-Received: by 10.220.189.2 with SMTP id dc2mr491305vcb.60.1386973657201; Fri, 13 Dec 2013 14:27:37 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp73560vcz; Fri, 13 Dec 2013 14:27:36 -0800 (PST) X-Received: by 10.66.249.202 with SMTP id yw10mr5840288pac.111.1386973656393; Fri, 13 Dec 2013 14:27:36 -0800 (PST) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by mx.google.com with ESMTPS id 5si2504898pbj.185.2013.12.13.14.27.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.49 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.49; Received: by mail-pb0-f49.google.com with SMTP id jt11so3133025pbb.22 for ; Fri, 13 Dec 2013 14:27:36 -0800 (PST) X-Received: by 10.68.25.229 with SMTP id f5mr6253008pbg.6.1386973655985; Fri, 13 Dec 2013 14:27:35 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id qz9sm7457908pbc.3.2013.12.13.14.27.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:35 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , Rebecca Schultz Zavin , John Stultz Subject: [PATCH 056/115] gpu: ion: Remove heapmask from client Date: Fri, 13 Dec 2013 14:24:30 -0800 Message-Id: <1386973529-4884-57-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> References: <1386973529-4884-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Rebecca Schultz Zavin The heapmask in the client generally wasn't being used. This patch removes it. Signed-off-by: Rebecca Schultz Zavin [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz --- drivers/staging/android/ion/ion.c | 17 +++++------------ drivers/staging/android/ion/ion.h | 1 - 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 7c25d9f..054e672 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -63,7 +63,6 @@ struct ion_device { * @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 * @@ -76,7 +75,6 @@ struct ion_client { 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; @@ -410,9 +408,6 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len, 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; @@ -627,7 +622,6 @@ static const struct file_operations debug_client_fops = { }; struct ion_client *ion_client_create(struct ion_device *dev, - unsigned int heap_type_mask, const char *name) { struct ion_client *client; @@ -662,7 +656,6 @@ struct ion_client *ion_client_create(struct ion_device *dev, client->handles = RB_ROOT; mutex_init(&client->lock); client->name = name; - client->heap_type_mask = heap_type_mask; client->task = task; client->pid = pid; @@ -1162,7 +1155,7 @@ static int ion_open(struct inode *inode, struct file *file) 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; @@ -1178,7 +1171,7 @@ static const struct file_operations ion_fops = { }; 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; @@ -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, node); - if (handle->buffer->heap->type == type) + if (handle->buffer->heap->id == id) size += handle->buffer->size; } mutex_unlock(&client->lock); @@ -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)) { 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) { @@ -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)) { 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/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index a315858..0f67014f 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -124,7 +124,6 @@ void ion_reserve(struct ion_platform_data *data); * @name: used for debugging */ struct ion_client *ion_client_create(struct ion_device *dev, - unsigned int heap_type_mask, const char *name); /**