From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: linux-kernel@vger.kernel.org, Zach Reizner <zachr@google.com>,
kernel@collabora.com, dri-devel@lists.freedesktop.org,
virtualization@lists.linux-foundation.org,
"Michael S. Tsirkin" <mst@redhat.com>,
David Airlie <airlied@linux.ie>, Jason Wang <jasowang@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [PATCH v3 1/2] drm/virtio: Add window server support
Date: Thu, 15 Feb 2018 16:28:41 +0100 [thread overview]
Message-ID: <5ca446c7-582c-6871-c13f-9fc44c535ebc@collabora.com> (raw)
In-Reply-To: <20180212114540.iygbha554busy4ip@sirius.home.kraxel.org>
On 02/12/2018 12:45 PM, Gerd Hoffmann wrote:>>>> 4. QEMU pops
data+buffers from the virtqueue, looks up shmem FD for each
>>>> resource, sends data + FDs to the compositor with SCM_RIGHTS
>>>
>>> BTW: Is there a 1:1 relationship between buffers and shmem blocks? Or
>>> does the wayland protocol allow for offsets in buffer meta data, so you
>>> can place multiple buffers in a single shmem block?
>>
>> The latter:
>>
https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_shm_pool
>
> Ah, good, that makes it alot easier.
>
> So, yes, using ivshmem would be one option. Tricky part here is the
> buffer management though. It's just a raw piece of memory. The guest
> proxy could mmap the pci bar and manage it. But then it is again either
> unmodified guest + copying the data, or modified client (which requests
> buffers from guest proxy) for zero-copy.
What if at VIRTIO_GPU_CMD_RESOURCE_CREATE_2D time we created a ivshmem
device to back that resource. The ivshmem device would in turn be backed
by a hostmem device that wraps a shmem FD.
The guest client can then export that resource/BO and pass the FD to the
guest proxy. The guest proxy would import it and put the resource_id in
the equivalent message in our protocol extension.
QEMU would get that resource id from vsock, look up which hostmem device
is associated with that resource, and pass its FD to the compositor.
> We also need a solution for the keymap shmem block. I guess the keymap
> doesn't change all that often, so maybe it is easiest to just copy it
> over (host proxy -> guest proxy) instead of trying to map the host shmem
> into the guest?
Not sure if that would be much simpler than creating a ivshmem+hostmem
combo that wraps the incoming shmem FD and then having virtio-gpu create
a BO that imports it.
Regards,
Tomeu
next prev parent reply other threads:[~2018-02-15 15:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 13:58 [PATCH v3 0/2] " Tomeu Vizoso
2018-01-26 13:58 ` [PATCH v3 1/2] " Tomeu Vizoso
2018-02-01 16:36 ` Gerd Hoffmann
2018-02-05 8:19 ` Tomeu Vizoso
2018-02-05 12:20 ` Gerd Hoffmann
2018-02-05 14:46 ` Tomeu Vizoso
2018-02-05 16:03 ` Gerd Hoffmann
2018-02-06 12:41 ` Tomeu Vizoso
2018-02-06 14:23 ` Gerd Hoffmann
2018-02-07 1:09 ` Michael S. Tsirkin
2018-02-07 7:41 ` Tomeu Vizoso
2018-02-07 9:49 ` Tomeu Vizoso
2018-02-09 11:14 ` Tomeu Vizoso
2018-02-12 11:52 ` Gerd Hoffmann
2018-02-12 14:00 ` Tomeu Vizoso
2018-02-12 14:27 ` Gerd Hoffmann
2018-02-12 14:42 ` Tomeu Vizoso
2018-02-12 15:29 ` Gerd Hoffmann
2018-02-12 11:45 ` Gerd Hoffmann
2018-02-13 7:41 ` Pekka Paalanen
2018-02-13 14:27 ` Tomeu Vizoso
2018-02-16 10:48 ` Gerd Hoffmann
2018-02-15 15:28 ` Tomeu Vizoso [this message]
2018-02-06 15:00 ` Pekka Paalanen
2019-03-18 12:47 ` Tomeu Vizoso
2018-01-26 13:58 ` [PATCH v3 2/2] drm/virtio: Handle buffers from the compositor Tomeu Vizoso
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=5ca446c7-582c-6871-c13f-9fc44c535ebc@collabora.com \
--to=tomeu.vizoso@collabora.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=jasowang@redhat.com \
--cc=kernel@collabora.com \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=stefanha@gmail.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=zachr@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome