From: Daniel Vetter <daniel@ffwll.ch>
To: christian.koenig@amd.com
Cc: maxime.ripard@bootlin.com, dri-devel@lists.freedesktop.org,
digetx@gmail.com, m.szyprowski@samsung.com,
devel@driverdev.osuosl.org, sstabellini@kernel.org,
arnd@arndb.de,
Russell King - ARM Linux admin <linux@armlinux.org.uk>,
jonathanh@nvidia.com, tomi.valkeinen@ti.com,
xen-devel@lists.xenproject.org, linux-media@vger.kernel.org,
pawel@osciak.com, intel-gfx@lists.freedesktop.org,
linux-tegra@vger.kernel.org, boris.ostrovsky@oracle.com,
mchehab@kernel.org, jgross@suse.com, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, kyungmin.park@samsung.com
Subject: Re: [Intel-gfx] [PATCH] dma-buf: add struct dma_buf_attach_info v2
Date: Fri, 3 May 2019 14:09:33 +0200 [thread overview]
Message-ID: <20190503120933.GL3271@phenom.ffwll.local> (raw)
In-Reply-To: <cbcbb076-a8b0-67b0-8c16-daf1d060fc1d@gmail.com>
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?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-05-03 12:09 UTC|newest]
Thread overview: 8+ 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 15:23 ` kbuild test robot
2019-04-30 16:59 ` Boris Ostrovsky
2019-04-30 17:31 ` Russell King - ARM Linux admin
2019-05-03 12:05 ` Christian König
2019-05-03 12:09 ` Daniel Vetter [this message]
2019-05-03 12:15 ` [Intel-gfx] " Koenig, Christian
2019-04-30 23:06 ` kbuild test robot
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=20190503120933.GL3271@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=arnd@arndb.de \
--cc=boris.ostrovsky@oracle.com \
--cc=christian.koenig@amd.com \
--cc=devel@driverdev.osuosl.org \
--cc=digetx@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jgross@suse.com \
--cc=jonathanh@nvidia.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--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=mchehab@kernel.org \
--cc=pawel@osciak.com \
--cc=sstabellini@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).