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

Issue 2550583002: gpu: Thread-safe command buffer state lookup. (Closed)

Created:
4 years ago by sunnyps
Modified:
4 years ago
Reviewers:
piman, jbauman, ericrk
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, jam, darin-cc_chromium.org, piman+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

gpu: Thread-safe command buffer state lookup. This makes client side (in-process / proxy) command buffer state thread- safe and adds release count to the client-server shared state. This allows the compositor thread to monitor worker context sync token in the service. Client side command buffer state is synchronized using a lock. Extra caching of the state is added to command buffer helper so that it doesn't acquire the lock for every command. Also fixes command buffer memory tracing so that it happens on the same thread which the context provider is bound to. R=piman@chromium.org,jbauman@chromium.org BUG=514813, 638862 CQ_INCLUDE_TRYBOTS=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 Committed: https://crrev.com/1285660590d371fedced6253c43be569c2d054ee Cr-Commit-Position: refs/heads/master@{#437651}

Patch Set 1 #

Total comments: 23

Patch Set 2 : piman's review #

Total comments: 11

Patch Set 3 : piman review 2 #

Patch Set 4 : state_lock_ -> last_state_lock_ #

Total comments: 2

Patch Set 5 : fix pixel readback test by calling PerformIdleWork #

Patch Set 6 : move cmd buffer helper memory dump to context provider #

Total comments: 6

