Skip to content
Snippets Groups Projects
  1. Nov 11, 2023
  2. Jul 31, 2023
  3. Feb 06, 2023
  4. Nov 29, 2021
  5. Sep 29, 2021
    • Gurchetan Singh's avatar
      drm/virtgpu api: create context init feature · b1079043
      Gurchetan Singh authored and Gerd Hoffmann's avatar Gerd Hoffmann committed
      
      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.org
      
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      b1079043
  6. Sep 29, 2020
  7. Nov 14, 2018
  8. Feb 27, 2018
  9. May 13, 2016
  10. Dec 10, 2015
  11. Oct 16, 2015
Loading