All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>,
	ML dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/virtio: Create Dumb BOs as guest Blobs (v2)
Date: Thu, 8 Apr 2021 11:27:40 +0200	[thread overview]
Message-ID: <20210408092740.c42sp32hku5d66ec@sirius.home.kraxel.org> (raw)
In-Reply-To: <CAAfnVB=NUjUUUcABQhR3AhQPtdDu9uHZCsi+9Q90babp2AfOpg@mail.gmail.com>

> > +
> > +       if (vgdev->has_resource_blob) {
> > +               params.blob_mem = VIRTGPU_BLOB_MEM_GUEST;
> > +               params.blob_flags = VIRTGPU_BLOB_FLAG_USE_SHAREABLE;
> >
> 
> This creates some log spam with crosvm + virgl_3d + vanilla linux, since
> transfers don't work for guest blobs.  Two options:
> 
> a) Add vgdev->has_virgl_3d check and don't create a guest blob in that case.
> b) The interactions between TRANSFER_TO_HOST_2D and VIRTGPU_BLOB_MEM_GUEST
> are a bit under-defined in the spec.

Indeed.

> Though since you don't have a host
> side resource, you can safely skip the transfer and crosvm can be modified
> to do the right thing in case of RESOURCE_FLUSH.

IIRC the VIRTGPU_BLOB_FLAG_USE_SHAREABLE flag means that the host *can*
create a shared mapping (i.e. the host seeing guest-side changes without
explicit transfer doesn't cause problems for the guest).  It doesn not
mean the host *must* create a shared mapping (note that there is no
negotiation whenever the host supports shared mappings or not).

So the transfer calls are still needed, and the host can decide to
shortcut them in case it can create a shared mapping.  In case there is
no shared mapping (say due to missing udmabuf support) the host can
fallback to copying.

So I think crosvm should be fixed to not consider transfer commands for
VIRTGPU_BLOB_MEM_GUEST resources an error.

> It makes a ton of sense to have a explicit udmabuf-like flag
> ("BLOB_FLAG_CREATE_GUEST_HANDLE" or "BLOB_FLAG_HANDLE_FROM_GUEST" -- want
> to host OS agnostic -- any other ideas?), especially with 3d mode.

Why?  Can't this be simply an host implementation detail which the guest
doesn't need to worry about?

take care,
  Gerd

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

  reply	other threads:[~2021-04-08  9:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31  3:04 [PATCH 1/2] drm/virtio: Create Dumb BOs as guest Blobs Vivek Kasireddy
2021-03-31  3:04 ` [PATCH 2/2] drm/virtio: Include modifier as part of set_scanout_blob Vivek Kasireddy
2021-03-31  7:59   ` Gerd Hoffmann
2021-04-02  7:55     ` Zhang, Tina
2021-04-02 16:07       ` Gurchetan Singh
2021-03-31  7:41 ` [PATCH 1/2] drm/virtio: Create Dumb BOs as guest Blobs Gerd Hoffmann
2021-04-01  3:51   ` Kasireddy, Vivek
2021-04-01  6:53     ` Gerd Hoffmann
2021-04-06 20:36       ` [PATCH] drm/virtio: Create Dumb BOs as guest Blobs (v2) Vivek Kasireddy
2021-04-07  0:34         ` Gurchetan Singh
2021-04-08  9:27           ` Gerd Hoffmann [this message]
2021-04-09  0:31             ` Gurchetan Singh
2021-04-09  7:48               ` Gerd Hoffmann
2021-04-13  0:58                 ` Gurchetan Singh
     [not found]                   ` <BN7PR11MB2786499E7902CE53326ACE97894F9@BN7PR11MB2786.namprd11.prod.outlook.com>
2021-04-13  4:57                     ` Zhang, Tina
2021-04-13  5:26                   ` [PATCH] drm/virtio: Create Dumb BOs as guest Blobs (v3) Vivek Kasireddy
2021-04-14  6:36                     ` Zhang, Tina
2021-04-14  9:29                       ` Gerd Hoffmann
2021-04-14 23:31                     ` Gurchetan Singh
2021-04-15  9:07                       ` 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=20210408092740.c42sp32hku5d66ec@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --cc=vivek.kasireddy@intel.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.