[PATCH 0/6] dma-fence: Remove return code of dma_fence_signal() et al.

Philipp Stanner posted 6 patches 10 hours ago
drivers/dma-buf/dma-fence.c                   | 100 +++++++++++-------
drivers/dma-buf/st-dma-fence.c                |   4 +-
drivers/gpu/drm/amd/amdkfd/kfd_process.c      |   6 +-
.../gpu/drm/ttm/tests/ttm_bo_validate_test.c  |   2 +-
drivers/gpu/drm/xe/xe_exec_queue.c            |   9 +-
drivers/gpu/drm/xe/xe_hw_fence.c              |   4 +-
drivers/gpu/drm/xe/xe_pt.c                    |   3 +-
drivers/gpu/drm/xe/xe_sched_job.c             |   2 +-
include/linux/dma-fence.h                     |  35 ++++--
9 files changed, 102 insertions(+), 63 deletions(-)
[PATCH 0/6] dma-fence: Remove return code of dma_fence_signal() et al.
Posted by Philipp Stanner 10 hours ago
Tested this with dma_buf selftests and drm_sched tests.

Changes in v2:
  - Fix bug and don't turn the kernel into a smoking pile of ashes by
    not setting the signaled-bit…
  - Add functions (dma_fence_check_and_signal()) preserving the old
    behavior of dma_fence_signal() & Co. (Felix)
  - Use those new functions in amdkfd, xe, ttm and st-dma-fence.
  - Be a bit less aggressive and keep the git-diff smaller.
  - Add a patch using the flag-helper in Xe. (Matthew)

Barely anyone uses dma_fence_signal()'s (and similar functions') return
code. Checking it is pretty much useless anyways, because what are you
going to do if a fence was already signal it? Unsignal it and signal it
again? ;p

Removing the return code simplifies the API and makes it easier for me
to sit on top with Rust DmaFence.

Philipp Stanner (8):
  dma-buf/dma-fence: Add dma_fence_test_signaled_flag()
  dma-buf/dma-fence: Add dma_fence_check_and_signal()
  amd/amdkfd: Use dma_fence_check_and_signal()
  drm/xe: Use dma_fence_check_and_signal_locked()
  dma-buf: Don't misuse dma_fence_signal()
  drm/ttm: Use dma_fence_check_and_signal()
  dma-buf/dma-fence: Remove return code of signaling-functions
  drm/xe: Use dma_fence_test_signaled_flag()

 drivers/dma-buf/dma-fence.c                   | 100 +++++++++++-------
 drivers/dma-buf/st-dma-fence.c                |   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |   6 +-
 .../gpu/drm/ttm/tests/ttm_bo_validate_test.c  |   2 +-
 drivers/gpu/drm/xe/xe_exec_queue.c            |   9 +-
 drivers/gpu/drm/xe/xe_hw_fence.c              |   4 +-
 drivers/gpu/drm/xe/xe_pt.c                    |   3 +-
 drivers/gpu/drm/xe/xe_sched_job.c             |   2 +-
 include/linux/dma-fence.h                     |  35 ++++--
 9 files changed, 102 insertions(+), 63 deletions(-)

-- 
2.49.0