mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver
@ 2023-04-16 11:52 Dmitry Osipenko
  2023-04-16 11:52 ` [PATCH v6 1/3] drm/virtio: Refactor and optimize job submission code path Dmitry Osipenko
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Dmitry Osipenko @ 2023-04-16 11:52 UTC (permalink / raw)
  To: David Airlie, Gerd Hoffmann, Gurchetan Singh, Chia-I Wu,
	Daniel Vetter, Rob Clark, Marek Olšák,
	Pierre-Eric Pelloux-Prayer, Emil Velikov
  Cc: dri-devel, linux-kernel, kernel, virtualization

We have multiple Vulkan context types that are awaiting for the addition
of the sync object DRM UAPI support to the VirtIO-GPU kernel driver:

 1. Venus context
 2. Native contexts (virtio-freedreno, virtio-intel, virtio-amdgpu)

Mesa core supports DRM sync object UAPI, providing Vulkan drivers with a
generic fencing implementation that we want to utilize.

This patch adds initial sync objects support. It creates fundament for a
further fencing improvements. Later on we will want to extend the VirtIO-GPU
fencing API with passing fence IDs to host for waiting, it will be a new
additional VirtIO-GPU IOCTL and more. Today we have several VirtIO-GPU context
drivers in works that require VirtIO-GPU to support sync objects UAPI.

The patch is heavily inspired by the sync object UAPI implementation of the
MSM driver.

Changelog:

v6: - Added zeroing out of syncobj_desc, as was suggested by Emil Velikov.

    - Fixed memleak in error code path which was spotted by Emil Velikov.

    - Switched to u32/u64 instead of uint_t. Previously was keeping
      uint_t style of the virtgpu_ioctl.c, in the end decided to change
      it because it's not a proper kernel coding style after all.

    - Kept single drm_virtgpu_execbuffer_syncobj struct for both in/out
      sync objects. There was a little concern about whether it would be
      worthwhile to have separate in/out descriptors, in practice it's
      unlikely that we will extend the descs in a foreseeable future.
      There is no overhead in using same struct since we want to pad it
      to 64b anyways and it shouldn't be a problem to separate the descs
      later on if we will want to do that.

    - Added r-b from Emil Velikov.

v5: - Factored out dma-fence unwrap API usage into separate patch as was
      suggested by Emil Velikov.

    - Improved and documented the job submission reorderings as was
      requested by Emil Velikov. Sync file FD is now installed after
      job is submitted to virtio to further optimize reorderings.

    - Added comment for the kvalloc, as was requested by Emil Velikov.

    - The num_in/out_syncobjs now is set only after completed parsing
      of pre/post deps, as was requested by Emil Velikov.

v4: - Added r-b from Rob Clark to the "refactoring" patch.

    - Replaced for/while(ptr && itr) with if (ptr), like was suggested by
      Rob Clark.

    - Dropped NOWARN and NORETRY GFP flags and switched syncobj patch
      to use kvmalloc.

    - Removed unused variables from syncobj patch that were borrowed by
      accident from another (upcoming) patch after one of git rebases.

v3: - Switched to use dma_fence_unwrap_for_each(), like was suggested by
      Rob Clark.

    - Fixed missing dma_fence_put() in error code path that was spotted by
      Rob Clark.

    - Removed obsoleted comment to virtio_gpu_execbuffer_ioctl(), like was
      suggested by Rob Clark.

v2: - Fixed chain-fence context matching by making use of
      dma_fence_chain_contained().

    - Fixed potential uninitialized var usage in error code patch of
      parse_post_deps(). MSM driver had a similar issue that is fixed
      already in upstream.

    - Added new patch that refactors job submission code path. I found
      that it was very difficult to add a new/upcoming host-waits feature
      because of how variables are passed around the code, the virtgpu_ioctl.c
      also was growing to unmanageable size.

Dmitry Osipenko (3):
  drm/virtio: Refactor and optimize job submission code path
  drm/virtio: Wait for each dma-fence of in-fence array individually
  drm/virtio: Support sync objects

 drivers/gpu/drm/virtio/Makefile         |   2 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c    |   3 +-
 drivers/gpu/drm/virtio/virtgpu_drv.h    |   4 +
 drivers/gpu/drm/virtio/virtgpu_ioctl.c  | 182 --------
 drivers/gpu/drm/virtio/virtgpu_submit.c | 530 ++++++++++++++++++++++++
 include/uapi/drm/virtgpu_drm.h          |  16 +-
 6 files changed, 552 insertions(+), 185 deletions(-)
 create mode 100644 drivers/gpu/drm/virtio/virtgpu_submit.c

-- 
2.39.2


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-07-31 22:47 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-16 11:52 [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver Dmitry Osipenko
2023-04-16 11:52 ` [PATCH v6 1/3] drm/virtio: Refactor and optimize job submission code path Dmitry Osipenko
2023-04-16 11:52 ` [PATCH v6 2/3] drm/virtio: Wait for each dma-fence of in-fence array individually Dmitry Osipenko
2023-04-16 11:52 ` [PATCH v6 3/3] drm/virtio: Support sync objects Dmitry Osipenko
2023-05-01 15:29   ` Dmitry Osipenko
2023-06-25  8:47   ` Geert Uytterhoeven
2023-06-25 12:41     ` Dmitry Osipenko
2023-06-25 15:36       ` Geert Uytterhoeven
2023-06-26 16:11         ` Dmitry Osipenko
2023-06-27 12:01           ` Geert Uytterhoeven
2023-07-19 18:58             ` Dmitry Osipenko
2023-07-31 22:47   ` Dmitry Osipenko
     [not found] ` <CAAfnVB=5TVKxUmLhNMLMdgAPx7KoSKTsZQtq7Hv36FcP7bmgLA@mail.gmail.com>
2023-04-19 21:22   ` [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver Dmitry Osipenko
2023-04-24 18:40     ` Gurchetan Singh
2023-05-01 15:38 ` Dmitry Osipenko
2023-05-03  6:51   ` Gerd Hoffmann
2023-05-08 12:16     ` Dmitry Osipenko
     [not found]   ` <CAAfnVBnrUotph4TYJVu9Bohqv3m80t90V34TNhh-Tspxwsj-ZQ@mail.gmail.com>
2023-05-08 13:59     ` Rob Clark
     [not found]       ` <CAAfnVBkLhYVaSG3U_QUZwXLFv-XT=9F2v2pgrCDQQBgNZ3MSWA@mail.gmail.com>
2023-05-12  2:33         ` Dmitry Osipenko
     [not found]           ` <CAAfnVBmwVTBNx4GC2hiYQ9Ya8ufP_D8N0-JOzT2iPV9BYZhD9w@mail.gmail.com>
2023-06-27 17:16             ` Rob Clark
2023-07-19 18:58               ` Dmitry Osipenko
     [not found]                 ` <CAAfnVB=qOjM1EQUyxdczu9KOGjD0sieoTODohbHz4ZDN0mqojw@mail.gmail.com>
2023-07-31 16:26                   ` Dmitry Osipenko
2023-06-03  2:11 ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®