From: Keith Packard <keithp@keithp.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: mesa-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] intel: Track known prime buffers for re-use
Date: Tue, 26 Nov 2013 03:40:31 -0800 [thread overview]
Message-ID: <86wqjvfl1s.fsf@miki.keithp.com> (raw)
In-Reply-To: <20131126094241.GK27344@phenom.ffwll.local>
[-- Attachment #1.1: Type: text/plain, Size: 1768 bytes --]
Daniel Vetter <daniel@ffwll.ch> writes:
> The kernel actually doesn't bother with this, i.e. an open on an flink
> name will always create a new handle. Given that it was a major pita to
> get the prime reimporting going (due to a pile of funny lifetime issues
> around reference loops and some assorted locking fun) I'm not volunteering
> to fix this ;-) And I also think that a piece of userspace which both
> flink-opens and prime imports on the same buffer gets both pieces.
That seems pretty dangerous to me -- you'll end up with aliases to the
same buffer this way if user space isn't careful.
I bet you check duplicate buffer usage by pointer and not ID though,
which means user space will get errors when this happens. That's not
terrible, but it isn't great either as there's this nasty call to
exit(1) when the execbuffers fails...
> Otoh this can't hurt either, so if you want to stick with this hunk maybe
> add a small comment saying that the kernel lies. Or just remove it. Either
> way:
Not being able to test it is a bit sub-optimal; the duplicate handle
case for prime was well tested by the time I submitted that patch...
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
thanks.
> Aside: I think drm is the only subsystem that goes out of it's way to
> ensure a unique relationship between dmabuf and other handles and
> underlying objects. If you throw v4l into the mix (e.g. by building a
> gstreamer pipe that feeds into an egl image or so) I expect some fun to
> happen. Otoh no open-source v4l driver for intel socs, so lalala ;-)
Some kind of standard of conduct is clearly needed here - not letting
user space know they've got aliasing going on is pretty mean.
--
keith.packard@intel.com
[-- Attachment #1.2: Type: application/pgp-signature, Size: 827 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2013-11-26 11:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 13:35 [PATCH] intel: Track known prime buffers for re-use Keith Packard
2013-11-25 15:39 ` [Mesa-dev] " Daniel Vetter
2013-11-25 21:21 ` Keith Packard
2013-11-25 21:22 ` Keith Packard
2013-11-26 9:42 ` Daniel Vetter
2013-11-26 11:40 ` Keith Packard [this message]
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=86wqjvfl1s.fsf@miki.keithp.com \
--to=keithp@keithp.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=mesa-dev@lists.freedesktop.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