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

Issue 24070006: cc: Implement deadline scheduling disabled by default (Closed)

Created:
7 years, 3 months ago by brianderson
Modified:
7 years, 2 months ago
Reviewers:
danakj, Sami, enne (OOO)
CC:
chromium-reviews, cc-bugs_chromium.org, piman, klobag.chromium, jdduke (slow), Sami, nduca
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

cc: Implement deadline scheduling disabled by default This patch adds logic to the Scheduler to actually use the BeginFrame and deadline, but is not enabled by default on any platform yet. This will ensure emulation of old scheduler in the fallback path is sane. Emulation of the old path is implemented using an immediate deadline. SchedulerStateMachine::begin_frame_state has been added and can be in one of 4 states: Idle, InsideBeginFrame, DeadlinePending, or InsideDeadline. Notable restrictions of the states are: - We start a commit as soon after InsideBeginFrame as we can, since the BeginFrame will be coordinated with user input. (True on Android. Soon to be true on other platforms.) - We do not start a commit while Idle, in order to wait for the next batch of user input. - Draw and swap only occurs during the InsideDeadline state. The deadlines of the Browser and Renderer compositors can be nested in order to have a total draw latency of < 1 frame when starting off. If we can't hit 1 frame of latency consistently, we will fall back to a higher latency mode to increase throughput. TBR=enne@chromium.org BUG=243461 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=224560

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1261 lines, -588 lines) Patch
M cc/output/begin_frame_args.h View 1 chunk +1 line, -3 lines 0 comments Download
M cc/output/begin_frame_args.cc View 2 chunks +7 lines, -4 lines 0 comments Download
M cc/output/output_surface.h View 3 chunks +5 lines, -5 lines 0 comments Download
M cc/output/output_surface.cc View 4 chunks +12 lines, -11 lines 0 comments Download
M cc/output/output_surface_unittest.cc View 7 chunks +36 lines, -19 lines 0 comments Download
M cc/scheduler/frame_rate_controller.cc View 2 chunks +6 lines, -7 lines 0 comments Download
M cc/scheduler/scheduler.h View 5 chunks +8 lines, -0 lines 0 comments Download
M cc/scheduler/scheduler.cc View 9 chunks +90 lines, -29 lines 2 comments Download
M cc/scheduler/scheduler_settings.h View 1 chunk +1 line, -0 lines 0 comments Download
M cc/scheduler/scheduler_settings.cc View 1 chunk +2 lines, -1 line 0 comments Download
M cc/scheduler/scheduler_state_machine.h View 7 chunks +41 lines, -15 lines 0 comments Download
M cc/scheduler/scheduler_state_machine.cc View 20 chunks +136 lines, -40 lines 0 comments Download
M cc/scheduler/scheduler_state_machine_unittest.cc View 55 chunks +548 lines, -352 lines 0 comments Download
M cc/scheduler/scheduler_unittest.cc View 30 chunks +322 lines, -72 lines 0 comments Download
M cc/trees/layer_tree_host_impl.h View 2 chunks +3 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 4 chunks +9 lines, -9 lines 0 comments Download
M cc/trees/layer_tree_settings.h View 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_settings.cc View 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/thread_proxy.h View 2 chunks +3 lines, -0 lines 0 comments Download
M cc/trees/thread_proxy.cc View 8 chunks +29 lines, -19 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
brianderson
7 years, 3 months ago (2013-09-20 18:00:08 UTC) #1
brianderson
Carrying over enne's lgtm with TBR. I talked with Tom and Vangelis. If I land ...
7 years, 3 months ago (2013-09-20 22:42:07 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/brianderson@chromium.org/24070006/1
7 years, 3 months ago (2013-09-20 22:43:14 UTC) #3
commit-bot: I haz the power
Change committed as 224560
7 years, 3 months ago (2013-09-21 04:10:10 UTC) #4
Sami
https://codereview.chromium.org/24070006/diff/1/cc/scheduler/scheduler.cc File cc/scheduler/scheduler.cc (right): https://codereview.chromium.org/24070006/diff/1/cc/scheduler/scheduler.cc#newcode210 cc/scheduler/scheduler.cc:210: // frame time) properly instead of using this hack. ...
7 years, 2 months ago (2013-09-25 13:42:51 UTC) #5
brianderson
7 years, 2 months ago (2013-10-02 11:30:14 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/24070006/diff/1/cc/scheduler/scheduler.cc
File cc/scheduler/scheduler.cc (right):

https://codereview.chromium.org/24070006/diff/1/cc/scheduler/scheduler.cc#new...
cc/scheduler/scheduler.cc:210: // frame time) properly instead of using this
hack.
On 2013/09/25 13:42:52, Sami wrote:
> Just curious: was the idea to handle this with a proactive BeginFrame or did
you
> have something else in mind? Reusing the expired BeginFrame like this is still
> likely faster, but might cause trouble on the browser compositor side.

Yes, we would enter this case if a proactive BeginFrame was requested because of
a pending commit, but there were no impl-side animations or input handlers.

This case could cause us to draw after the deadline, but there is no reason to
wait for the next BeginFrame since the result of drawing then will be the same. 
The deadline is pretty fuzzy, so we might still make it in time for the browser
compositor to pick it up and make its own deadline.  If not, the browser
compositor needs to handle cases when the renderer misses its deadline anyway,
in which case we should end up in a high-latency mode if we were previously in a
low-latency mode (and the browser compositor couldn't wait before drawing its
next frame), or a skipped frame if we are already in a high-latency mode.

Powered by Google App Engine
This is Rietveld 408576698