All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kristian Høgsberg" <hoegsberg@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: "Rob Clark" <rclark@redhat.com>,
	"Miguel Angel Vico" <mvicomoya@nvidia.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Jason Ekstrand" <jason.ekstrand@intel.com>,
	"Kristian H. Kristensen" <hoegsberg@google.com>,
	"Ben Skeggs" <bskeggs@redhat.com>,
	"Chad Versace" <chadversary@google.com>,
	"mesa-dev@lists.freedesktop.org" <mesa-dev@lists.freedesktop.org>,
	"Lyude Paul" <cpaul@redhat.com>,
	"Nicolai Hähnle" <nhaehnle@gmail.com>
Subject: Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
Date: Wed, 20 Dec 2017 11:54:10 -0800	[thread overview]
Message-ID: <CAOeoa-c-Mr3V5rEDDk=0qt+-Taot7o_j0UUVnj=fC+_WVo+-aw@mail.gmail.com> (raw)
In-Reply-To: <CAKMK7uHJ7pFBQdxuPFKPVQ=CuWxTnN5U=2NfArXLKBx+BAO4Bw@mail.gmail.com>

On Wed, Dec 20, 2017 at 11:51 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> Since this also involves the kernel let's add dri-devel ...
>
> On Wed, Dec 20, 2017 at 5:51 PM, Miguel Angel Vico <mvicomoya@nvidia.com> wrote:
>> Hi all,
>>
>> As many of you already know, I've been working with James Jones on the
>> Generic Device Allocator project lately. He started a discussion thread
>> some weeks ago seeking feedback on the current prototype of the library
>> and advice on how to move all this forward, from a prototype stage to
>> production. For further reference, see:
>>
>>    https://lists.freedesktop.org/archives/mesa-dev/2017-November/177632.html
>>
>> From the thread above, we came up with very interesting high level
>> design ideas for one of the currently missing parts in the library:
>> Usage transitions. That's something I'll personally work on during the
>> following weeks.
>>
>>
>> In the meantime, I've been working on putting together an open source
>> implementation of the allocator mechanisms using the Nouveau driver for
>> all to be able to play with.
>>
>> Below I'm seeking feedback on a bunch of changes I had to make to
>> different components of the graphics stack:
>>
>> ** Allocator **
>>
>>   An allocator driver implementation on top of Nouveau. The current
>>   implementation only handles pitch linear layouts, but that's enough
>>   to have the kmscube port working using the allocator and Nouveau
>>   drivers.
>>
>>   You can pull these changes from
>>
>>       https://github.com/mvicomoya/allocator/tree/wip/mvicomoya/nouveau-driver
>>
>> ** Mesa **
>>
>>   James's kmscube port to use the allocator relies on the
>>   EXT_external_objects extension to import allocator allocations to
>>   OpenGL as a texture object. However, the Nouveau implementation of
>>   these mechanisms is missing in Mesa, so I went ahead and added them.
>>
>>   You can pull these changes from
>>
>>       https://github.com/mvicomoya/mesa/tree/wip/mvicomoya/EXT_external_objects-nouveau
>>
>>   Also, James's kmscube port uses the NVX_unix_allocator_import
>>   extension to attach allocator metadata to texture objects so the
>>   driver knows how to deal with the imported memory.
>>
>>   Note that there isn't a formal spec for this extension yet. For now,
>>   it just serves as an experimental mechanism to import allocator
>>   memory in OpenGL, and attach metadata to texture objects.
>>
>>   You can pull these changes (written on top of the above) from:
>>
>>       https://github.com/mvicomoya/mesa/tree/wip/mvicomoya/NVX_unix_allocator_import
>>
>> ** kmscube **
>>
>>   Mostly minor fixes and improvements on top of James's port to use the
>>   allocator. Main thing is the allocator initialization path will use
>>   EGL_MESA_platform_surfaceless if EGLDevice platform isn't supported
>>   by the underlying EGL implementation.
>>
>>   You can pull these changes from:
>>
>>       https://github.com/mvicomoya/kmscube/tree/wip/mvicomoya/allocator-nouveau
>>
>>
>> With all the above you should be able to get kmscube working using the
>> allocator on top of the Nouveau driver.
>>
>>
>> Another of the missing pieces before we can move this to production is
>> importing allocations to DRM FB objects. This is probably one of the
>> most sensitive parts of the project as it requires modification/addition
>> of kernel driver interfaces.
>>
>> At XDC2017, James had several hallway conversations with several people
>> about this, all having different opinions. I'd like to take this
>> opportunity to also start a discussion about what's the best option to
>> create a path to get allocator allocations added as DRM FB objects.
>>
>> These are the few options we've considered to start with:
>>
>>   A) Have vendor-private ioctls to set properties on GEM objects that
>>      are inherited by the FB objects. This is how our (NVIDIA) desktop
>>      DRM driver currently works. This would require every vendor to add
>>      their own ioctl to process allocator metadata, but the metadata is
>>      actually a vendor-agnostic object more like DRM modifiers. We'd
>>      like to come up with a vendor-agnostic solutions that can be
>>      integrated to core DRM.
>>
>>   B) Add a new drmModeAddFBWithMetadata() command that takes allocator
>>      metadata blobs for each plane of the FB. Some people in the
>>      community have mentioned this is their preferred design. This,
>>      however, means we'd have to go through the exercise of adding
>>      another metadata mechanism to the whole graphics stack.
>>
>>   C) Shove allocator metadata into DRM by defining it to be a separate
>>      plane in the image, and using the existing DRM modifiers mechanism
>>      to indicate there is another plane for each "real" plane added. It
>>      isn't clear how this scales to surfaces that already need several
>>      planes, but there are some people that see this as the only way
>>      forward. Also, we would have to create a separate GEM buffer for
>>      the metadatada itself, which seems excessive.
>>
>> We personally like option (B) better, and have already started to
>> prototype the new path (which is actually very similar to the
>> drmModeAddFB2() one). You can take a look at the new interfaces here:
>>
>>     https://github.com/mvicomoya/linux/tree/wip/mvicomoya/drm_addfb_with_metadata__4.14-rc8
>>
>> There may be other options that haven't been explored yet that could be
>> a better choice than the above, so any suggestion will be greatly
>> appreciated.
>
> What kind of metadata are we talking about here? Addfb has tons of
> stuff already that's "metadata". The only thing I've spotted is
> PITCH_ALIGNMENT, which is maybe something we want drm drivers to tell
> userspace, but definitely not something addfb ever needs. addfb only
> needs the resulting pitch that we actually allocated (and might decide
> it doesn't like that, but that's a different issue).
>
> And since there's no patches for nouveau itself I can't really say
> anything beyond that.

