[Qemu-devel] [PATCH v3 00/26] vhost-user for input & GPU

Marc-André Lureau posted 26 patches 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180618161729.334-1-marcandre.lureau@redhat.com
Test checkpatch failed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
There is a newer version of this series
contrib/libvhost-user/libvhost-user-glib.h |    3 +
contrib/libvhost-user/libvhost-user.h      |    3 +
contrib/vhost-user-gpu/drm.h               |   63 ++
contrib/vhost-user-gpu/virgl.h             |   25 +
contrib/vhost-user-gpu/vugpu.h             |  167 +++
hw/display/virtio-vga.h                    |   22 +
hw/virtio/virtio-pci.h                     |   27 +-
include/hw/virtio/vhost-backend.h          |    6 +
include/hw/virtio/vhost-user-blk.h         |    2 +-
include/hw/virtio/vhost-user-scsi.h        |    2 +-
include/hw/virtio/vhost-user.h             |    2 +-
include/hw/virtio/virtio-gpu-bswap.h       |   48 +
include/hw/virtio/virtio-gpu.h             |   90 +-
include/hw/virtio/virtio-input.h           |   14 +
include/io/channel-command.h               |   18 +
include/qemu/drm.h                         |    6 +
include/sysemu/vhost-user-backend.h        |   60 ++
include/ui/console.h                       |    1 +
backends/cryptodev-vhost-user.c            |   18 +-
backends/vhost-user.c                      |  320 ++++++
chardev/char-fe.c                          |    6 +-
chardev/char-socket.c                      |    8 +-
contrib/libvhost-user/libvhost-user-glib.c |   15 +-
contrib/libvhost-user/libvhost-user.c      |    3 +-
contrib/vhost-user-gpu/drm.c               |  189 ++++
contrib/vhost-user-gpu/main.c              | 1100 ++++++++++++++++++++
contrib/vhost-user-gpu/virgl.c             |  579 +++++++++++
contrib/vhost-user-input/main.c            |  364 +++++++
hw/block/vhost-user-blk.c                  |   22 +-
hw/display/vhost-user-gpu-pci.c            |   51 +
hw/display/vhost-user-gpu.c                |  488 +++++++++
hw/display/vhost-user-vga.c                |   52 +
hw/display/virtio-gpu-3d.c                 |   70 +-
hw/display/virtio-gpu-base.c               |  292 ++++++
hw/display/virtio-gpu-pci.c                |   39 +-
hw/display/virtio-gpu.c                    |  367 ++-----
hw/display/virtio-vga.c                    |  127 ++-
hw/input/vhost-user-input.c                |  110 ++
hw/scsi/vhost-user-scsi.c                  |   20 +-
hw/virtio/vhost-stub.c                     |    2 +-
hw/virtio/vhost-user.c                     |  143 ++-
hw/virtio/virtio-pci.c                     |   20 +
io/channel-command.c                       |   33 +-
net/vhost-user.c                           |    8 +-
ui/egl-helpers.c                           |   51 +-
ui/spice-display.c                         |    3 +-
util/drm.c                                 |   66 ++
vl.c                                       |    4 +-
MAINTAINERS                                |   12 +-
Makefile                                   |    6 +
Makefile.objs                              |    2 +
backends/Makefile.objs                     |    3 +-
configure                                  |   35 +
contrib/vhost-user-gpu/Makefile.objs       |   10 +
contrib/vhost-user-input/Makefile.objs     |    1 +
docs/interop/vhost-user-gpu.txt            |  236 +++++
docs/interop/vhost-user.txt                |   15 +
hw/display/Makefile.objs                   |    5 +-
hw/input/Makefile.objs                     |    1 +
util/Makefile.objs                         |    1 +
60 files changed, 4871 insertions(+), 585 deletions(-)
create mode 100644 contrib/vhost-user-gpu/drm.h
create mode 100644 contrib/vhost-user-gpu/virgl.h
create mode 100644 contrib/vhost-user-gpu/vugpu.h
create mode 100644 hw/display/virtio-vga.h
create mode 100644 include/hw/virtio/virtio-gpu-bswap.h
create mode 100644 include/qemu/drm.h
create mode 100644 include/sysemu/vhost-user-backend.h
create mode 100644 backends/vhost-user.c
create mode 100644 contrib/vhost-user-gpu/drm.c
create mode 100644 contrib/vhost-user-gpu/main.c
create mode 100644 contrib/vhost-user-gpu/virgl.c
create mode 100644 contrib/vhost-user-input/main.c
create mode 100644 hw/display/vhost-user-gpu-pci.c
create mode 100644 hw/display/vhost-user-gpu.c
create mode 100644 hw/display/vhost-user-vga.c
create mode 100644 hw/display/virtio-gpu-base.c
create mode 100644 hw/input/vhost-user-input.c
create mode 100644 util/drm.c
create mode 100644 contrib/vhost-user-gpu/Makefile.objs
create mode 100644 contrib/vhost-user-input/Makefile.objs
create mode 100644 docs/interop/vhost-user-gpu.txt
[Qemu-devel] [PATCH v3 00/26] vhost-user for input & GPU
Posted by Marc-André Lureau 5 years, 10 months ago
Hi,

