Skip to content

RFC Convert requests to use struct fence

[email protected] intel-gfx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest12 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12staging/android/sync: Support sync points created from dma-fencesdrivers/staging/android/sync_debug.c+22 -202 replies
2/12staging/android/sync: add sync_fence_create_dmadrivers/staging/android/sync.c drivers/staging/android/sync.h+20 -54 replies
3/12staging/android/sync: Move sync framework out of stagingdrivers/android/Kconfig drivers/android/Makefile drivers/android/sw_sync.c +19 more+1920 -19160 replies
4/12drm/i915: Convert requests to use struct fencedrivers/gpu/drm/i915/i915_debugfs.c drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c +3 more+81 -300 replies
5/12drm/i915: Removed now redudant parameter to i915_gem_request_completed()drivers/gpu/drm/i915/i915_debugfs.c drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c +2 more+14 -150 replies
6/12drm/i915: Add per context timelines to fence objectdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/i915_gem_context.c +2 more+111 -180 replies
7/12drm/i915: Delay the freeing of requests until retire timedrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/intel_display.c +4 more+48 -250 replies
8/12drm/i915: Interrupt driven fencesdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/i915_irq.c +3 more+196 -91 reply
9/12drm/i915: Updated request structure tracingdrivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/i915_irq.c drivers/gpu/drm/i915/i915_trace.h+13 -80 replies
10/12android/sync: Fix reversed sense of signaled fencedrivers/android/sync.h+21 -00 replies
11/12drm/i915: Add sync framework support to execbuff IOCTLdrivers/gpu/drm/i915/Kconfig drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c +2 more+198 -90 replies
12/12drm/i915: Cache last IRQ seqno to reduce IRQ overheaddrivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/intel_ringbuffer.h+12 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/12] Convert requests to use struct fence

From: John Harrison <[email protected]>

There is a construct in the linux kernel called 'struct fence' that is intended to keep track of work that is executed on hardware. I.e. it solves the basic problem that the drivers 'struct drm_i915_gem_request' is trying to address. The request structure does quite a lot more than simply track the execution progress so is very definitely still required. However, the basic completion status side could be updated to use the ready made fence implementation and gain all the advantages that provides.

Using the struct fence object also has the advantage that the fence can be used outside of the i915 driver (by other drivers or by userland applications). That is the basis of the dma-buff synchronisation API and allows asynchronous tracking of work completion. In this case, it allows applications to be signalled directly when a batch buffer completes without having to make an IOCTL call into the driver.

This is work that was planned since the conversion of the driver from being seqno value based to being request structure based. This patch series does that work.

An IGT test to exercise the fence support from user land is in progress and will follow. Android already makes extensive use of fences for display composition. Real world linux usage is planned in the form of Jesse's page table sharing / bufferless execbuf support. There is also a plan that Wayland (and others) could make use of it in a similar manner to Android.

v2: Updated for review comments by various people and to add support for Android style 'native sync'.

v3: Updated from review comments by Tvrtko Ursulin. Also moved sync framework out of staging and improved request completion handling.

[Patches against drm-intel-nightly tree fetched 17/11/2015]

John Harrison (9):
staging/android/sync: Move sync framework out of staging drm/i915: Convert requests to use struct fence
drm/i915: Removed now redudant parameter to i915_gem_request_completed() drm/i915: Add per context timelines to fence object drm/i915: Delay the freeing of requests until retire time drm/i915: Interrupt driven fences
drm/i915: Updated request structure tracing
drm/i915: Add sync framework support to execbuff IOCTL drm/i915: Cache last IRQ seqno to reduce IRQ overhead

Maarten Lankhorst (1):
staging/android/sync: add sync_fence_create_dma

Peter Lawthers (1):
android/sync: Fix reversed sense of signaled fence

Tvrtko Ursulin (1):
staging/android/sync: Support sync points created from dma-fences

 drivers/android/Kconfig                    |  28 ++
 drivers/android/Makefile                   |   2 +
 drivers/android/sw_sync.c                  | 260 ++++++++++
 drivers/android/sw_sync.h                  |  59 +++
 drivers/android/sync.c                     | 734 +++++++++++++++++++++++++++++
 drivers/android/sync.h                     | 387 +++++++++++++++
 drivers/android/sync_debug.c               | 256 ++++++++++
 drivers/android/trace/sync.h               |  82 ++++
 drivers/gpu/drm/i915/Kconfig               |   3 +
 drivers/gpu/drm/i915/i915_debugfs.c        |   7 +-
 drivers/gpu/drm/i915/i915_drv.h            |  75 +--
 drivers/gpu/drm/i915/i915_gem.c            | 437 ++++++++++++++++-
 drivers/gpu/drm/i915/i915_gem_context.c    |  15 +-
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |  95 +++-
 drivers/gpu/drm/i915/i915_irq.c            |   2 +-
 drivers/gpu/drm/i915/i915_trace.h          |  13 +-
 drivers/gpu/drm/i915/intel_display.c       |   4 +-
 drivers/gpu/drm/i915/intel_lrc.c           |  13 +
 drivers/gpu/drm/i915/intel_pm.c            |   6 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c    |   5 +
 drivers/gpu/drm/i915/intel_ringbuffer.h    |   9 +
 drivers/staging/android/Kconfig            |  28 --
 drivers/staging/android/Makefile           |   2 -
 drivers/staging/android/sw_sync.c          | 260 ----------
 drivers/staging/android/sw_sync.h          |  59 ---
 drivers/staging/android/sync.c             | 729 ----------------------------
 drivers/staging/android/sync.h             | 356 --------------
 drivers/staging/android/sync_debug.c       | 254 ----------
 drivers/staging/android/trace/sync.h       |  82 ----
 drivers/staging/android/uapi/sw_sync.h     |  32 --
 drivers/staging/android/uapi/sync.h        |  97 ----
 include/uapi/Kbuild                        |   1 +
 include/uapi/drm/i915_drm.h                |  16 +-
 include/uapi/sync/Kbuild                   |   3 +
 include/uapi/sync/sw_sync.h                |  32 ++
 include/uapi/sync/sync.h                   |  97 ++++
 36 files changed, 2569 insertions(+), 1971 deletions(-)
 create mode 100644 drivers/android/sw_sync.c
 create mode 100644 drivers/android/sw_sync.h
 create mode 100644 drivers/android/sync.c
 create mode 100644 drivers/android/sync.h
 create mode 100644 drivers/android/sync_debug.c
 create mode 100644 drivers/android/trace/sync.h
 delete mode 100644 drivers/staging/android/sw_sync.c
 delete mode 100644 drivers/staging/android/sw_sync.h
 delete mode 100644 drivers/staging/android/sync.c
 delete mode 100644 drivers/staging/android/sync.h
 delete mode 100644 drivers/staging/android/sync_debug.c
 delete mode 100644 drivers/staging/android/trace/sync.h
 delete mode 100644 drivers/staging/android/uapi/sw_sync.h
 delete mode 100644 drivers/staging/android/uapi/sync.h
 create mode 100644 include/uapi/sync/Kbuild
 create mode 100644 include/uapi/sync/sw_sync.h
 create mode 100644 include/uapi/sync/sync.h
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx