RFC staging: Android sync driver
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest30 patches 10 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/30 | staging: sync: Add synchronization frameworkdrivers/ drivers/ drivers/ +1 more | +849 | 0 replies | |
| 2/30 | staging: sw_sync: Add cpu based sync driverdrivers/ drivers/ drivers/ +1 more | +301 | 0 replies | |
| 3/30 | staging: sync: Add timestamps to sync_ptsdrivers/ drivers/ | +10 | 0 replies | |
| 4/30 | staging: sync: Add debugfs supportdrivers/ drivers/ | +191 | 0 replies | |
| 5/30 | staging: sw_sync: Add debug supportdrivers/ | +19 | 0 replies | |
| 6/30 | staging: sync: Add ioctl to get fence datadrivers/ drivers/ | +138 | 0 replies | |
| 7/30 | staging: sw_sync: Add fill_driver_data supportdrivers/ | +14 | 0 replies | |
| 8/30 | staging: sync: Add poll supportdrivers/ | +17 | 0 replies | |
| 9/30 | staging: sync: Allow async waits to be canceleddrivers/ drivers/ | +60 | 0 replies | |
| 10/30 | staging: sync: Export sync API symbolsdrivers/ | +14 | 6 replies | |
| 11/30 | staging: sw_sync: Export sw_sync APIdrivers/ | +4 | 0 replies | |
| 12/30 | staging: sync: Reorder sync_fence_releasedrivers/ | +2 | 0 replies | |
| 13/30 | staging: sync: Optimize fence mergesdrivers/ | +51 | 0 replies | |
| 14/30 | staging: sync: Add internal refcounting to fencesdrivers/ drivers/ | +51 | 0 replies | |
| 15/30 | staging: sync: Add reference counting to timelinesdrivers/ drivers/ | +15 | 0 replies | |
| 16/30 | staging: sync: Fix error pathsdrivers/ | +7 | 0 replies | |
| 17/30 | staging: sw_sync: Fix error pathsdrivers/ | +7 | 0 replies | |
| 18/30 | staging: sync: Change wait timeout to mirror poll semanticsdrivers/ drivers/ | +7 | 0 replies | |
| 19/30 | staging: sync: Dump sync state to console on timeoutdrivers/ | +32 | 0 replies | |
| 20/30 | staging: sync: Improve timeout dump messagesdrivers/ | +4 | 0 replies | |
| 21/30 | staging: sync: Dump sync state on fence errorsdrivers/ | +4 | 0 replies | |
| 22/30 | staging: sync: Protect unlocked access to fence statusdrivers/ | +17 | 0 replies | |
| 23/30 | staging: sync: Update new fence status with sync_fence_signal_ptdrivers/ | +13 | 0 replies | |
| 24/30 | staging: sync: Use proper barriers when waiting indefinitelydrivers/ | +2 | 0 replies | |
| 25/30 | staging: sync: Refactor sync debug printingdrivers/ drivers/ | +29 | 0 replies | |
| 26/30 | staging: sw_sync: Convert to use new value_str debug opsdrivers/ | +17 | 0 replies | |
| 27/30 | staging: sync: Add tracepoint supportdrivers/ drivers/ | +93 | 0 replies | |
| 28/30 | staging: sync: Fix race condition between merge and signaldrivers/ | +7 | 0 replies | |
| 29/30 | staging: sync: Don't log wait timeouts when timeout = 0drivers/ | +1 | 0 replies | |
| 30/30 | staging: sync: Fix timeout = 0 wait behaviordrivers/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC][PATCH 00/30] staging: Android sync driver
As proposed yesterday, here's the Android sync driver patches for staging.
I've preserved the commit history, but moved all the changes over to be against the staging directory (instead of drivers/base).
The goal of submitting this driver to staging is to try to get more collaberation, as there are some similar efforts going on in the community with dmabuf-fences. My email from yesterday with more details for how I hope this goes is here:
http://comments.gmane.org/gmane.linux.kernel/1448420
Erik also provided a nice background on the patch set in his reply yesterday, which I'll quote here:
"In Honeycomb where we introduced the Hardware Composer HAL. This is a userspace layer that allows composition acceleration on a per platform basis. Different SoC vendors have implemented this using overlays, 2d blitters, a combinations of both, or other clever/disgusting means. Along with the HWC we consolidated a lot of our camera and media pipeline to allow their input to be fed into the GPU or display(overlay.) In order to exploit parallelism the the graphics pipeline, this introduced lots of implicit synchronization dependancies. After a couple years of working with many different SoC vendors, we found that it was really difficult to communicate our system's expectations of the implicit contract and it was difficult for the SoC vendors to properly implement the implicit contract in each of their IP blocks (display, gpu, camera, video codecs). It was also incredibly difficult to debug when problems/deadlocks arose.
In an effort to clean up the situation we decided to create set of simple synchronization primitives and have our compositor (SurfaceFlinger) manage the synchronization contract explicitly. We designed these primitives so that they can be passed across processes (much like ion/dma_buf handles), can be backed by hardware synchronization primitives, and can be combined with other sync dependancies in a heterogeneous manner. We also added enough debugging information to make pinpointing a synchronization deadlock bug easier. There are also OpenGL extensions added (which I believe have been ratified by Khronos) to convert a "native" sync object to a gl fence object and vise versa.
So far shipped this system on two products (the Nexus 10 and 4) with two different SoCs (Samsung Exynos5250 and Qualcomm MSM8064.) These two projects were much easier to work out the kinks in the graphics/compositing pipelines. In addition we were able to use the telemetry and tracing features to track down the causes of dropped frames aka "jank."
As for the implementation, I started with having the main driver op primitive be a wait() op. I quickly noticed that most of the tricky race condition prone code was ending up in the drivers wait() op. It also made handling asynchronous waits of more than one type of sync_pt difficult to manage. In the end I opted for something roughly like poll() where all the heavy lifting is done at the high level and the drivers only need to implement a simple check function."
Anyway, let me know what you think of the patches, and hopefully this is something that could be considered for staging for 3.10
thanks
-john
Erik Gilling (26):
staging: sync: Add synchronization framework
staging: sw_sync: Add cpu based sync driver
staging: sync: Add timestamps to sync_pts
staging: sync: Add debugfs support
staging: sw_sync: Add debug support
staging: sync: Add ioctl to get fence data
staging: sw_sync: Add fill_driver_data support
staging: sync: Add poll support
staging: sync: Allow async waits to be canceled
staging: sync: Export sync API symbols
staging: sw_sync: Export sw_sync API
staging: sync: Reorder sync_fence_release
staging: sync: Optimize fence merges
staging: sync: Add internal refcounting to fences
staging: sync: Add reference counting to timelines
staging: sync: Change wait timeout to mirror poll semantics
staging: sync: Dump sync state to console on timeout
staging: sync: Improve timeout dump messages
staging: sync: Dump sync state on fence errors
staging: sync: Protect unlocked access to fence status
staging: sync: Update new fence status with sync_fence_signal_pt
staging: sync: Use proper barriers when waiting indefinitely
staging: sync: Refactor sync debug printing
staging: sw_sync: Convert to use new value_str debug ops
staging: sync: Add tracepoint support
staging: sync: Don't log wait timeouts when timeout = 0
Jamie Gennis (1):
staging: sync: Fix timeout = 0 wait behavior
Rebecca Schultz Zavin (2):
staging: sync: Fix error paths
staging: sw_sync: Fix error paths
Ørjan Eide (1):
staging: sync: Fix race condition between merge and signal
drivers/staging/android/Kconfig | 27 + drivers/staging/android/Makefile | 2 + drivers/staging/android/sw_sync.c | 263 +++++++++ drivers/staging/android/sw_sync.h | 58 ++ drivers/staging/android/sync.c | 1016 ++++++++++++++++++++++++++++++++++ drivers/staging/android/sync.h | 426 ++++++++++++++ drivers/staging/android/trace/sync.h | 82 +++ 7 files changed, 1874 insertions(+) create mode 100644 drivers/staging/android/sw_sync.c create mode 100644 drivers/staging/android/sw_sync.h create mode 100644 drivers/staging/android/sync.c create mode 100644 drivers/staging/android/sync.h create mode 100644 drivers/staging/android/trace/sync.h
Signature · 1 line
1.7.10.4