vhost-user allows to drive a virtio device in a seperate
process. After vhost-user-net, we have seen
vhost-user-{scsi,blk,crypto} added more recently.

This series, initially proposed 2 years ago
(https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01905.html)
contributes with vhost-user-input and vhost-user-gpu.

Additionally, to factor out common code and ease the usage, a
vhost-user-backend is introduced as an intermediary object between the
backend and the qemu device.

You may start a vhost-user-gpu with virgl rendering in a separate
process like this:

$ ./vhost-user-gpu --virgl -s vgpu.sock &
$ qemu...
  -chardev socket,id=chr,path=vgpu.sock
  -object vhost-user-backend,id=vug,chardev=chr
  -device vhost-user-vga,vhost-user=vug

You may also specify the backend command and the arguments as part of
vhost-user-backend qemu arguments. For example, to start a
vhost-user-input backend on input device /dev/input/event19:

-object vhost-user-backend,id=vuid,cmd="vhost-user-input /dev/input/event19"
-device virtio-input-host-pci,vhost-user=vuid

The vhost-user-gpu backend requires virgl from git.

Feedback welcome,

v3: deal with most comments from rfcv2 and various improvements
 - "vhost-user-backend: allow to specify binary to execute" as seperate
  patch, not for inclusion since Daniel as concerned about parsing
  shell strings with glib
 - use dmabuf to share 2d rendering result (with intel gem only atm)
 - document the vhost-user-gpu protocol
 - make vhost-user-gpu-pci and vhost-user-vga seperate devices (instead
   of adding vhost-user support to existing devices)
 - allow to specify virgl rendering, and rendernode
 - let's promote out of RFC status :)

RFCv2: (addressing some of Gerd comments digged in the archives)
 - rebased, clean ups, various small fixes, update commit messages
 - teach the vhost-user-backend to take a chardev
 - add vhost-user-input-pci, instead of adding vhost code to virtio-input-host-pci

