All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Dave Airlie <airlied@redhat.com>,
	dri-devel@lists.freedesktop.org,
	oleksandr_andrushchenko@epam.com
Subject: Re: [PATCH] Revert "drm/virtio: drop prime import/export callbacks"
Date: Tue, 23 Apr 2019 10:01:44 +0200	[thread overview]
Message-ID: <20190423080144.nceta3dq4xdjgdfi@sirius.home.kraxel.org> (raw)
In-Reply-To: <20190419155709.19608-1-marcandre.lureau@redhat.com>

On Fri, Apr 19, 2019 at 05:57:09PM +0200, Marc-André Lureau wrote:
> This patch does more harm than good, as it breaks both Xwayland and
> gnome-shell with X11.
> 
> Xwayland requires DRI3 & DRI3 requires PRIME.
> 
> X11 crash for obscure double-free reason which are hard to debug
> (starting X11 by hand doesn't trigger the crash).
> 
> I don't see an apparent problem implementing those stub prime
> functions, they may return an error at run-time, and it seems to be
> handled fine by GNOME at least.

Well, problem is they are *not* handled fine, this is why the patch is
there in the first place.

Problem case: gnome-shell (in wayland display server mode) fails to come
up with a working desktop in case both a intel vgpu and an emulated
display device are present in the system.  Looks like wayland tries to
render using the intel vgpu, then import the rendered buffers to the
emulated display device (qxl or virtio-gpu), and it does not handle the
failure.

I've tried to add a DRM_PRIME_CAP_LOCAL flag for self-import support:
https://patchwork.freedesktop.org/patch/297672/

But looks like Daniel Vetter (Cc'ed) thinks userspace is to blame here
for not handling the import failure properly.

> +struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj)
> +{
> +	WARN_ONCE(1, "not implemented");
> +	return ERR_PTR(-ENODEV);
> +}

That is actually implemented meanwhile (branch drm-misc-next, will land
in 5.2, commit "98f41dc3b3ee drm/virtio: implement prime export".

> +struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
> +	struct drm_device *dev, struct dma_buf_attachment *attach,
> +	struct sg_table *table)
> +{
> +	WARN_ONCE(1, "not implemented");

I don't think we should re-add this.  Either drop this completely,
or replace by a less noisy printk_once("can do self-import only").

cheers,
  Gerd

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2019-04-23  8:01 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
2019-04-24  0:54             ` Dave Airlie
2019-04-23  8:01 ` Gerd Hoffmann [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=20190423080144.nceta3dq4xdjgdfi@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --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.