public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Daniel Vetter <daniel@ffwll.ch>,
	Chris Wilson <chris@chris-wilson.co.uk>Daniel Vetter
	<daniel@ffwll.ch>, intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl
Date: Mon, 08 Apr 2013 15:06:16 -0700	[thread overview]
Message-ID: <8738v0d6ef.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <CAKMK7uHJoG94c6g2bx3iNSdEfHan94yf=OiOEJZ0=DfFj03ETw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3720 bytes --]

Daniel Vetter <daniel@ffwll.ch> writes:

> On Mon, Apr 8, 2013 at 7:40 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> On Mon, Apr 08, 2013 at 07:18:11PM +0200, Daniel Vetter wrote:
>>> On Tue, Feb 12, 2013 at 02:17:22PM +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 or data blobs in CL).
>>> >
>>> > v2: Compile with CONFIG_MMU_NOTIFIER
>>> > v3: We can sleep while performing invalidate-range, which we can utilise
>>> > to drop our page references prior to the kernel manipulating the vma
>>> > (for either discard or cloning) and so protect normal users.
>>> > v4: Only run the invalidate notifier if the range intercepts the bo.
>>> > v5: Prevent userspace from attempting to GTT mmap non-page aligned buffers
>>> >
>>> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>>
>>> Quick bikeshed:
>>> - Still not really in favour of the in-page gtt offset handling ... I
>>>   still think that this is just a fancy mmap api, and it better reject
>>>   attempts to not map anything aligned to a full page outright.
>>
>> Strongly disagree.
>
> Ok, let's dig out the beaten arguments here ;-)
> - Imo the gtt_offset frobbery is a bit fragile, and getting this right
> in the face of ppgtt won't make it better. And yes the only reason we
> still have that field is that you've shot down any patch to remove it
> citing userptr here. So "it's here already" doesn't count ;-)

Agreed -- given that I need to look at byte offsets for alignment issues
on basically all my usages of memory, having my data have part of its
intra-page offset hidden in the kernel at creation time would be bad for
Mesa.

Access to data is controlled at a page level, so I think this kernel
interface should act at a page level.

>>> - I915_USERPTR_UNSYNCHRONIZED ... eeek. That means that despite everyone
>>>   having mmu notifiers enabled in their distro config, you make sure sna
>>>   doesn't hit it. Imo not enough testing coverage ;-) Or this there
>>>   another reason behind this than "mmu notifiers are too slow"?
>>>
>>>   Generally I'm a bit sloppy with going root-only for legacy X stuff (like
>>>   scanline waits), but this here looks very much generally useful. So not
>>>   exemption-material imo.
>>
>> Strongly disagree. Most of my machines do not have mmu-notifiers and
>> would still like to benefit from userptr and I see no reason why we need
>> to force mmu-notifiers.
>
> Note that I didn't shout against the mmu_notifier-less support
> (although I'm honestly not too happy about it), what I don't like is
> the override bit disabling the mmu_notifiers even if we have them.
> Since that will mean that the code won't be tested through SNA, and so
> has a good chance of being buggy. Once mesa comes around and uses it,
> it'll nicely blow up. And one of the reason Jesse is breathing down my
> neck to merge this is "other guys are interested in this at intel".

I hate root-only interfaces.  It helps lock in root-only X, and means
that X gets special treatment compared to the 3D driver.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2013-04-08 22:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 14:17 [PATCH] drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl Chris Wilson
2013-02-13 22:24 ` Reese, Armin C
2013-02-13 23:20   ` Chris Wilson
2013-04-08 17:18 ` Daniel Vetter
2013-04-08 17:40   ` Chris Wilson
2013-04-08 19:24     ` Daniel Vetter
2013-04-08 21:48       ` Chris Wilson
2013-04-15 18:37         ` Daniel Vetter
2013-04-08 22:06       ` Eric Anholt [this message]
2013-06-24 21:36       ` Jesse Barnes
  -- strict thread matches above, loose matches on Subject: below --
2013-08-14 10:59 Chris Wilson
2014-01-15 11:10 Chris Wilson
2014-01-21 15:07 [PATCH 3/3] " Chris Wilson
2014-01-22  9:46 ` [PATCH] " Chris Wilson
2014-01-24  9:00   ` Chris Wilson
2014-01-27 17:56     ` Volkin, Bradley D
2014-01-27 18:09       ` Chris Wilson
2014-01-28 10:34 [PATCH 3/3] " Chris Wilson
2014-01-28 13:16 ` [PATCH] " Chris Wilson
2014-01-29 20:25   ` Daniel Vetter
2014-01-29 21:53     ` Chris Wilson
2014-01-29 21:58       ` Daniel Vetter
2014-01-30 11:06         ` Chris Wilson
2014-02-03 15:13           ` Tvrtko Ursulin
2014-01-29 20:34   ` Daniel Vetter
2014-01-29 21:52     ` Chris Wilson
2014-02-03 15:28     ` Tvrtko Ursulin
2014-02-04 10:56       ` Daniel Vetter
2014-02-05 15:55         ` Jesse Barnes
2014-05-16 13:22 Chris Wilson
2014-05-16 15:34 ` Volkin, Bradley D
2014-05-16 16:39   ` Daniel Vetter

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=8738v0d6ef.fsf@eliezer.anholt.net \
    --to=eric@anholt.net \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel@ffwll.ch \
    /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