Marc-André Lureau (26):
  chardev: avoid crash if no associated address
  chardev: remove qemu_chr_fe_write_all() counter
  dmabuf: add y0_top, pass it to spice
  vhost-user: simplify vhost_user_init/vhost_user_cleanup
  libvhost-user: exit by default on VHOST_USER_NONE
  vhost-user: wrap some read/write with retry handling
  qio: add qio_channel_command_new_spawn_with_pre_exec()
  Add vhost-user-backend
  HACK: vhost-user-backend: allow to specify binary to execute
  vhost-user: split vhost_user_read()
  vhost-user: add vhost_user_input_get_config()
  libvhost-user: export vug_source_new()
  contrib: add vhost-user-input
  Add vhost-user-input-pci
  vhost-user: add vhost_user_gpu_set_socket()
  vhost-user: add vhost_user_gpu_get_num_capsets()
  virtio: add virtio-gpu bswap helpers header
  util: promote qemu_egl_rendernode_open() to libqemuutil
  contrib: add vhost-user-gpu
  virtio-gpu: remove unused qdev
  virtio-gpu: remove unused config_size
  virtio-gpu: block both 2d and 3d rendering
  virtio-gpu: remove useless 'waiting' field
  virtio-gpu: split virtio-gpu, introduce virtio-gpu-base
  virtio-gpu: split virtio-gpu-pci & virtio-vga
  hw/display: add vhost-user-vga & gpu-pci

 contrib/libvhost-user/libvhost-user-glib.h |    3 +
 contrib/libvhost-user/libvhost-user.h      |    3 +
 contrib/vhost-user-gpu/drm.h               |   63 ++
 contrib/vhost-user-gpu/virgl.h             |   25 +
 contrib/vhost-user-gpu/vugpu.h             |  167 +++
 hw/display/virtio-vga.h                    |   22 +
 hw/virtio/virtio-pci.h                     |   27 +-
 include/hw/virtio/vhost-backend.h          |    6 +
 include/hw/virtio/vhost-user-blk.h         |    2 +-
 include/hw/virtio/vhost-user-scsi.h        |    2 +-
 include/hw/virtio/vhost-user.h             |    2 +-
 include/hw/virtio/virtio-gpu-bswap.h       |   48 +
 include/hw/virtio/virtio-gpu.h             |   90 +-
 include/hw/virtio/virtio-input.h           |   14 +
 include/io/channel-command.h               |   18 +
 include/qemu/drm.h                         |    6 +
 include/sysemu/vhost-user-backend.h        |   60 ++
 include/ui/console.h                       |    1 +
 backends/cryptodev-vhost-user.c            |   18 +-
 backends/vhost-user.c                      |  320 ++++++
 chardev/char-fe.c                          |    6 +-
 chardev/char-socket.c                      |    8 +-
 contrib/libvhost-user/libvhost-user-glib.c |   15 +-
 contrib/libvhost-user/libvhost-user.c      |    3 +-
 contrib/vhost-user-gpu/drm.c               |  189 ++++
 contrib/vhost-user-gpu/main.c              | 1100 ++++++++++++++++++++
 contrib/vhost-user-gpu/virgl.c             |  579 +++++++++++
 contrib/vhost-user-input/main.c            |  364 +++++++
 hw/block/vhost-user-blk.c                  |   22 +-
 hw/display/vhost-user-gpu-pci.c            |   51 +
 hw/display/vhost-user-gpu.c                |  488 +++++++++
 hw/display/vhost-user-vga.c                |   52 +
 hw/display/virtio-gpu-3d.c                 |   70 +-
 hw/display/virtio-gpu-base.c               |  292 ++++++
 hw/display/virtio-gpu-pci.c                |   39 +-
 hw/display/virtio-gpu.c                    |  367 ++-----
 hw/display/virtio-vga.c                    |  127 ++-
 hw/input/vhost-user-input.c                |  110 ++
 hw/scsi/vhost-user-scsi.c                  |   20 +-
 hw/virtio/vhost-stub.c                     |    2 +-
 hw/virtio/vhost-user.c                     |  143 ++-
 hw/virtio/virtio-pci.c                     |   20 +
 io/channel-command.c                       |   33 +-
 net/vhost-user.c                           |    8 +-
 ui/egl-helpers.c                           |   51 +-
 ui/spice-display.c                         |    3 +-
 util/drm.c                                 |   66 ++
 vl.c                                       |    4 +-
 MAINTAINERS                                |   12 +-
 Makefile                                   |    6 +
 Makefile.objs                              |    2 +
 backends/Makefile.objs                     |    3 +-
 configure                                  |   35 +
 contrib/vhost-user-gpu/Makefile.objs       |   10 +
 contrib/vhost-user-input/Makefile.objs     |    1 +
 docs/interop/vhost-user-gpu.txt            |  236 +++++
 docs/interop/vhost-user.txt                |   15 +
 hw/display/Makefile.objs                   |    5 +-
 hw/input/Makefile.objs                     |    1 +
 util/Makefile.objs                         |    1 +
 60 files changed, 4871 insertions(+), 585 deletions(-)
 create mode 100644 contrib/vhost-user-gpu/drm.h
 create mode 100644 contrib/vhost-user-gpu/virgl.h
 create mode 100644 contrib/vhost-user-gpu/vugpu.h
 create mode 100644 hw/display/virtio-vga.h
 create mode 100644 include/hw/virtio/virtio-gpu-bswap.h
 create mode 100644 include/qemu/drm.h
 create mode 100644 include/sysemu/vhost-user-backend.h
 create mode 100644 backends/vhost-user.c
 create mode 100644 contrib/vhost-user-gpu/drm.c
 create mode 100644 contrib/vhost-user-gpu/main.c
 create mode 100644 contrib/vhost-user-gpu/virgl.c
 create mode 100644 contrib/vhost-user-input/main.c
 create mode 100644 hw/display/vhost-user-gpu-pci.c
 create mode 100644 hw/display/vhost-user-gpu.c
 create mode 100644 hw/display/vhost-user-vga.c
 create mode 100644 hw/display/virtio-gpu-base.c
 create mode 100644 hw/input/vhost-user-input.c
 create mode 100644 util/drm.c
 create mode 100644 contrib/vhost-user-gpu/Makefile.objs
 create mode 100644 contrib/vhost-user-input/Makefile.objs
 create mode 100644 docs/interop/vhost-user-gpu.txt

-- 
2.18.0.rc1