I'd like to see concrete examples of actual display controllers
supporting more format layouts than what can be specified with a 64
bit modifier.

Kristian

> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-12-20 19:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171220085151.6327051e@nvidia.com>
2017-12-20 19:51 ` [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces Daniel Vetter
2017-12-20 19:54   ` Kristian Høgsberg [this message]
2017-12-20 20:41     ` Miguel Angel Vico
2017-12-20 23:22       ` [Mesa-dev] " Kristian Kristensen
2017-12-21  1:05         ` Ilia Mirkin
2017-12-21  8:05         ` Daniel Vetter
2018-02-21  6:14           ` Chad Versace
2018-02-21 18:26             ` [Mesa-dev] " Daniel Vetter
2018-02-21 23:23               ` Chad Versace
2018-02-22  0:00             ` Alex Deucher
2018-02-22 18:04               ` Kristian Høgsberg
2018-02-22 18:49                 ` Bas Nieuwenhuizen
2018-02-22 21:16                   ` Alex Deucher
2018-02-27  6:10                     ` James Jones
2018-03-07 17:23                     ` Daniel Vetter
2018-02-22 19:21                 ` [Mesa-dev] " Eric Anholt
     [not found] ` <CAPj87rOmGsN+HZEk1G=gFx_uPyipzEURB7=bfqOxxmLDtWwPgw@mail.gmail.com>
     [not found]   ` <b1d78126-fb83-d3c0-290f-8a5406ab1c79@nvidia.com>
     [not found]     ` <CAKMK7uHGBhMge8ayqcJUXysesVL8yc1dNk3rdH6C_N2DpO2OyQ@mail.gmail.com>
     [not found]       ` <CAF6AEGtNsBwhJAiUGuUQFdKccurSzD-HnpHH-JcHSx0RUCnZGA@mail.gmail.com>
2017-12-28 18:24         ` Miguel Angel Vico
2018-01-03 14:53           ` [Mesa-dev] " Rob Clark
2018-01-03 19:26           ` James Jones
2018-01-03 20:36             ` Kristian Kristensen
2018-01-08  9:35           ` 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='CAOeoa-c-Mr3V5rEDDk=0qt+-Taot7o_j0UUVnj=fC+_WVo+-aw@mail.gmail.com' \
    --to=hoegsberg@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=chadversary@google.com \
    --cc=cpaul@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hoegsberg@google.com \
    --cc=jason.ekstrand@intel.com \
    --cc=mesa-dev@lists.freedesktop.org \
    --cc=mvicomoya@nvidia.com \
    --cc=nhaehnle@gmail.com \
    --cc=rclark@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.