All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: oleksandr_andrushchenko@epam.com,
	"ML dri-devel" <dri-devel@lists.freedesktop.org>,
	"Dave Airlie" <airlied@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH] Revert "drm/virtio: drop prime import/export callbacks"
Date: Tue, 23 Apr 2019 17:17:33 +0100	[thread overview]
Message-ID: <CACvgo52ThtXcbjcgnx5O5=onc3UwedaGs7eWf6z7RPoqo8EuRg@mail.gmail.com> (raw)
In-Reply-To: <20190423140646.2ujxqsjwfuzf4fxp@sirius.home.kraxel.org>

On Tue, 23 Apr 2019 at 15:06, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Tue, Apr 23, 2019 at 12:55:07PM +0100, Emil Velikov wrote:
> > On Tue, 23 Apr 2019 at 09:05, Gerd Hoffmann <kraxel@redhat.com> wrote:
> > >
> > >   Hi,
> > >
> > > > > The DRI3 code extensively uses prime_handle_to_fd and
> > > > > prime_fd_to_handle for self-import.
> > >
> > > The callbacks are not used for self-import.
> > >
> > Userspace converts from it's own handles to a dmabuf fd and vice-versa.
> > I assumed that's called self-import, is it not?
>
> self-import is importing a dma-buf into the driver which created it.
>
> drm_gem_prime.c has a shortcut for that, it'll just increase the gem
> reference count instead of going though a full-blown export/import.
>
> The prime_handle_to_fd and prime_fd_to_handle callbacks are only needed
> for the non-self-import case, where the other driver needs/provides a
> scatter list.
>
Looking at kernel.org and drm-misc-next (as of a couple of hours ago)
there is no drm_gem_prime.c file.
I would imagine you meant drm_prime.c.

Even then, the callbacks "prime_handle_to_fd" and "prime_fd_to_handle"
are used by the ioctls themselves [1] [2].
There is no fall-back when the callbacks are missing - we error out with ENOSYS.

I assume that by "callbacks are only needed" you meant that we should
fix the ioctls to use the callbacks only for the non-self-import case?
If so, that should land first before pulling out the prime callbacks, right?

HTH
Emil

[1] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/drm_prime.c?id=9158e3c31163488364c76bf6948507e7640d511f#n870
[2] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/drm_prime.c?id=9158e3c31163488364c76bf6948507e7640d511f#n889
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-04-23 16:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 15:57 [PATCH] Revert "drm/virtio: drop prime import/export callbacks" Marc-André Lureau
2019-04-19 16:21 ` Emil Velikov
2019-04-19 16:45   ` Chia-I Wu
2019-04-23  8:05     ` Gerd Hoffmann
2019-04-23 11:55       ` Emil Velikov
2019-04-23 14:06         ` Gerd Hoffmann
2019-04-23 16:17           ` Emil Velikov [this message]
2019-04-24  0:54             ` Dave Airlie
2019-04-23  8:01 ` Gerd Hoffmann

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='CACvgo52ThtXcbjcgnx5O5=onc3UwedaGs7eWf6z7RPoqo8EuRg@mail.gmail.com' \
    --to=emil.l.velikov@gmail.com \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=oleksandr_andrushchenko@epam.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.