Re: [Qemu-devel] [PATCH v3 00/26] vhost-user for input & GPU
Posted by no-reply@patchew.org 5 years, 10 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180618161729.334-1-marcandre.lureau@redhat.com
Subject: [Qemu-devel] [PATCH v3 00/26] vhost-user for input & GPU

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
5b9f38a1ca hw/display: add vhost-user-vga & gpu-pci
326428ad0c virtio-gpu: split virtio-gpu-pci & virtio-vga
875a640573 virtio-gpu: split virtio-gpu, introduce virtio-gpu-base
30f670795b virtio-gpu: remove useless 'waiting' field
8b62eaebc8 virtio-gpu: block both 2d and 3d rendering
099eb18894 virtio-gpu: remove unused config_size
c7ebfdac23 virtio-gpu: remove unused qdev
bcbc153a12 contrib: add vhost-user-gpu
287104e286 util: promote qemu_egl_rendernode_open() to libqemuutil
1734608225 virtio: add virtio-gpu bswap helpers header
fe8a420d35 vhost-user: add vhost_user_gpu_get_num_capsets()
106d9b6c82 vhost-user: add vhost_user_gpu_set_socket()
73ac986cce Add vhost-user-input-pci
7b3ced4f9e contrib: add vhost-user-input
6285d76ff7 libvhost-user: export vug_source_new()
901a25da6d vhost-user: add vhost_user_input_get_config()
7d0d590b7f vhost-user: split vhost_user_read()
a9bdc75110 HACK: vhost-user-backend: allow to specify binary to execute
c228612ab8 Add vhost-user-backend
0617a84bf3 qio: add qio_channel_command_new_spawn_with_pre_exec()
07bff83cac vhost-user: wrap some read/write with retry handling
a836d90351 libvhost-user: exit by default on VHOST_USER_NONE
fc54036235 vhost-user: simplify vhost_user_init/vhost_user_cleanup
9438a02db7 dmabuf: add y0_top, pass it to spice
9074228c84 chardev: remove qemu_chr_fe_write_all() counter
58f6db3fb0 chardev: avoid crash if no associated address

=== OUTPUT BEGIN ===
Checking PATCH 1/26: chardev: avoid crash if no associated address...
Checking PATCH 2/26: chardev: remove qemu_chr_fe_write_all() counter...
Checking PATCH 3/26: dmabuf: add y0_top, pass it to spice...
Checking PATCH 4/26: vhost-user: simplify vhost_user_init/vhost_user_cleanup...
Checking PATCH 5/26: libvhost-user: exit by default on VHOST_USER_NONE...
Checking PATCH 6/26: vhost-user: wrap some read/write with retry handling...
Checking PATCH 7/26: qio: add qio_channel_command_new_spawn_with_pre_exec()...
Checking PATCH 8/26: Add vhost-user-backend...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#35: 
new file mode 100644

total: 0 errors, 1 warnings, 335 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 9/26: HACK: vhost-user-backend: allow to specify binary to execute...
Checking PATCH 10/26: vhost-user: split vhost_user_read()...
Checking PATCH 11/26: vhost-user: add vhost_user_input_get_config()...
Checking PATCH 12/26: libvhost-user: export vug_source_new()...
Checking PATCH 13/26: contrib: add vhost-user-input...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#78: 
new file mode 100644

total: 0 errors, 1 warnings, 403 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 14/26: Add vhost-user-input-pci...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#42: 
new file mode 100644

total: 0 errors, 1 warnings, 215 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 15/26: vhost-user: add vhost_user_gpu_set_socket()...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#52: 
new file mode 100644

total: 0 errors, 1 warnings, 298 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 16/26: vhost-user: add vhost_user_gpu_get_num_capsets()...
Checking PATCH 17/26: virtio: add virtio-gpu bswap helpers header...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#74: 
new file mode 100644

total: 0 errors, 1 warnings, 103 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 18/26: util: promote qemu_egl_rendernode_open() to libqemuutil...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#27: 
new file mode 100644

total: 0 errors, 1 warnings, 151 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 19/26: contrib: add vhost-user-gpu...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#133: 
new file mode 100644

total: 0 errors, 1 warnings, 2219 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 20/26: virtio-gpu: remove unused qdev...
Checking PATCH 21/26: virtio-gpu: remove unused config_size...
Checking PATCH 22/26: virtio-gpu: block both 2d and 3d rendering...
Checking PATCH 23/26: virtio-gpu: remove useless 'waiting' field...
Checking PATCH 24/26: virtio-gpu: split virtio-gpu, introduce virtio-gpu-base...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#175: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#1196: FILE: include/hw/virtio/virtio-gpu.h:124:
+#define VIRTIO_GPU_BASE_PROPERTIES(_state, _conf)                       \
+    DEFINE_PROP_UINT32("max_outputs", _state, _conf.max_outputs, 1),    \
+    DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1024),               \
+    DEFINE_PROP_UINT32("yres", _state, _conf.yres, 768)

total: 1 errors, 1 warnings, 1143 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 25/26: virtio-gpu: split virtio-gpu-pci & virtio-vga...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#358: 
new file mode 100644

total: 0 errors, 1 warnings, 373 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 26/26: hw/display: add vhost-user-vga & gpu-pci...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#37: 
new file mode 100644

total: 0 errors, 1 warnings, 647 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com