Descriptiongpu: GPU service scheduler.
The GPU service scheduler runs tasks (closures) containing command
buffer work. Tasks are enqueued in sequences which represent indepdent
streams of execution. A task in one sequence may wait on a sync token
fence that's released on another sequence. Tasks can specify their sync
token fences beforehand so that the scheduler won't run a sequence only
to disable it due to a sync token wait. Tasks can check if they should
yield so that a higher priority task may run. If a task decides to
yield, it can continue execution by supplying a new closure which will
run before any other scheduled tasks in that sequence.
The scheduler maintains a priority queue of sequences ordered by
sequence priority and then order number. Priority inversion because of
sync token dependencies is handled by a simple priority ceiling scheme.
Sequences which are expected to release sync tokens dependencies are
assigned a priority (HIGH) that's higher than any client specified
priorities. However, browser view context sequences can have an even
higher priority (REAL_TIME).
GPU channel IPC messages are run as tasks in the scheduler. Each client
side stream is mapped to a sequence. The client is expected to use a
small number of streams to partition its command buffers so there is no
tracking of stream lifetimes in the service. The message filter posts
messages as tasks. AsyncFlush is the only message for which sync token
dependencies are given to the scheduler.
The initial implementation uses the GPU main thread to run scheduled
tasks. Future implementations, for example, could use a worker pool
with task traits to specify which thread a task should run on.
R=piman@chromium.org
BUG=514813
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Review-Url: https://codereview.chromium.org/2814843002
Cr-Commit-Position: refs/heads/master@{#471187}
Committed: https://chromium.googlesource.com/chromium/src/+/e7e36ccdaa3fcf63b330bc956eeeb73abf7c39ea
Patch Set 1 #Patch Set 2 : move gpu_stream_constants #Patch Set 3 : more tests #Patch Set 4 : Do not allow HIGH priority contexts by unprivileged clients. #Patch Set 5 : Do not allow HIGH priority contexts by unprivileged clients. #
Total comments: 2
Patch Set 6 : gpu: Use adaptive vsync for GLX surface. #Patch Set 7 : revert patch applied by mistake #Patch Set 8 : rebase #Patch Set 9 : enable async worker context only when gpu scheduler is enabled #Patch Set 10 : temporarily enable gpu scheduler because perf bots can't deal with command line args #Patch Set 11 : rebase and revert gpu scheduler flag forced on #Patch Set 12 : flush worker context every frame #Patch Set 13 : rebase #
Total comments: 31
Patch Set 14 : Revert "flush worker context every frame" #Patch Set 15 : review #Patch Set 16 : enum -> enum class #
Total comments: 4
Patch Set 17 : nits #Patch Set 18 : fix test dcheck failures #Messages
Total messages: 44 (24 generated)
|