mbox series

[v3,0/3] drm/vc4: Clean-up BO seqnos

Message ID 20241220134204.634577-1-mcanal@igalia.com (mailing list archive)
Headers show
Series drm/vc4: Clean-up BO seqnos | expand

Message

Maíra Canal Dec. 20, 2024, 1:37 p.m. UTC
This series introduces a series of clean-ups for BO reservations in
the VC4 driver. Currently, VC4 uses shared fences to track BO
reservations, similar to many other DRM devices. However, in addition
to DMA reservation objects, VC4 has been maintaining a separate seqno
tracking system for BOs to track job completion.

The seqno tracking system was implemented before DMA reservation
objects and was left in the code after DMA reservation's introduction.
This approach is now redundant, as job completion can be effectively
tracked using fences. Consequently, this series focuses on eliminating
seqnos from the BO implementation.

Patch Breakdown
===============

* Patch #1: Uses the DRM Exec to replace the open-coded implementation
of the functions `drm_gem_lock_reservations()` and
`drm_gem_unlock_reservations()` in the VC4 driver code. A straightforward
change with no functional changes.

* Patch #2: Implements the VC4 wait BO IOCTL using DMA Resv Objects.
The new implementation closely mirrors the V3D approach and removes
the IOCTL's dependency on BO sequence numbers.

* Patch #3: The central piece of this patchset. It removes `bo->seqno`,
`bo->write_seqno`, and `exec->bin_dep_seqno` from the driver. As the
seqno tracking system is redundant, its deletion is relatively
straightforward. The only notable change is `vc4_async_set_fence_cb()`,
which now uses `dma_fence_add_callback()` to add the VC4 callback.

Changes
=======

v1 -> v2: https://lore.kernel.org/dri-devel/20241206131706.203324-1-mcanal@igalia.com/T/

* [1/4] Use DRM Exec to replace the (un)lock reservation functions
        (Christian König)

v2 -> v3: https://lore.kernel.org/dri-devel/20241212202337.381614-1-mcanal@igalia.com/T/

* [1/4] König's A-b (Christian König)
* [2/4] s/dma_gem_dma_resv_wait/drm_gem_dma_resv_wait (Melissa Wen)
* [2/4] Use `usecs_to_jiffies()` to calculate the timeout in jiffies
        (Tvrtko Ursulin)
* [2/4] Remove -EAGAIN errno from the IOCTL (Tvrtko Ursulin)
* [3/4] s/vc4_async_page_flip_seqno_complete/vc4_async_page_flip_complete_with_cleanup
        (Melissa Wen)
* [3/4] Add `dma_fence_put()` in `vc4_async_page_flip_complete_with_cleanup()`
* [3/4] Maxime's R-b (Maxime Ripard)
* [4/4] Squashed to PATCH 3/4 (Melissa Wen)
* [4/4] Remove `vc4->seqno_cb_list` and `struct vc4_seqno_cb` (Tvrtko Ursulin)

Best Regards,
- Maíra

---

Maíra Canal (3):
  drm/vc4: Use DRM Execution Contexts
  drm/vc4: Use DMA Resv to implement VC4 wait BO IOCTL
  drm/vc4: Remove BOs seqnos

 drivers/gpu/drm/vc4/Kconfig        |   1 +
 drivers/gpu/drm/vc4/vc4_crtc.c     |  33 +++---
 drivers/gpu/drm/vc4/vc4_drv.h      |  27 -----
 drivers/gpu/drm/vc4/vc4_gem.c      | 183 ++++++-----------------------
 drivers/gpu/drm/vc4/vc4_validate.c |  11 --
 5 files changed, 53 insertions(+), 202 deletions(-)