From patchwork Fri Dec 13 22:24:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22431 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B30A123FBA for ; Fri, 13 Dec 2013 22:27:53 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id uo5sf7430407pbc.10 for ; Fri, 13 Dec 2013 14:27:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=5giiKX9COJvPkMERHwitJK0hSXDbvUkrgVI6KVJGNXE=; b=EbSR5QssH0K1nHfAoDYqAuXPh64Wh2FDAF1/oejOgNrnvFDZrDbbSe8yLhgh05NC99 3zuLwlMdtgE3zwCpOqu0CWAkK/OgtUFDhtKFhhYVcehTrdEgZ1GShte3zc3D+4ivXpX8 VLGdHCdexr6pT4zYHj+D0Wh0dUuPR0VYL153USV1fpJDl7mg88cmxIlK/S+Lajlkexs5 k9a8NNPddE7w8aGKCQeqPpUs4gDNogQX14YyELAUy501Qcdg93AML9e7AGaB0FRC2BZA d5ExcL1o5XVtiSmXSEH08GHfUsGPCgiuyfLfujRiaSf1wQ3GYpBOVOl6jpzc2JjbrKDp OzvA== X-Gm-Message-State: ALoCoQmC/LsdIJ7Z7VmhT9pSMv0C7D9xhLCT6mEtfhwsVNCAXV61k5jpMfMAu7Sl5HyIYurRvesv X-Received: by 10.68.237.37 with SMTP id uz5mr3170542pbc.0.1386973673010; Fri, 13 Dec 2013 14:27:53 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.9 with SMTP id z9ls1153972qem.79.gmail; Fri, 13 Dec 2013 14:27:52 -0800 (PST) X-Received: by 10.52.50.177 with SMTP id d17mr1850373vdo.23.1386973672761; Fri, 13 Dec 2013 14:27:52 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id sm7si1184767vdc.149.2013.12.13.14.27.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:52 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so1815604veb.7 for ; Fri, 13 Dec 2013 14:27:52 -0800 (PST) X-Received: by 10.52.103.35 with SMTP id ft3mr1866784vdb.5.1386973672697; Fri, 13 Dec 2013 14:27:52 -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 u4csp73577vcz; Fri, 13 Dec 2013 14:27:52 -0800 (PST) X-Received: by 10.66.163.74 with SMTP id yg10mr6016471pab.85.1386973671918; Fri, 13 Dec 2013 14:27:51 -0800 (PST) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id zi8si2506478pac.127.2013.12.13.14.27.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.50; Received: by mail-pb0-f50.google.com with SMTP id rr13so3142374pbb.37 for ; Fri, 13 Dec 2013 14:27:51 -0800 (PST) X-Received: by 10.66.163.164 with SMTP id yj4mr5921215pab.91.1386973671527; Fri, 13 Dec 2013 14:27:51 -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.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:27:50 -0800 (PST) From: John Stultz To: LKML Cc: Greg KH , Android Kernel Team , Sumit Semwal , Jesse Barker , Colin Cross , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , John Stultz Subject: [PATCH 066/115] gpu: ion: __dma_page_cpu_to_dev -> arm_dma_ops.sync_single_for_device hack Date: Fri, 13 Dec 2013 14:24:40 -0800 Message-Id: <1386973529-4884-67-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> MIME-Version: 1.0 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.128.176 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: Arve Hjønnevåg Signed-off-by: Arve Hjønnevåg [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_chunk_heap.c | 10 ++++++---- drivers/staging/android/ion/ion_page_pool.c | 6 ++++-- drivers/staging/android/ion/ion_system_heap.c | 5 +++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 4c2f223..410c08e 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -105,8 +105,9 @@ static void ion_chunk_heap_free(struct ion_buffer *buffer) for_each_sg(table->sgl, sg, table->nents, i) { if (ion_buffer_cached(buffer)) - __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), - DMA_BIDIRECTIONAL); + arm_dma_ops.sync_single_for_device(NULL, + pfn_to_dma(NULL, page_to_pfn(sg_page(sg))), + sg_dma_len(sg), DMA_BIDIRECTIONAL); gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), sg_dma_len(sg)); } @@ -177,8 +178,9 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data) } free_vm_area(vm_struct); - __dma_page_cpu_to_dev(phys_to_page(heap_data->base), 0, heap_data->size, - DMA_BIDIRECTIONAL); + arm_dma_ops.sync_single_for_device(NULL, + pfn_to_dma(NULL, page_to_pfn(phys_to_page(heap_data->base))), + heap_data->size, DMA_BIDIRECTIONAL); gen_pool_add(chunk_heap->pool, chunk_heap->base, heap_data->size, -1); chunk_heap->heap.ops = &chunk_heap_ops; chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index d624dee..855f30c 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -37,8 +37,10 @@ static void *ion_page_pool_alloc_pages(struct ion_page_pool *pool) /* this is only being used to flush the page for dma, this api is not really suitable for calling from a driver but no better way to flush a page for dma exist at this time */ - __dma_page_cpu_to_dev(page, 0, PAGE_SIZE << pool->order, - DMA_BIDIRECTIONAL); + arm_dma_ops.sync_single_for_device(NULL, + pfn_to_dma(NULL, page_to_pfn(page)), + PAGE_SIZE << pool->order, + DMA_BIDIRECTIONAL); return page; } diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index fedbc0d..d4f0a56 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -78,8 +78,9 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap, page = alloc_pages(gfp_flags, order); if (!page) return 0; - __dma_page_cpu_to_dev(page, 0, PAGE_SIZE << order, - DMA_BIDIRECTIONAL); + arm_dma_ops.sync_single_for_device(NULL, + pfn_to_dma(NULL, page_to_pfn(page)), + PAGE_SIZE << order, DMA_BIDIRECTIONAL); } if (!page) return 0;