All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: virtio-comment@lists.oasis-open.org,
	"Chia-I Wu" <olvaffe@gmail.com>,
	"Stéphane Marchesin" <marcheu@chromium.org>
Subject: [virtio-comment] Re: [RFC PATCH v2 1/2] virtio-gpu: add resource create blob
Date: Fri, 15 May 2020 12:38:48 +0200	[thread overview]
Message-ID: <20200515103848.cabaudxhbjxbxbsg@sirius.home.kraxel.org> (raw)
In-Reply-To: <CAAfnVB=XaPrHzONdGY2KEvDSXNHBxSJevmGDVmU8btJgOJjruQ@mail.gmail.com>

> v3 only allows VIRTIO_GPU_BLOB_MEM_GUEST for dumb blob resources,
> which implies we won't really use TRANSFER_BLOB.
> 
> Currently, the path seems to be:
> 
> SET_SCANOUT
> TRANSFER_TO_HOST_2D --> copies from iovecs to host private resource
> RESOURCE_FLUSH_BLOB --> copies from host private resource to framebuffer

Yes.

> A theoretical display update path would be for dumb BOs without shared
> mappings would be:
> 
> SET_SCANOUT_BLOB
> RESOURCE_FLUSH_BLOB --> copies from iovecs to framebuffer
> 
> That should work with crosvm, you might want to verify if it's doable with QEMU.

I think qemu can handle it.  With udmabuf qemu can simply mmap() the
resource, create a pixman image, then run with it.  Without udmabuf
it'll be a bit more complicated because we can't offload most work to
pixman then, but should still be doable.  Qemu could also choose to
allow blob resources only in case udmabuf is available to avoid handling
that.  So no blockers here.

> One possiblity is to only use dumb blob resources in virtio-gpu kms
> when shared guest is available rather than refactoring that code,

I think this makes sense.

> > same goes for dma-buf imports (inside the guest).
> 
> dma-buf import from another virtio driver is very interesting, but
> we'll probably need a some import UUID hypercall for that?

No, just dma-buf import from somewhere, say a gpu passed to the guest
via pci pass-through does the rendering to a dma-buf and that dmabuf
gets imported into virtio-gpu for display in a host window.

That'll requires BLOB resources to work, because we have to create a
guest bo (and virtio resource) without knowning what format the guest
wants to use to scanout the thing.

We may likewise allow that only in case shared guest is available.

> Though TRANSFER_BLOB can be useful.  I can see the following use cases:
> 
> - implementing guest kernel dma-buf mmap and synchronization
> (begin_cpu_access/end_cpu_access).  Currently, it doesn't work but no
> guest user-space relies on it, so no one has noticed/complained.
> - emulated coherent memory
> 
> It sounds like you think TRANSFER_BLOB is worth the maintenance vs.
> future proofing tradeoff, which is fair.

We can leave it out for now and see if we'll need it at some point in
the future.  One point of adding blob resources is to allow shared
mappings, so maybe it wouldn't be used. There is also the option to
fallback to traditional resources ...

cheers,
  Gerd


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/


  reply	other threads:[~2020-05-15 10:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 23:24 [virtio-comment] [RFC PATCH v2 1/2] virtio-gpu: add resource create blob Gurchetan Singh
2020-05-07 23:24 ` [virtio-comment] [RFC PATCH v2 2/2] virtio-gpu: add support for mapping/unmapping blob resources Gurchetan Singh
2020-05-12 12:22 ` [virtio-comment] Re: [RFC PATCH v2 1/2] virtio-gpu: add resource create blob Gerd Hoffmann
2020-05-12 22:25   ` Gurchetan Singh
2020-05-13  7:03     ` Gerd Hoffmann
2020-05-13 23:14       ` Gurchetan Singh
2020-05-14  8:24         ` Gerd Hoffmann
2020-05-14 22:41           ` Gurchetan Singh
2020-05-15 10:38             ` Gerd Hoffmann [this message]
2020-05-15 22:05               ` Gurchetan Singh
2020-05-18  7:34                 ` Gerd Hoffmann
2020-05-18 18:48                   ` Gurchetan Singh

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=20200515103848.cabaudxhbjxbxbsg@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=gurchetansingh@chromium.org \
    --cc=marcheu@chromium.org \
    --cc=olvaffe@gmail.com \
    --cc=virtio-comment@lists.oasis-open.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 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.