From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DATE_IN_PAST_12_24, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64A3FC433E0 for ; Fri, 12 Mar 2021 11:52:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E31264FD6 for ; Fri, 12 Mar 2021 11:52:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E31264FD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E0496F5D4; Fri, 12 Mar 2021 11:52:15 +0000 (UTC) Received: from aposti.net (aposti.net [89.234.176.197]) by gabe.freedesktop.org (Postfix) with ESMTPS id CF2F16F5D3 for ; Fri, 12 Mar 2021 11:52:13 +0000 (UTC) Date: Thu, 11 Mar 2021 16:12:55 +0000 From: Paul Cercueil Subject: Re: [PATCH v2 3/5] drm: Add and export function drm_gem_cma_mmap_noncoherent To: Christoph Hellwig Message-Id: In-Reply-To: <20210311123642.GA1741910@infradead.org> References: <20210307202835.253907-1-paul@crapouillou.net> <20210307202835.253907-4-paul@crapouillou.net> <20210311122642.GB1739082@infradead.org> <3I1TPQ.E55GRWWDYVRG@crapouillou.net> <20210311123642.GA1741910@infradead.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , David Airlie , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, od@zcrc.me, dri-devel@lists.freedesktop.org, Sam Ravnborg Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Le jeu. 11 mars 2021 =E0 12:36, Christoph Hellwig a = =E9crit : > On Thu, Mar 11, 2021 at 12:32:27PM +0000, Paul Cercueil wrote: >> > dma_to_phys must not be used by drivers. >> > >> > I have a proper helper for this waiting for users: >> > >> > = >> http://git.infradead.org/users/hch/misc.git/commitdiff/96a546e7229ec53aa= dbdb7936d1e5e6cb5958952 >> > >> > If you can confirm the helpers works for you I can try to still = >> sneak >> > it to Linus for 5.12 to ease the merge pain. >> = >> I can try. How do I get a page pointer from a dma_addr_t? > = > You don't - you get it from using virt_to_page on the pointer returned > from dma_alloc_noncoherent. That beind said to keep the API sane I > should probably add a wrapper that does that for you. I tested using: ret =3D dma_mmap_pages(cma_obj->base.dev->dev, vma, vma->vm_end - vma->vm_start, virt_to_page(cma_obj->vaddr)); It works fine. I think I can use remap_pfn_range() for now, and switch to your new API = once it's available in drm-misc-next. Cheers, -Paul _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel