From patchwork Fri Dec 13 22:23:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22375 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4C89023FBA for ; Fri, 13 Dec 2013 22:26:23 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id w5sf4317576vbf.1 for ; Fri, 13 Dec 2013 14:26:23 -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=xFzP4ZqGS1ar5a/dIBHz9lhJq45O6LI5ImX9IwjaJ5I=; b=g6BbhY5igkf1WHxwRAszoR2nFOE1XycPOlq95DWLGFrFO9nG1hJnJha5c6HwrFLlMj RQPaP6OYZ66MopthcfRzPUzG31tB2I7aIWSxdgKDmMmJEXks4t9hnU0vhsNrt/J+UNmA FHsGlDCqmQjGSbmeol5tWmaDNAqhhxy8nwLKvIrs2SL2GnCNxrLynpptVmvVY9/L1BH8 dTsFg8i8y1WJu2ibq/hA8E7YpnwJJOKmxYTRjR89BUPSqsqEJWWxTE5UrSmKzYCMcdUI tJTwbXl1O4OlzmBbya3IokqgBcMD19CmJyv/WUTPrizVaqqCsTZA/6DzfYyBMfnUKl57 GTwQ== X-Gm-Message-State: ALoCoQknyGeSFIxlcGaXvWGA+nc09J0z18/AsCQfeZ0uncdSFrl0m/FJ+O23IfeCqsAP2mFmuOZ+ X-Received: by 10.224.104.8 with SMTP id m8mr1867946qao.0.1386973583143; Fri, 13 Dec 2013 14:26:23 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.116.42 with SMTP id jt10ls1103285qeb.66.gmail; Fri, 13 Dec 2013 14:26:22 -0800 (PST) X-Received: by 10.220.177.132 with SMTP id bi4mr2194094vcb.49.1386973582955; Fri, 13 Dec 2013 14:26:22 -0800 (PST) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id a6si1195328vdp.52.2013.12.13.14.26.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.169 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.169; Received: by mail-vc0-f169.google.com with SMTP id hu19so1761552vcb.0 for ; Fri, 13 Dec 2013 14:26:22 -0800 (PST) X-Received: by 10.58.186.198 with SMTP id fm6mr2260792vec.16.1386973582880; Fri, 13 Dec 2013 14:26:22 -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 u4csp73456vcz; Fri, 13 Dec 2013 14:26:22 -0800 (PST) X-Received: by 10.69.18.234 with SMTP id gp10mr5867850pbd.105.1386973582056; Fri, 13 Dec 2013 14:26:22 -0800 (PST) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id am2si2503110pad.125.2013.12.13.14.26.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.45; Received: by mail-pb0-f45.google.com with SMTP id rp16so3149681pbb.4 for ; Fri, 13 Dec 2013 14:26:21 -0800 (PST) X-Received: by 10.68.106.130 with SMTP id gu2mr5948208pbb.59.1386973581665; Fri, 13 Dec 2013 14:26:21 -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.26.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:26:21 -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 010/115] gpu: ion: Get an sg_table from an ion handle Date: Fri, 13 Dec 2013 14:23:44 -0800 Message-Id: <1386973529-4884-11-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.169 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 This patch adds an interface to return and sg_table given a valid ion handle. 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 | 8 ++------ drivers/staging/android/ion/ion.h | 13 ++++++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index b95202b..7ff9983 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -616,8 +616,8 @@ void ion_client_destroy(struct ion_client *client) kfree(client); } -struct sg_table *ion_map_dma(struct ion_client *client, - struct ion_handle *handle) +struct sg_table *ion_sg_table(struct ion_client *client, + struct ion_handle *handle) { struct ion_buffer *buffer; struct sg_table *table; @@ -635,10 +635,6 @@ struct sg_table *ion_map_dma(struct ion_client *client, return table; } -void ion_unmap_dma(struct ion_client *client, struct ion_handle *handle) -{ -} - static struct sg_table *ion_map_dma_buf(struct dma_buf_attachment *attachment, enum dma_data_direction direction) { diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index 84ca2a9..28810c8 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -149,7 +149,7 @@ void ion_free(struct ion_client *client, struct ion_handle *handle); * This function queries the heap for a particular handle to get the * handle's physical address. It't output is only correct if * a heap returns physically contiguous memory -- in other cases - * this api should not be implemented -- ion_map_dma should be used + * this api should not be implemented -- ion_sg_table should be used * instead. Returns -EINVAL if the handle is invalid. This has * no implications on the reference counting of the handle -- * the returned value may not be valid if the caller is not @@ -159,6 +159,17 @@ int ion_phys(struct ion_client *client, struct ion_handle *handle, ion_phys_addr_t *addr, size_t *len); /** + * ion_map_dma - return an sg_table describing a handle + * @client: the client + * @handle: the handle + * + * This function returns the sg_table describing + * a particular ion handle. + */ +struct sg_table *ion_sg_table(struct ion_client *client, + struct ion_handle *handle); + +/** * ion_map_kernel - create mapping for the given handle * @client: the client * @handle: handle to map