[Intel-gfx] [PATCH 16/16] drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl
Chris Wilson
chris at chris-wilson.co.uk
Sat Dec 1 00:57:10 CET 2012
On Sat, 1 Dec 2012 00:06:43 +0100, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Thu, Nov 15, 2012 at 11:32:31AM +0000, Chris Wilson wrote:
> > By exporting the ability to map user address and inserting PTEs
> > representing their backing pages into the GTT, we can exploit UMA in order
> > to utilize normal application data as a texture source or even as a
> > render target (depending upon the capabilities of the chipset). This has
> > a number of uses, with zero-copy downloads to the GPU and efficient
> > readback making the intermixed streaming of CPU and GPU operations
> > fairly efficient. This ability has many widespread implications from
> > faster rendering of client-side software rasterisers (chromium),
> > mitigation of stalls due to read back (firefox) and to faster pipelining
> > of texture data (such as pixel buffer objects in GL).
> - gem api review in the view of these strange new objects - e.g. I think
> disallowing flink and dma_buf export would make sense here. I also
> think that tiling doesn't make much sense, at least if userspace doesn't
> want it's memory to get swizzled once a while ...
Over the course of the years this has been sitting around, I've
changed my mind. Originally, I thought it would be wise to prevent
userspace from trying to do things like pwrite, mmap-gtt, or set tiling.
However, there is nothing fundamental in the hardware that prevents
userspace from doing so, so long as it is fully cogniscient of what it
is doing (which it has to be anyway). Similarly for flink/dma-buf, though
I have not thought it through and mmu-notifier should be sufficient to
teardown cross-process attachments - but it would be useful (cf SHM). The
handwaving here is why it originally was root-only, and why we are looking
at the mmu-notifiers to shootdown the vma as it is copied between
processes.
mmu_notifier is seemingly expensive, and I note is only compiled in for
one of my distro kernels - it is not a burden I want to impose on my
machines, but zero-copy uploads is too important to give up.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list