Patch Set 7 : jbauman's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+390 lines, -310 lines) Patch
M cc/test/test_context_support.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M cc/test/test_context_support.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/gpu/client/context_provider_command_buffer.cc View 1 2 3 4 5 2 chunks +5 lines, -2 lines 0 comments Download
M content/renderer/pepper/ppb_graphics_3d_impl.cc View 1 chunk +2 lines, -4 lines 0 comments Download
M gpu/command_buffer/client/client_test_helper.h View 1 2 chunks +4 lines, -3 lines 0 comments Download
M gpu/command_buffer/client/client_test_helper.cc View 1 3 chunks +21 lines, -25 lines 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper.h View 1 2 3 4 5 6 9 chunks +14 lines, -40 lines 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper.cc View 1 2 3 4 5 6 14 chunks +48 lines, -30 lines 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper_test.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M gpu/command_buffer/client/context_support.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M gpu/command_buffer/client/gles2_implementation.cc View 1 2 2 chunks +6 lines, -11 lines 0 comments Download
M gpu/command_buffer/client/gpu_control.h View 1 1 chunk +18 lines, -7 lines 0 comments Download
M gpu/command_buffer/client/ring_buffer.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M gpu/command_buffer/common/cmd_buffer_common.cc View 1 1 chunk +0 lines, -11 lines 0 comments Download
M gpu/command_buffer/common/command_buffer.h View 1 2 3 4 5 6 5 chunks +7 lines, -20 lines 0 comments Download
M gpu/command_buffer/common/command_buffer_mock.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/command_buffer_service.h View 1 3 chunks +7 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/command_buffer_service.cc View 1 5 chunks +18 lines, -12 lines 0 comments Download
M gpu/command_buffer/tests/gl_manager.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M gpu/command_buffer/tests/gl_manager.cc View 1 2 3 4 3 chunks +9 lines, -0 lines 0 comments Download
M gpu/command_buffer/tests/gl_readback_unittest.cc View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M gpu/gles2_conform_support/egl/context.h View 1 chunk +1 line, -0 lines 0 comments Download
M gpu/gles2_conform_support/egl/context.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M gpu/ipc/client/command_buffer_proxy_impl.h View 1 2 3 6 chunks +16 lines, -15 lines 0 comments Download
M gpu/ipc/client/command_buffer_proxy_impl.cc View 1 2 3 27 chunks +119 lines, -38 lines 0 comments Download
M gpu/ipc/in_process_command_buffer.h View 1 2 5 chunks +5 lines, -7 lines 0 comments Download
M gpu/ipc/in_process_command_buffer.cc View 1 2 9 chunks +34 lines, -42 lines 0 comments Download
M gpu/ipc/service/gpu_command_buffer_stub.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/proxy/ppapi_command_buffer_proxy.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
M ppapi/proxy/ppapi_command_buffer_proxy.cc View 1 5 chunks +22 lines, -26 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 36 (21 generated)
sunnyps
This is not final but PTAL jbauman@ pointed out that GetLastToken gets called a lot ...
4 years ago (2016-12-02 02:52:03 UTC) #2
sunnyps
jbauman@ suggested that we use a separate shared state for release count as it is ...
4 years ago (2016-12-02 03:20:50 UTC) #3
piman
https://codereview.chromium.org/2550583002/diff/1/gpu/command_buffer/client/cmd_buffer_helper.cc File gpu/command_buffer/client/cmd_buffer_helper.cc (right): https://codereview.chromium.org/2550583002/diff/1/gpu/command_buffer/client/cmd_buffer_helper.cc#newcode275 gpu/command_buffer/client/cmd_buffer_helper.cc:275: command_buffer_->WaitForTokenInRange(token, token_); Let's cache the new get (and token ...
4 years ago (2016-12-02 19:21:48 UTC) #4
sunnyps
PTAL Will write up CL description tomorrow. https://codereview.chromium.org/2550583002/diff/1/gpu/command_buffer/client/cmd_buffer_helper.cc File gpu/command_buffer/client/cmd_buffer_helper.cc (right): https://codereview.chromium.org/2550583002/diff/1/gpu/command_buffer/client/cmd_buffer_helper.cc#newcode275 gpu/command_buffer/client/cmd_buffer_helper.cc:275: command_buffer_->WaitForTokenInRange(token, token_); ...
4 years ago (2016-12-07 03:31:22 UTC) #7
piman
https://codereview.chromium.org/2550583002/diff/20001/gpu/command_buffer/client/gpu_control.h File gpu/command_buffer/client/gpu_control.h (right): https://codereview.chromium.org/2550583002/diff/20001/gpu/command_buffer/client/gpu_control.h#newcode105 gpu/command_buffer/client/gpu_control.h:105: // the lock provided by the client. Are there ...
4 years ago (2016-12-07 20:30:13 UTC) #10
sunnyps
PTAL Made ContextProviderCommandBuffer dump memory trace (under lock) from GLES2Impl instead of directly registering GLES2Impl ...
4 years ago (2016-12-08 01:14:16 UTC) #13
piman
lgtm https://codereview.chromium.org/2550583002/diff/60001/gpu/ipc/in_process_command_buffer.cc File gpu/ipc/in_process_command_buffer.cc (right): https://codereview.chromium.org/2550583002/diff/60001/gpu/ipc/in_process_command_buffer.cc#newcode650 gpu/ipc/in_process_command_buffer.cc:650: last_put_offset_ = 0; Nice catch!
4 years ago (2016-12-08 01:21:47 UTC) #14
ericrk
https://codereview.chromium.org/2550583002/diff/60001/content/common/gpu/client/context_provider_command_buffer.cc File content/common/gpu/client/context_provider_command_buffer.cc (right): https://codereview.chromium.org/2550583002/diff/60001/content/common/gpu/client/context_provider_command_buffer.cc#newcode457 content/common/gpu/client/context_provider_command_buffer.cc:457: gles2_impl_->OnMemoryDump(args, pmd); Seems like this will fix crbug.com/638862, can ...
4 years ago (2016-12-08 01:59:39 UTC) #16
ericrk
4 years ago (2016-12-08 01:59:42 UTC) #17
sunnyps
PTAL Made the pixel readback test call PerformIdleWork so that the callbacks which cause the ...
4 years ago (2016-12-09 02:32:27 UTC) #20
jbauman
lgtm with a few nits. https://codereview.chromium.org/2550583002/diff/100001/gpu/command_buffer/client/cmd_buffer_helper.cc File gpu/command_buffer/client/cmd_buffer_helper.cc (right): https://codereview.chromium.org/2550583002/diff/100001/gpu/command_buffer/client/cmd_buffer_helper.cc#newcode279 gpu/command_buffer/client/cmd_buffer_helper.cc:279: return; We should try ...
4 years ago (2016-12-09 03:16:04 UTC) #21
sunnyps
Thanks! https://codereview.chromium.org/2550583002/diff/100001/gpu/command_buffer/client/cmd_buffer_helper.cc File gpu/command_buffer/client/cmd_buffer_helper.cc (right): https://codereview.chromium.org/2550583002/diff/100001/gpu/command_buffer/client/cmd_buffer_helper.cc#newcode279 gpu/command_buffer/client/cmd_buffer_helper.cc:279: return; On 2016/12/09 03:16:03, jbauman wrote: > We ...
4 years ago (2016-12-09 04:09:37 UTC) #24
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/2550583002/120001
4 years ago (2016-12-09 20:13:10 UTC) #30
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years ago (2016-12-09 21:07:19 UTC) #33
sunnyps
4 years ago (2016-12-10 01:07:24 UTC) #35
Message was sent while issue was closed.
This landed as 1285660590d371fedced6253c43be569c2d054ee (r437651) but commit bot
hasn't updated this CL for some reason :/

Powered by Google App Engine
This is Rietveld 408576698