From patchwork Wed Feb 12 07:35:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3634601 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D4F879F382 for ; Wed, 12 Feb 2014 07:35:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AA282015D for ; Wed, 12 Feb 2014 07:35:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2D52E20142 for ; Wed, 12 Feb 2014 07:35:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADD41FAC40; Tue, 11 Feb 2014 23:35:11 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f51.google.com (mail-bk0-f51.google.com [209.85.214.51]) by gabe.freedesktop.org (Postfix) with ESMTP id 299ADFAC40 for ; Tue, 11 Feb 2014 23:35:09 -0800 (PST) Received: by mail-bk0-f51.google.com with SMTP id w10so2524003bkz.38 for ; Tue, 11 Feb 2014 23:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=EtkF3Ha1SPQjC8EMYdGKHp3HywOg9BFryRI2VWRzn4g=; b=VbVgrgSDO8SkIePwZXzy0EUvAf8w7a0j8j4T5qFIdtYKMnYl9hlsQGDhrYECNVjU49 yGF4tN0aUn4/Ner9a8y2VA53x2zetljtPgp+9K48ErPCL9DC5LLh6j2f8Wf0kZIOoszg lodQVBhFPZG59d5NxehkeGpP+wV4pzmDEgzsTml9Xjj208rAwBqC9cIO03i6sUium10g UOAALVo/adcul1dPw67h4ujuU7i+y/CKwMMg+r5I44FY9KkLhna3WVFYJUxUZi2anZ5b oekpbkLHEhoS1LooaEL7+zSivlYLG/TFVByoa37FiDhfXbD+lS80gEPSlk6G9FL3Rv7/ rVLQ== X-Received: by 10.205.2.9 with SMTP id ns9mr60393bkb.29.1392190509305; Tue, 11 Feb 2014 23:35:09 -0800 (PST) Received: from localhost (port-54112.pppoe.wtnet.de. [46.59.212.13]) by mx.google.com with ESMTPSA id x9sm17161845bkh.12.2014.02.11.23.35.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Feb 2014 23:35:08 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/tegra: prime: Add vmap support Date: Wed, 12 Feb 2014 08:35:05 +0100 Message-Id: <1392190505-2575-1-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4.2 Cc: linux-tegra@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is trivial to support since all GEM objects are mapped into kernel space anyway. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/gem.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index ef853e558036..29913eb9b25d 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -394,6 +394,18 @@ static int tegra_gem_prime_mmap(struct dma_buf *buf, struct vm_area_struct *vma) return -EINVAL; } +static void *tegra_gem_prime_vmap(struct dma_buf *buf) +{ + struct drm_gem_object *gem = buf->priv; + struct tegra_bo *bo = to_tegra_bo(gem); + + return bo->vaddr; +} + +static void tegra_gem_prime_vunmap(struct dma_buf *buf, void *vaddr) +{ +} + static const struct dma_buf_ops tegra_gem_prime_dmabuf_ops = { .map_dma_buf = tegra_gem_prime_map_dma_buf, .unmap_dma_buf = tegra_gem_prime_unmap_dma_buf, @@ -403,6 +415,8 @@ static const struct dma_buf_ops tegra_gem_prime_dmabuf_ops = { .kmap = tegra_gem_prime_kmap, .kunmap = tegra_gem_prime_kunmap, .mmap = tegra_gem_prime_mmap, + .vmap = tegra_gem_prime_vmap, + .vunmap = tegra_gem_prime_vunmap, }; struct dma_buf *tegra_gem_prime_export(struct drm_device *drm,