Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Issue 2183333003: cc: Post the missed BeginFrame to a new stack (Closed)

Created:
4 years, 4 months ago by danakj
Modified:
4 years, 4 months ago
Reviewers:
sunnyps, jbauman
CC:
chromium-reviews, cc-bugs_chromium.org, brianderson, enne (OOO), piman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

cc: Post the missed BeginFrame to a new stack When the UI compositor (or any compositor with a Display attached to it in process - such as layout tests) does SwapBuffers, it submits the CompositorFrame to the SurfaceFactory. The SurfaceFactory pokes the DisplayScheduler, which can lead to it doing the Display::DrawAndSwap immediately, in the same callstack. In that case, the callback to the SurfaceDisplayOutputSurface (or the TestDelegatingOutputSurface) that it drew happens inline also, which was previously calling out to the OutputSurfaceClient. The problem is, the compositor expects SwapBuffers() to return before it hears that DidSwapBuffersComplete(). To avoid this, and similar problems, we prevent DisplayScheduler from running a new BeginFrame inside an external call to DisplayScheduler::SurfaceDamaged() which prevents re-entrancy for its clients. We do this by posting the missed BeginFrame to respond to it on a new stack (and cancelling it if another BeginFrame comes in the meantime since it was already posted). For TestDelegatedOutputSurface synchronous composites, we simply post the SwapBuffersComplete message to get it on a new call stack. R=jbauman BUG=495650 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/e15b5e856818e2113a4b23cd8b6ad5cee521a126 Cr-Commit-Position: refs/heads/master@{#408289}

Patch Set 1 #

Patch Set 2 : post-swapcomplete: . #

Patch Set 3 : post-swapcomplete: comment #

Patch Set 4 : post-swapcomplete: ignoreresult #

Total comments: 4

Patch Set 5 : post-swapcomplete: . #

Patch Set 6 : post-swapcomplete: oh-and-remove #

Total comments: 7

Patch Set 7 : post-swapcomplete: sunnyreview #

Patch Set 8 : post-swapcomplete: comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -4 lines) Patch
M cc/surfaces/display_scheduler.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M cc/surfaces/display_scheduler.cc View 1 2 3 4 5 6 7 6 chunks +32 lines, -0 lines 0 comments Download
M cc/test/test_delegating_output_surface.h View 1 1 chunk +1 line, -1 line 0 comments Download
M cc/test/test_delegating_output_surface.cc View 1 1 chunk +14 lines, -3 lines 0 comments Download

Messages

Total messages: 54 (33 generated)
danakj
4 years, 4 months ago (2016-07-27 00:48:23 UTC) #3
jbauman
lgtm
4 years, 4 months ago (2016-07-27 00:51:51 UTC) #5
sunnyps
This is ok but I think fundamentally the problem is with DisplayScheduler which calls AddObserver ...
4 years, 4 months ago (2016-07-27 00:53:13 UTC) #7
danakj
On 2016/07/27 00:53:13, sunnyps wrote: > This is ok but I think fundamentally the problem ...
4 years, 4 months ago (2016-07-27 00:55:27 UTC) #8
chromium-reviews
cc scheduler CL that adds the PostTask for begin frame: https://codereview.chromium.org/2158023005/ Ignore the retro frame ...
4 years, 4 months ago (2016-07-27 00:59:06 UTC) #9
danakj
PTAL
4 years, 4 months ago (2016-07-27 01:43:13 UTC) #11
danakj
And now with IgnoreResult tricks.
4 years, 4 months ago (2016-07-27 01:50:25 UTC) #15
sunnyps
The missed frame callback should also be cancelled when we call RemoveObserver. https://codereview.chromium.org/2183333003/diff/60001/cc/surfaces/display_scheduler.cc File cc/surfaces/display_scheduler.cc ...
4 years, 4 months ago (2016-07-27 02:00:14 UTC) #18
danakj
https://codereview.chromium.org/2183333003/diff/60001/cc/surfaces/display_scheduler.cc File cc/surfaces/display_scheduler.cc (right): https://codereview.chromium.org/2183333003/diff/60001/cc/surfaces/display_scheduler.cc#newcode103 cc/surfaces/display_scheduler.cc:103: inside_add_observer_ = true; On 2016/07/27 02:00:14, sunnyps wrote: > ...
4 years, 4 months ago (2016-07-27 02:19:05 UTC) #19
danakj
PTAL
4 years, 4 months ago (2016-07-27 02:19:58 UTC) #20
danakj
On 2016/07/27 02:00:14, sunnyps wrote: > The missed frame callback should also be cancelled when ...
4 years, 4 months ago (2016-07-27 02:21:42 UTC) #21
sunnyps
On 2016/07/27 02:19:05, danakj wrote: > https://codereview.chromium.org/2183333003/diff/60001/cc/surfaces/display_scheduler.cc > File cc/surfaces/display_scheduler.cc (right): > > https://codereview.chromium.org/2183333003/diff/60001/cc/surfaces/display_scheduler.cc#newcode103 > ...
4 years, 4 months ago (2016-07-27 05:09:57 UTC) #27
sunnyps
LGTM % nits + comment about inside_surface_damaged_ https://codereview.chromium.org/2183333003/diff/100001/cc/surfaces/display_scheduler.cc File cc/surfaces/display_scheduler.cc (right): https://codereview.chromium.org/2183333003/diff/100001/cc/surfaces/display_scheduler.cc#newcode175 cc/surfaces/display_scheduler.cc:175: // If ...
4 years, 4 months ago (2016-07-27 05:21:02 UTC) #28
danakj
https://codereview.chromium.org/2183333003/diff/100001/cc/surfaces/display_scheduler.cc File cc/surfaces/display_scheduler.cc (right): https://codereview.chromium.org/2183333003/diff/100001/cc/surfaces/display_scheduler.cc#newcode175 cc/surfaces/display_scheduler.cc:175: // If we get another BeginFrame before a posted ...
4 years, 4 months ago (2016-07-27 22:34:56 UTC) #29
sunnyps
https://codereview.chromium.org/2183333003/diff/100001/cc/surfaces/display_scheduler.cc File cc/surfaces/display_scheduler.cc (right): https://codereview.chromium.org/2183333003/diff/100001/cc/surfaces/display_scheduler.cc#newcode175 cc/surfaces/display_scheduler.cc:175: // If we get another BeginFrame before a posted ...
4 years, 4 months ago (2016-07-27 22:44:38 UTC) #37
danakj
On Wed, Jul 27, 2016 at 3:44 PM, <sunnyps@chromium.org> wrote: > > > https://codereview.chromium.org/2183333003/diff/100001/cc/surfaces/display_scheduler.cc > ...
4 years, 4 months ago (2016-07-27 22:48:42 UTC) #38
danakj
Done. jbauman you're cool with this too?
4 years, 4 months ago (2016-07-27 22:50:01 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2183333003/140001
4 years, 4 months ago (2016-07-27 22:50:21 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2183333003/140001
4 years, 4 months ago (2016-07-28 00:06:32 UTC) #50
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 4 months ago (2016-07-28 00:11:41 UTC) #52
commit-bot: I haz the power
4 years, 4 months ago (2016-07-28 00:14:13 UTC) #54
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/e15b5e856818e2113a4b23cd8b6ad5cee521a126
Cr-Commit-Position: refs/heads/master@{#408289}

Powered by Google App Engine
This is Rietveld 408576698