Received: by 10.223.176.5 with SMTP id f5csp387644wra; Tue, 30 Jan 2018 13:10:53 -0800 (PST) X-Google-Smtp-Source: AH8x2279EA2u06SGab+JEu8cWg/GKPhQtVOQKltV5w/Hi2VBym6h3uomhYQ+7/eedifoHOW4Ssyb X-Received: by 10.98.131.200 with SMTP id h191mr31363315pfe.149.1517346653450; Tue, 30 Jan 2018 13:10:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517346653; cv=none; d=google.com; s=arc-20160816; b=xnXdpas2VY53Jqos3eR1jjpLf3CZ7C7m6t3ht3kCScvyfp6PgiFDWmY9YSjV1zaIRe qJeDJem6K1oy3FZaJ3SIDWVyYy6dMJ5GGQoPPv11oJ6xTpW6x4EdLfNuIfoQl63IDmiS iKyo/ubWhkx9zbNysGpULxc8RT4VSgQ1+N6HYQs8ot7gAB3alqKPkY7L8tz0g7N9wFgK nf/zytF4Aad+QlksUccpYf3xpi8+Ua4EPKy/9IhN4Sh4fDd2F5NCoNd/cXVF9aLDUw3M SDd31jhDC7sI2VVW3iyorMz33bMqcRGQYwv3PZwZokC/BW0ozCWTCCXhPCtU/tt1ruu9 S4uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=N6BfKTBJyunY30wv7S/OWHeC3E6C1PVZWTamTmfqs7c=; b=0rmuThnEOYPkd9Huabbo1mt1cObY2hzJz7b+885xM7baviBAbPRw7XBmS0RAh3x94u 6hm1sEUa54eBxjcB5j3Gp8nypKmlMPXOg8d6FQkasWesBAMMdpUYnhe/rM+HzGULuSMw S00lK9O/v7x9D2P9a+jbyYQ95S9UbnAaFGEpkAg9/Je8Puo9a1aBRob09ctDicV0vf0E kBxyn14Jbwyp2MoBKFDYR7xP3tRHbA6Z2mkuC9vG73VRPjg6F/wZiTewHVqWwLUKsx8R 7GSaIYY2QDuKZ8X8RzwWpPR/VQ5yM4ikRZ+ulbg6aYdAQjyueuCaQJnNEcAfcQh8l4yZ PzEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si9853103pgv.810.2018.01.30.13.10.38; Tue, 30 Jan 2018 13:10:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753154AbeA3Uj1 (ORCPT + 99 others); Tue, 30 Jan 2018 15:39:27 -0500 Received: from mga18.intel.com ([134.134.136.126]:52535 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752199AbeA3Uj0 (ORCPT ); Tue, 30 Jan 2018 15:39:26 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2018 12:39:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,436,1511856000"; d="scan'208";a="30715122" Received: from alexey-system-product-name.iil.intel.com ([10.236.193.125]) by orsmga002.jf.intel.com with ESMTP; 30 Jan 2018 12:39:23 -0800 From: Alexey Skidanov To: devel@driverdev.osuosl.org, labbott@redhat.com, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Alexey Skidanov Subject: [PATCH v2] staging: android: ion: Add implementation of dma_buf_vmap and dma_buf_vunmap Date: Tue, 30 Jan 2018 22:39:13 +0200 Message-Id: <1517344753-29021-1-git-send-email-alexey.skidanov@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dma_buf_vmap and dma_buf_vunmap allow drivers to access buffers, created by ion. Signed-off-by: Alexey Skidanov --- Changes in v1: - Added changelog text drivers/staging/android/ion/ion.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index f480885..4f1dc7f 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -327,6 +327,17 @@ static void ion_dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long offset, { } +static void *ion_dma_buf_vmap(struct dma_buf *dmabuf) +{ + struct ion_buffer *buffer = dmabuf->priv; + + return buffer->vaddr; +} + +static void ion_dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr) +{ +} + static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, enum dma_data_direction direction) { @@ -388,6 +399,8 @@ static const struct dma_buf_ops dma_buf_ops = { .unmap_atomic = ion_dma_buf_kunmap, .map = ion_dma_buf_kmap, .unmap = ion_dma_buf_kunmap, + .vmap = ion_dma_buf_vmap, + .vunmap = ion_dma_buf_vunmap }; int ion_alloc(size_t len, unsigned int heap_id_mask, unsigned int flags) -- 2.7.4