Re: [RFC v2 0/5] gstreamer-encoder: Use a dmabuf allocator if the drawable has a valid fd (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Il giorno lun 23 gen 2023 alle ore 09:01 Vivek Kasireddy
<vivek.kasireddy@xxxxxxxxx> ha scritto:
> This patch series enables creation of Gst memory using a dmabuf fd
> as the source. This ability is useful given that dmabuf is the
> standard mechanism for sharing buffers between various drivers and
> userspace in many Graphics and Media usecases. Currently, this is
> only used/tested with Qemu and remote-viewer using the x264enc/dec
> codec to stream the Guest desktop but it can be extended to other
> plugins and applications.
> Here is the flow of things from the Spice server side:
> - The application calls gl_scanout (to update the fd) and gl_draw_async
>   and also sets the flag to indicate whether it is dealing with a local
>   or remote client.

That's weird, it's spice that knows the clients, not Qemu

> - Create a new drawable and extract the dmabuf fd from the scanout
>   as a response to QXL_CMD_DRAW cmd sent by the application.

Mumble... There's something I don't understand here. Specifically the
APIs used by Qemu. As far as I remember when Qemu passes a dmabuf
scanout there should be no QXL_CMD_DRAW command... has this changed?
That would mean 2 copies of the frame buffer, one for dmabuf and
another for memory version.

> - Share the drawable's copy of the fd with the Encoder.

As above, this should be already done by Qemu... unless changed.

> - Send the async completion cookie to the application once the encoder
>   is done using the fd.

This should already be there too in spice-server code, just not
supporting the remote case.

> v2:
> - Used the already existing gl_scanout and gl_draw_async APIs instead
>   of adding new ones.
> - Slightly refactored and improved the commits and their messages.
> Cc: Gerd Hoffmann <kraxel@xxxxxxxxxx>
> Cc: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> Cc: Dongwon Kim <>
> Vivek Kasireddy (5):
>   gstreamer-encoder: Use a dmabuf allocator for a valid fd
>   display-channel: Extract the dmabuf fd from the scanout
>   display-channel: Share the drawable's copy of fd with the encoder
>   video-stream: Force stream creation for a valid dmabuf fd
>   red-qxl: Add a new parameter to gl_scanout and gl_draw_async
>                |  2 +-
>  server/dcc-send.cpp        | 30 ++++++++++++++++++++++++
>  server/display-channel.cpp | 23 ++++++++++++++++++
>  server/display-channel.h   |  4 ++++
>  server/gstreamer-encoder.c | 48 +++++++++++++++++++++++++++++++++++---
>  server/red-qxl.cpp         | 14 +++++++----
>  server/spice-qxl.h         |  4 ++--
>  server/video-encoder.h     |  7 ++++++
>  server/video-stream.cpp    | 11 ++++++++-
>  9 files changed, 132 insertions(+), 11 deletions(-)
> --
> 2.37.2

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]