diff options
| author | 2023-04-07 22:37:19 +0000 | |
|---|---|---|
| committer | 2023-04-18 14:31:29 +0000 | |
| commit | 75e2d5131b31be1be12318e775dbe0ef6b1718c0 (patch) | |
| tree | 04edea240efcc17c36f1b1f9796f1cb6320812a4 /libs/androidfw/ObbFile.cpp | |
| parent | a1e56c40984e332fd4121772c5c875c1141d5244 (diff) | |
Ensure overlapping syncs don't submit buffers out of order
This change will ensure that if multiple SurfaceSyncGroups are created
for the same ViewRootImpl the SurfaceSyncGroups will maintain an order.
The scenario that could occur is the following:
1. SSG1 is created that includes the target VRI. There could be other
VRIs in SSG1
2. The target VRI draws its frame and marks its own active SSG as ready,
but SSG1 is still waiting on other things in the SSG
3. Another SSG2 is created for the target VRI. The second frame renders
and marks its own second SSG as complete. SSG2 has nothing else to
wait on, so it will apply at this point, even though SSG1 has not
finished.
4. Frame2 will get to SF first and Frame1 will later get to SF when
SSG1 completes.
The code ensures the SSGs that contains the VRI maintain an order. What
happens here is we create a new SSG that's a placeholder. Its only job
is to prevent a SSG from completing. The active SSG for VRI will add a
transaction committed callback and when that's invoked, it will mark the
placeholder SSG as ready. If a new request to create a SSG comes in and
the placeholder SSG is not null, it's added as part of the new active SSG.
A new placeholder SSG is created to correspond to the new active SSG.
This creates a chain to ensure the latter SSG always waits for the former
SSG's transaction to get to SF.
Test: SurfaceSyncGroupTests#testOverlappingSyncsEnsureOrder
Test: WmTests:com.android.server.wm.SurfaceSyncGroupTests
Bug: 272189296
Change-Id: I921d78e347ecfb9786ebe4643308b347c5436332
Diffstat (limited to 'libs/androidfw/ObbFile.cpp')
0 files changed, 0 insertions, 0 deletions