linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Sam Ravnborg <sam@ravnborg.org>,
	od@zcrc.me, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org
Subject: Re: [PATCH v2 3/5] drm: Add and export function drm_gem_cma_mmap_noncoherent
Date: Thu, 11 Mar 2021 16:12:55 +0000	[thread overview]
Message-ID: <JPBTPQ.TL10VUKPUBL23@crapouillou.net> (raw)
In-Reply-To: <20210311123642.GA1741910@infradead.org>



Le jeu. 11 mars 2021 à 12:36, Christoph Hellwig <hch@infradead.org> a 
écrit :
> 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/96a546e7229ec53aadbdb7936d1e5e6cb5958952
>>  >
>>  > 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 = 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



  reply	other threads:[~2021-03-12 11:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07 20:28 [PATCH v2 0/5] Add option to mmap GEM buffers cached Paul Cercueil
2021-03-07 20:28 ` [PATCH v2 1/5] drm: Add and export function drm_gem_cma_create_noncoherent Paul Cercueil
2021-03-11 12:23   ` Christoph Hellwig
2021-03-07 20:28 ` [PATCH v2 2/5] drm: Add and export function drm_gem_cma_dumb_create_noncoherent Paul Cercueil
2021-03-07 20:28 ` [PATCH v2 3/5] drm: Add and export function drm_gem_cma_mmap_noncoherent Paul Cercueil
2021-03-11 12:26   ` Christoph Hellwig
2021-03-11 12:32     ` Paul Cercueil
2021-03-11 12:36       ` Christoph Hellwig
2021-03-11 16:12         ` Paul Cercueil [this message]
2021-03-12 16:36           ` Christoph Hellwig
2021-03-07 20:28 ` [PATCH v2 4/5] drm: Add and export function drm_gem_cma_sync_data Paul Cercueil
2021-03-11 12:28   ` Christoph Hellwig
2021-03-11 12:33     ` Paul Cercueil
2021-03-15  7:43       ` Thomas Zimmermann
2021-03-15 11:59         ` Paul Cercueil
2021-03-07 20:28 ` [PATCH v2 5/5] drm/ingenic: Add option to alloc cached GEM buffers Paul Cercueil
2021-03-11 12:30   ` Christoph Hellwig
2021-03-11 13:40     ` Paul Cercueil
2021-03-08  8:41 ` [PATCH v2 0/5] Add option to mmap GEM buffers cached Thomas Zimmermann
2021-03-10 19:02   ` Paul Cercueil
2021-03-11  7:52     ` Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=JPBTPQ.TL10VUKPUBL23@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=od@zcrc.me \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).