Skip to content
Snippets Groups Projects
  1. Oct 23, 2023
  2. Oct 17, 2023
    • Thomas Hellström's avatar
      Documentation/gpu: Add a VM_BIND async document · 6f2eeef4
      Thomas Hellström authored
      
      Add a motivation for and description of asynchronous VM_BIND operation
      
      v2:
      - Fix typos (Nirmoy Das)
      - Improve the description of a memory fence (Oak Zeng)
      - Add a reference to the document in the Xe RFC.
      - Add pointers to sample uAPI suggestions
      v3:
      - Address review comments (Danilo Krummrich)
      - Formatting fixes
      v4:
      - Address typos (Francois Dugast)
      - Explain why in-fences are not allowed for VM_BIND operations for long-
        running workloads (Matthew Brost)
      v5:
      - More typo- and style fixing
      - Further clarify the implications of disallowing in-fences for VM_BIND
        operations for long-running workloads (Matthew Brost)
      v6:
      - Point out that a gpu_vm is a virtual GPU Address space.
        (Danilo Krummrich)
      - For an explanation of dma-fences point to the dma-fence documentation.
        (Paulo Zanoni)
      - Clarify that VM_BIND errors are reported synchronously. (Paulo Zanoni)
      - Use an rst doc reference when pointing to the async vm_bind document
        from the xe merge plan.
      - Add the VM_BIND documentation to the drm documentation table-of-content,
        using an intermediate "Misc DRM driver uAPI- and feature implementation
        guidelines"
      v7:
      - Update the error handling documentation to remove the VM error state.
      v8:
      - Clarify error handling and difference in operation support between
        async VM_BIND and sync VM_BIND. (Paulo Zanoni)
      - Update the sample uAPI with a self-contained example. (Paulo Zanoni)
      
      Cc: Paulo R Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Acked-by: default avatarNirmoy Das <nirmoy.das@intel.com>
      Reviewed-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231012132552.20196-1-thomas.hellstrom@linux.intel.com
      6f2eeef4
  3. Oct 09, 2023
  4. Oct 04, 2023
    • Adrián Larumbe's avatar
      drm/panfrost: Add fdinfo support GPU load metrics · f11b0417
      Adrián Larumbe authored
      
      The drm-stats fdinfo tags made available to user space are drm-engine,
      drm-cycles, drm-max-freq and drm-curfreq, one per job slot.
      
      This deviates from standard practice in other DRM drivers, where a single
      set of key:value pairs is provided for the whole render engine. However,
      Panfrost has separate queues for fragment and vertex/tiler jobs, so a
      decision was made to calculate bus cycles and workload times separately.
      
      Maximum operating frequency is calculated at devfreq initialisation time.
      Current frequency is made available to user space because nvtop uses it
      when performing engine usage calculations.
      
      It is important to bear in mind that both GPU cycle and kernel time numbers
      provided are at best rough estimations, and always reported in excess from
      the actual figure because of two reasons:
       - Excess time because of the delay between the end of a job processing,
         the subsequent job IRQ and the actual time of the sample.
       - Time spent in the engine queue waiting for the GPU to pick up the next
         job.
      
      To avoid race conditions during enablement/disabling, a reference counting
      mechanism was introduced, and a job flag that tells us whether a given job
      increased the refcount. This is necessary, because user space can toggle
      cycle counting through a debugfs file, and a given job might have been in
      flight by the time cycle counting was disabled.
      
      The main goal of the debugfs cycle counter knob is letting tools like nvtop
      or IGT's gputop switch it at any time, to avoid power waste in case no
      engine usage measuring is necessary.
      
      Also add a documentation file explaining the possible values for fdinfo's
      engine keystrings and Panfrost-specific drm-curfreq-<keystr> pairs.
      
      Signed-off-by: default avatarAdrián Larumbe <adrian.larumbe@collabora.com>
      Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
      Reviewed-by: default avatarSteven Price <steven.price@arm.com>
      Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230929181616.2769345-3-adrian.larumbe@collabora.com
      f11b0417
  5. Oct 02, 2023
  6. Sep 27, 2023
  7. Sep 07, 2023
  8. Aug 31, 2023
  9. Aug 29, 2023
  10. Aug 21, 2023
  11. Aug 18, 2023
  12. Aug 04, 2023
    • Danilo Krummrich's avatar
      drm/nouveau: implement new VM_BIND uAPI · b88baab8
      Danilo Krummrich authored
      
      This commit provides the implementation for the new uapi motivated by the
      Vulkan API. It allows user mode drivers (UMDs) to:
      
      1) Initialize a GPU virtual address (VA) space via the new
         DRM_IOCTL_NOUVEAU_VM_INIT ioctl for UMDs to specify the portion of VA
         space managed by the kernel and userspace, respectively.
      
      2) Allocate and free a VA space region as well as bind and unbind memory
         to the GPUs VA space via the new DRM_IOCTL_NOUVEAU_VM_BIND ioctl.
         UMDs can request the named operations to be processed either
         synchronously or asynchronously. It supports DRM syncobjs
         (incl. timelines) as synchronization mechanism. The management of the
         GPU VA mappings is implemented with the DRM GPU VA manager.
      
      3) Execute push buffers with the new DRM_IOCTL_NOUVEAU_EXEC ioctl. The
         execution happens asynchronously. It supports DRM syncobj (incl.
         timelines) as synchronization mechanism. DRM GEM object locking is
         handled with drm_exec.
      
      Both, DRM_IOCTL_NOUVEAU_VM_BIND and DRM_IOCTL_NOUVEAU_EXEC, use the DRM
      GPU scheduler for the asynchronous paths.
      
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230804182406.5222-12-dakr@redhat.com
      b88baab8
    • Danilo Krummrich's avatar
      drm/nouveau: new VM_BIND uAPI interfaces · e0223899
      Danilo Krummrich authored
      
      This commit provides the interfaces for the new UAPI motivated by the
      Vulkan API. It allows user mode drivers (UMDs) to:
      
      1) Initialize a GPU virtual address (VA) space via the new
         DRM_IOCTL_NOUVEAU_VM_INIT ioctl. UMDs can provide a kernel reserved
         VA area.
      
      2) Bind and unbind GPU VA space mappings via the new
         DRM_IOCTL_NOUVEAU_VM_BIND ioctl.
      
      3) Execute push buffers with the new DRM_IOCTL_NOUVEAU_EXEC ioctl.
      
      Both, DRM_IOCTL_NOUVEAU_VM_BIND and DRM_IOCTL_NOUVEAU_EXEC support
      asynchronous processing with DRM syncobjs as synchronization mechanism.
      
      The default DRM_IOCTL_NOUVEAU_VM_BIND is synchronous processing,
      DRM_IOCTL_NOUVEAU_EXEC supports asynchronous processing only.
      
      Reviewed-by: default avatarFaith Ekstrand <faith.ekstrand@collabora.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Co-developed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230804182406.5222-4-dakr@redhat.com
      e0223899
  13. Aug 03, 2023
  14. Aug 01, 2023
    • Douglas Anderson's avatar
      drm/panel: Check for already prepared/enabled in drm_panel · d2aacaf0
      Douglas Anderson authored
      In a whole pile of panel drivers, we have code to make the
      prepare/unprepare/enable/disable callbacks behave as no-ops if they've
      already been called. It's silly to have this code duplicated
      everywhere. Add it to the core instead so that we can eventually
      delete it from all the drivers. Note: to get some idea of the
      duplicated code, try:
        git grep 'if.*>prepared' -- drivers/gpu/drm/panel
        git grep 'if.*>enabled' -- drivers/gpu/drm/panel
      
      NOTE: arguably, the right thing to do here is actually to skip this
      patch and simply remove all the extra checks from the individual
      drivers. Perhaps the checks were needed at some point in time in the
      past but maybe they no longer are? Certainly as we continue
      transitioning over to "panel_bridge" then we expect there to be much
      less variety in how these calls are made. When we're called as part of
      the bridge chain, things should be pretty simple. In fact, there was
      some discussion in the past about these checks [1], including a
      discussion about whether the checks were needed and whether the calls
      ought to be refcounted. At the time, I decided not to mess with it
      because it felt too risky.
      
      Looking closer at it now, I'm fairly certain that nothing in the
      existing codebase is expecting these calls to be refcounted. The only
      real question is whether someone is already doing something to ensure
      prepare()/unprepare() match and enabled()/disable() match. I would say
      that, even if there is something else ensuring that things match,
      there's enough complexity that adding an extra bool and an extra
      double-check here is a good idea. Let's add a drm_warn() to let people
      know that it's considered a minor error to take advantage of
      drm_panel's double-checking but we'll still make things work fine.
      
      We'll also add an entry to the official DRM todo list to remove the
      now pointless check from the panels after this patch lands and,
      eventually, fixup anyone who is triggering the new warning.
      
      [1] https://lore.kernel.org/r/20210416153909.v4.27.I502f2a92ddd36c3d28d014dd75e170c2d405a0a5@changeid
      
      
      
      Acked-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Reviewed-by: default avatarMaxime Ripard <mripard@kernel.org>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230727101636.v4.2.I59b417d4c29151cc2eff053369ec4822b606f375@changeid
      d2aacaf0
  15. Jul 29, 2023
  16. Jul 20, 2023
  17. Jul 12, 2023
  18. Jul 07, 2023
  19. Jun 27, 2023
    • Thomas Zimmermann's avatar
      fbdev: Make support for userspace interfaces configurable · 701d2054
      Thomas Zimmermann authored
      
      Add Kconfig option CONFIG_FB_DEVICE and make the virtual fbdev
      device optional. If the new option has not been selected, fbdev
      does not create files in devfs, sysfs or procfs.
      
      Most modern Linux systems run a DRM-based graphics stack that uses
      the kernel's framebuffer console, but has otherwise deprecated fbdev
      support. Yet fbdev userspace interfaces are still present.
      
      The option makes it possible to use the fbdev subsystem as console
      implementation without support for userspace. This closes potential
      entry points to manipulate kernel or I/O memory via framebuffers. It
      also prevents the execution of driver code via ioctl or sysfs, both
      of which might allow malicious software to exploit bugs in the fbdev
      code.
      
      A small number of fbdev drivers require struct fbinfo.dev to be
      initialized, usually for the support of sysfs interface. Make these
      drivers depend on FB_DEVICE. They can later be fixed if necessary.
      
      v3:
      	* effect -> affect in Kconfig help (Daniel)
      v2:
      	* set FB_DEVICE default to y (Geert)
      	* comment on {get,put}_device() (Sam)
      	* Kconfig fixes (Sam)
      	* add TODO item about FB_DEVICE dependencies (Sam)
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-39-tzimmermann@suse.de
      701d2054
  20. Jun 26, 2023
  21. Jun 19, 2023
  22. Jun 09, 2023
  23. May 24, 2023
  24. May 08, 2023
  25. Apr 27, 2023
  26. Apr 26, 2023
  27. Apr 19, 2023
Loading