linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: zach.pfeffer@linaro.org (Zach Pfeffer)
To: linux-arm-kernel@lists.infradead.org
Subject: [Linaro-mm-sig] [RFC 0/2] ARM: DMA-mapping & IOMMU integration
Date: Tue, 14 Jun 2011 14:10:04 -0500	[thread overview]
Message-ID: <BANLkTimXdVqAXP7nQLE=y79xOOJ1a5ayOw@mail.gmail.com> (raw)
In-Reply-To: <20110614112108.0186c562@jbarnes-desktop>

On 14 June 2011 13:21, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> On Tue, 14 Jun 2011 11:15:38 -0700
> "Michael K. Edwards" <m.k.edwards@gmail.com> wrote:
>> What doesn't seem to be straightforward to do from userland is to
>> allocate pages that are locked to physical memory and mapped for
>> write-combining. ?The device driver shouldn't have to mediate their
>> allocation, just map to a physical address (or set up an IOMMU entry,
>> I suppose) and pass that to the hardware that needs it. ?Typical
>> userland code that could use such a mechanism would be the Qt/OpenGL
>> back end (which needs to store decompressed images and other
>> pre-rendered assets in GPU-ready buffers) and media pipelines.
>
> We try to avoid allowing userspace to pin arbitrary buffers though. ?So
> on the gfx side, userspace can allocate buffers, but they're only
> actually pinned when some operation is performed on them (e.g. they're
> referenced in a command buffer or used for a mode set operation).
>
> Something like ION or GEM can provide the basic alloc & map API, but
> the platform code still has to deal with grabbing hunks of memory,
> making them uncached or write combine, and mapping them to app space
> without conflicts.
>
>> Also a nice source of sample code; though, again, I don't want this to
>> be driver-specific. ?I might want a stage in my media pipeline that
>> uses the GPU to perform, say, lens distortion correction. ?I shouldn't
>> have to go through contortions to use the same buffers from the GPU
>> and the video capture device. ?The two devices are likely to have
>> their own variants on scatter-gather DMA, with a circularly linked
>> list of block descriptors with ownership bits and all that jazz; but
>> the actual data buffers should be generic, and the userland pipeline
>> setup code should just allocate them (presumably as contiguous regions
>> in a write-combining hugepage) and feed them to the plumbing.
>
> Totally agree. ?That's one reason I don't think enhancing the DMA
> mapping API in the kernel is a complete solution. ?Sure, the platform
> code needs to be able to map buffers to devices and use any available
> IOMMUs, but we still need a userspace API for all of that, with its
> associated changes to the CPU MMU handling.

I haven't seen all the discussions but it sounds like creating the
correct userspace abstraction and then looking at how the kernel needs
to change (instead of the other way around) may add some clarity to
things.

> --
> Jesse Barnes, Intel Open Source Technology Center
>
> _______________________________________________
> Linaro-mm-sig mailing list
> Linaro-mm-sig at lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-mm-sig
>

  reply	other threads:[~2011-06-14 19:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25  7:35 [RFC 0/2] ARM: DMA-mapping & IOMMU integration Marek Szyprowski
2011-06-04 16:13 ` Ohad Ben-Cohen
2011-06-06  6:09   ` Marek Szyprowski
2011-06-13 14:12 ` KyongHo Cho
2011-06-13 15:07   ` Arnd Bergmann
2011-06-13 15:30     ` KyongHo Cho
2011-06-13 15:40       ` Catalin Marinas
2011-06-13 16:00         ` [Linaro-mm-sig] " KyongHo Cho
2011-06-13 17:55           ` Michael K. Edwards
2011-06-13 18:54             ` Jesse Barnes
2011-06-14 18:15               ` Michael K. Edwards
2011-06-14 18:21                 ` Jesse Barnes
2011-06-14 19:10                   ` Zach Pfeffer [this message]
2011-06-14 20:59                   ` Michael K. Edwards
2011-06-13 18:01           ` Catalin Marinas
2011-06-13 15:46       ` Arnd Bergmann
2011-06-13 15:58         ` [Linaro-mm-sig] " KyongHo Cho
2011-06-14  7:46       ` Marek Szyprowski
2011-06-20 14:31 ` Subash Patel
2011-06-20 14:59   ` Marek Szyprowski

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='BANLkTimXdVqAXP7nQLE=y79xOOJ1a5ayOw@mail.gmail.com' \
    --to=zach.pfeffer@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).