All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Olšák" <maraeo@gmail.com>
To: Daniel Stone <daniel@fooishbar.org>
Cc: James Jones <jajones@nvidia.com>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: Unix Device Memory Allocation project
Date: Mon, 16 Jan 2017 23:54:14 +0100	[thread overview]
Message-ID: <CAAxE2A7A8U6WK-A=n8Gga1KjjDz1um+f7UsH0U3uqjCrLZrWFg@mail.gmail.com> (raw)
In-Reply-To: <CAPj87rNn5o0vwgEE6r0JgdDLnaKNxZcrqHKZhqvNw6BLd34G=Q@mail.gmail.com>

Thanks for all the feedback. Things are much clearer now.

Yeah, we can use the BO modifiers for simple 2D images / planes if
that's the general direction. I think we can even stuff the
compression data buffer offset into those 64 bits, considering it's
not very large (e.g. below 4GB and low bits are unused due to
alignment).

For OpenCL at least, we have to keep using the 256-bytes-large per-BO
metadata to describe more complex allocations.

Marek


On Wed, Jan 4, 2017 at 5:59 PM, Daniel Stone <daniel@fooishbar.org> wrote:
> Hi Christian,
>
> On 4 January 2017 at 16:02, Christian König <deathsimple@vodafone.de> wrote:
>> Am 04.01.2017 um 16:47 schrieb Rob Clark:
>>> If the position of the different parts of the buffer are somewhere
>>> required to be a function of w/h/bpp/etc then I'm not sure if there is
>>> a strong advantage to treating them as separate BOs.. although I
>>> suppose it doesn't preclude it either.  As far as plumbing it through
>>> mesa/st, it seems convenient to have a single buffer.  (We have kind
>>> of a hack to deal w/ multi-planar yuv, but I'd rather not propagate
>>> that.. but I've not thought through those details so much yet.)
>>
>> Well I don't want to ruin your day, but there are different requirements
>> from different hardware.
>>
>> For example the UVD engine found in all AMD graphics cards since r600 must
>> have both planes in a single BO because the memory controller can only
>> handle a rather small offset between the planes.
>
> This is, to a large extent, also true of Intel.
>
>> On the other hand I know of embedded MPEG2/H264 decoders where the different
>> planes must be on different memory channels. In this case I can imagine
>> you want one BO for each plane, because otherwise the device must stitch
>> together one buffer object from two different memory regions (of course
>> possible, but rather ugly).
>
> Not just embedded, but quite a few platforms where the ratio of
> required to available memory bandwidth is ... somewhat different to
> larger discrete systems. Striping allocations such that luma and
> chroma live on different memory channels isn't uncommon.
>
> But I think this is all orthogonal. If you keep auxiliary planes in
> separate BOs to metadata, you can still handle both cases. How to
> place buffers is purely an _allocation_ concern, where single vs.
> multiple BO is purely about addressing them. So your allocator API may
> become a little more complex - something which only device-specific
> userspace will ever address - whilst keeping a unified
> addressing/handle system for the generic parts of userspace which
> shouldn't have to care about whether the underlying hardware demands a
> small offset or a completely separate allocation.
>
> Having API pegged to the single-underlying-BO concept has been a giant
> pain for those who can't use single BOs. I don't see anything good
> coming of the idea for cross-device/cross-vendor sharing either, since
> it encodes yet more magic implicit detail into buffer sharing. Since
> that detail ultimately has to be resolved _somewhere_, it's a problem
> avoided rather than a problem solved.
>
> Cheers,
> Daniel
> _______________________________________________
> 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-01-16 22:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 23:47 Unix Device Memory Allocation project James Jones
2016-10-05  8:42 ` Benjamin Gaignard
2016-10-05 12:19   ` Rob Clark
2016-10-18 23:40 ` Marek Olšák
2016-10-19  0:08   ` James Jones
2016-10-19  6:31     ` Daniel Vetter
2016-10-19  6:23   ` Daniel Vetter
2016-10-19 12:15     ` Christian König
2016-10-19 13:15     ` Marek Olšák
2016-10-19 14:10       ` Daniel Vetter
2016-10-19 16:46         ` Marek Olšák
2016-10-20  6:31           ` Daniel Vetter
2017-01-03 23:38             ` Marek Olšák
2017-01-03 23:43               ` James Jones
2017-01-04  0:06                 ` Marek Olšák
2017-01-04  0:19                   ` James Jones
2017-01-04  8:46               ` Stéphane Marchesin
2017-01-04 12:03               ` Daniel Stone
2017-01-04 13:06                 ` Rob Clark
2017-01-04 14:54                   ` Daniel Vetter
2017-01-04 15:47                     ` Rob Clark
2017-01-04 16:02                       ` Christian König
2017-01-04 16:16                         ` Rob Clark
2017-01-04 16:26                           ` Christian König
2017-01-04 16:59                         ` Daniel Stone
2017-01-16 22:54                           ` Marek Olšák [this message]
2017-01-23  7:38                             ` Daniel Vetter
2016-10-19  6:49   ` Michel Dänzer
2016-10-19 12:33   ` Nicolai Hähnle
     [not found]     ` <CAAxE2A7ih_84H7w361msVYzRb8jb4ye8Psc1e5CO6gjJ2frO6g@mail.gmail.com>
     [not found]       ` <CAAxE2A53E_r9uA=FG_A63aBVgqaTWBuAzDZfDvRe9K+0EWmFeQ@mail.gmail.com>
2016-10-19 13:40         ` Marek Olšák

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='CAAxE2A7A8U6WK-A=n8Gga1KjjDz1um+f7UsH0U3uqjCrLZrWFg@mail.gmail.com' \
    --to=maraeo@gmail.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jajones@nvidia.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.