All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>,
	"maxime.ripard@bootlin.com" <maxime.ripard@bootlin.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"digetx@gmail.com" <digetx@gmail.com>,
	"sumit.semwal@linaro.org" <sumit.semwal@linaro.org>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"sstabellini@kernel.org" <sstabellini@kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"jonathanh@nvidia.com" <jonathanh@nvidia.com>,
	"tomi.valkeinen@ti.com" <tomi.valkeinen@ti.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"pawel@osciak.com" <pawel@osciak.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	boris.ostrovsky@
Subject: Re: [Intel-gfx] [PATCH] dma-buf: add struct dma_buf_attach_info v2
Date: Fri, 3 May 2019 12:15:53 +0000	[thread overview]
Message-ID: <64f9e5ed-eb7d-d0f9-5041-05ac711b213e__7690.49007665075$1556923627$gmane$org@amd.com> (raw)
In-Reply-To: <20190503120933.GL3271@phenom.ffwll.local>

Am 03.05.19 um 14:09 schrieb Daniel Vetter:
> [CAUTION: External Email]
>
> On Fri, May 03, 2019 at 02:05:47PM +0200, Christian König wrote:
>> Am 30.04.19 um 19:31 schrieb Russell King - ARM Linux admin:
>>> On Tue, Apr 30, 2019 at 01:10:02PM +0200, Christian König wrote:
>>>> Add a structure for the parameters of dma_buf_attach, this makes it much easier
>>>> to add new parameters later on.
>>> I don't understand this reasoning.  What are the "new parameters" that
>>> are being proposed, and why do we need to put them into memory to pass
>>> them across this interface?
>>>
>>> If the intention is to make it easier to change the interface, passing
>>> parameters in this manner mean that it's easy for the interface to
>>> change and drivers not to notice the changes, since the compiler will
>>> not warn (unless some member of the structure that the driver is using
>>> gets removed, in which case it will error.)
>>>
>>> Additions to the structure will go unnoticed by drivers - what if the
>>> caller is expecting some different kind of behaviour, and the driver
>>> ignores that new addition?
>> Well, exactly that's the intention here: That the drivers using this
>> interface should be able to ignore the new additions for now as long as they
>> are not going to use them.
>>
>> The background is that we have multiple interface changes in the pipeline,
>> and each step requires new optional parameters.
>>
>>> This doesn't seem to me like a good idea.
>> Well, the obvious alternatives are:
>>
>> a) Change all drivers to explicitly provide NULL/0 for the new parameters.
>>
>> b) Use a wrapper, so that the function signature of dma_buf_attach stays the
>> same.
>>
>> Key point here is that I have an invalidation callback change, a P2P patch
>> set and some locking changes which all require adding new parameters or
>> flags. And at each step I would then start to change all drivers, adding
>> some more NULL pointers or flags with 0 default value.
>>
>> I'm actually perfectly fine going down any route, but this just seemed to me
>> simplest and with the least risk of breaking anything. Opinions?
> I think given all our discussions and plans the argument object makes tons
> of sense. Much easier to document well than a long list of parameters.
> Maybe we should make it const, so it could work like an ops/func table and
> we could store it as a pointer in the dma_buf_attachment?

Yeah, the invalidation callback and P2P flags are constant. But the 
importer_priv field isn't.

We could do something like adding the importer_priv field as parameter 
and the other two as const structure.

Third alternative would be to throw out all the DRM abstraction and just 
embed the attachment structure in the buffer object and get completely 
rid of the importer_priv field (probably the cleanest alternative, but 
also the most work todo).

Christian.

> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-05-03 12:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 11:10 [PATCH] dma-buf: add struct dma_buf_attach_info v2 Christian König
2019-04-30 11:10 ` [Xen-devel] " Christian König
2019-04-30 13:49 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-04-30 14:05 ` ✓ Fi.CI.BAT: success " Patchwork
2019-04-30 15:23 ` [PATCH] " kbuild test robot
2019-04-30 15:23   ` [Xen-devel] [Intel-gfx] " kbuild test robot
2019-04-30 15:23   ` kbuild test robot
2019-04-30 15:23 ` kbuild test robot
2019-04-30 16:59 ` Boris Ostrovsky
2019-04-30 16:59 ` Boris Ostrovsky
2019-04-30 16:59   ` [Xen-devel] " Boris Ostrovsky
2019-04-30 16:59   ` Boris Ostrovsky
2019-04-30 17:31 ` Russell King - ARM Linux admin
2019-04-30 17:31   ` [Xen-devel] " Russell King - ARM Linux admin
2019-05-03 12:05   ` Christian König
2019-05-03 12:05   ` Christian König
2019-05-03 12:05     ` [Xen-devel] " Christian König
2019-05-03 12:09     ` [Intel-gfx] " Daniel Vetter
2019-05-03 12:09       ` [Xen-devel] " Daniel Vetter
2019-05-03 12:09       ` Daniel Vetter
2019-05-03 12:15       ` Koenig, Christian
2019-05-03 12:15         ` [Xen-devel] " Koenig, Christian
2019-05-03 12:15         ` Koenig, Christian
2019-05-03 12:15       ` Koenig, Christian [this message]
2019-05-03 12:09     ` Daniel Vetter
2019-04-30 17:31 ` Russell King - ARM Linux admin
2019-04-30 23:06 ` [Intel-gfx] " kbuild test robot
2019-04-30 23:06 ` kbuild test robot
2019-04-30 23:06   ` [Xen-devel] [Intel-gfx] " kbuild test robot
2019-05-01  4:44 ` ✗ Fi.CI.IGT: failure for " Patchwork
2019-05-02  7:59 ` Patchwork
2019-05-02  8:54 ` Patchwork

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='64f9e5ed-eb7d-d0f9-5041-05ac711b213e__7690.49007665075$1556923627$gmane$org@amd.com' \
    --to=christian.koenig@amd.com \
    --cc=arnd@arndb.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=digetx@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=pawel@osciak.com \
    --cc=sstabellini@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=xen-devel@lists.xenproject.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 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.