1. 29 Sep, 2021 2 commits
    • Gurchetan Singh's avatar
      drm/virtgpu api: create context init feature · b1079043
      Gurchetan Singh authored
      This change allows creating contexts of depending on set of
      context parameters.  The meaning of each of the parameters
      is listed below:
      
      1) VIRTGPU_CONTEXT_PARAM_CAPSET_ID
      
      This determines the type of a context based on the capability set
      ID.  For example, the current capsets:
      
      VIRTIO_GPU_CAPSET_VIRGL
      VIRTIO_GPU_CAPSET_VIRGL2
      
      define a Gallium, TGSI based "virgl" context.  We only need 1 capset
      ID per context type, though virgl has two due a bug that has since
      been fixed.
      
      The use case is the "gfxstream" rendering library and "venus"
      renderer.
      
      gfxstream doesn't do Gallium/TGSI translation and mostly relies on
      auto-generated API streaming.  Certain users prefer gfxstream over
      virgl for GLES on GLES emulation.  {gfxstream vk}/{venus} are also
      required for Vulkan emulation.  The maximum capset ID is 63.
      
      The goal is for guest userspace to choose the optimal context type
      depending on the situation/hardware.
      
      2) VIRTGPU_CONTEXT_PARAM_NUM_RINGS
      
      This tells the number of independent command rings that the context
      will use.  This value may be zero and is inferred to be zero if
      VIRTGPU_CONTEXT_PARAM_NUM_RINGS is not passed in.  This is for backwards
      compatibility for virgl, which has one big giant command ring for all
      commands.
      
      The maxiumum number of rings is 64.  In practice, multi-queue or
      multi-ring submission is used for powerful dGPUs and virtio-gpu
      may not be the best option in that case (see PCI passthrough or
      rendernode forwarding).
      
      3) VIRTGPU_CONTEXT_PARAM_POLL_RING_IDX_MASK
      
      This is a mask of ring indices for which the DRM fd is pollable.
      For example, if VIRTGPU_CONTEXT_PARAM_NUM_RINGS is 2, then the mask
      may be:
      
      [ring idx]  |  [1 << ring_idx] | final mask
      -------------------------------------------
          0              1                1
          1              2                3
      
      The "Sommelier" guest Wayland proxy uses this to poll for events
      from the host compositor.
      Signed-off-by: default avatarGurchetan Singh <gurchetansingh@chromium.org>
      Acked-by: default avatarLingfeng Yang <lfy@google.com>
      Acked-by: default avatarNicholas Verne <nverne@chromium.org>
      Link: http://patchwork.freedesktop.org/patch/msgid/20210921232024.817-3-gurchetansingh@chromium.orgSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      b1079043
    • Gurchetan Singh's avatar
      virtio-gpu api: multiple context types with explicit initialization · 34268c9d
      Gurchetan Singh authored
      This feature allows for each virtio-gpu 3D context to be created
      with a "context_init" variable.  This variable can specify:
      
       - the type of protocol used by the context via the capset id.
         This is useful for differentiating virgl, gfxstream, and venus
         protocols by host userspace.
      
       - other things in the future, such as the version of the context.
      
      In addition, each different context needs one or more timelines, so
      for example a virgl context's waiting can be independent on a
      gfxstream context's waiting.
      
      VIRTIO_GPU_FLAG_INFO_RING_IDX is introduced to specific to tell the
      host which per-context command ring (or "hardware queue", distinct
      from the virtio-queue) the fence should be associated with.
      
      The new capability sets (gfxstream, venus etc.) are only defined in
      the virtio-gpu spec and not defined in the header.
      Signed-off-by: default avatarGurchetan Singh <gurchetansingh@chromium.org>
      Acked-by: default avatarLingfeng Yang <lfy@google.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20210921232024.817-2-gurchetansingh@chromium.orgSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      34268c9d
  2. 28 Sep, 2021 9 commits
  3. 24 Sep, 2021 7 commits
  4. 23 Sep, 2021 12 commits
  5. 22 Sep, 2021 2 commits
  6. 21 Sep, 2021 8 commits