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

Issue 619453002: gpu: Remove Echo and SwapCompletion GL interfacess (Closed)

Created:
6 years, 2 months ago by no sievers
Modified:
6 years, 2 months ago
Reviewers:
Tom Sepez, jamesr, jbauman, piman
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, jam, yzshen+watch_chromium.org, sievers+watch_chromium.org, jbauman+watch_chromium.org, Aaron Boodman, darin-cc_chromium.org, kalyank, mkwst+moarreviews-renderer_chromium.org, piman+watch_chromium.org, danakj+watch_chromium.org, abarth-chromium, ben+mojo_chromium.org, darin (slow to review), Yufeng Shen (Slow to review)
Base URL:
https://chromium.googlesource.com/chromium/src.git@tits
Project:
chromium
Visibility:
Public.

Description

gpu: Remove Echo and SwapCompletion GL interfaces This functionality can be implemented with sync point callbacks. Now that swap completion is entirely an implementation detail of the OutputSurface this also allows for eliminating some IPC message redundancy. Ideally SwapCompletion would be unsolicited and also include LatencyInfo (where needed/supported). Also remove the message pattern matching logic in gpu_channel.cc for Flush/Echo. This kind of matching does not work reliably, since OnMessageReceived races with HandleMessage (i.e. the next msg might or might not be in deferred_messages_). Also, the original motivation in bug 407529 is described as making sure SwapBuffers gets handled immediately, which was separately fixed by merging the LatencyInfo with the Flush IPC. BUG=417945 Committed: https://crrev.com/42243047e7418892929a8e5b19fe12b9db4b9c4c Cr-Commit-Position: refs/heads/master@{#297869}

Patch Set 1 #

Patch Set 2 : remove entire swap and completion logic from gpu client code #

Patch Set 3 : rebase #

Total comments: 4

Patch Set 4 : keep Swap in ContextSupport, remove peeking logic #

Patch Set 5 : remove comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -231 lines) Patch
M cc/output/output_surface.cc View 1 2 3 3 chunks +6 lines, -5 lines 0 comments Download
M cc/test/test_context_support.h View 1 2 3 2 chunks +0 lines, -6 lines 0 comments Download
M cc/test/test_context_support.cc View 1 2 3 3 chunks +0 lines, -16 lines 0 comments Download
M content/common/gpu/client/command_buffer_proxy_impl.h View 3 chunks +0 lines, -5 lines 0 comments Download
M content/common/gpu/client/command_buffer_proxy_impl.cc View 1 2 3 chunks +0 lines, -21 lines 0 comments Download
M content/common/gpu/gpu_channel.h View 2 3 1 chunk +0 lines, -6 lines 0 comments Download
M content/common/gpu/gpu_channel.cc View 2 3 4 1 chunk +40 lines, -94 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.cc View 1 2 3 chunks +2 lines, -8 lines 0 comments Download
M content/common/gpu/gpu_messages.h View 1 2 1 chunk +0 lines, -8 lines 0 comments Download
M content/renderer/pepper/ppb_graphics_3d_impl.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M gpu/command_buffer/client/client_test_helper.h View 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/command_buffer/client/context_support.h View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.h View 1 2 3 3 chunks +0 lines, -7 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.cc View 1 2 3 2 chunks +2 lines, -19 lines 0 comments Download
M gpu/command_buffer/client/gpu_control.h View 1 chunk +0 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.h View 1 chunk +0 lines, -1 line 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M gpu/command_buffer/tests/gl_manager.h View 1 chunk +0 lines, -1 line 0 comments Download
M gpu/command_buffer/tests/gl_manager.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M gpu/gles2_conform_support/egl/display.h View 1 chunk +0 lines, -1 line 0 comments Download
M gpu/gles2_conform_support/egl/display.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M mojo/gles2/command_buffer_client_impl.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M mojo/gles2/command_buffer_client_impl.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M ppapi/proxy/ppapi_command_buffer_proxy.h View 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/proxy/ppapi_command_buffer_proxy.cc View 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 21 (3 generated)
no sievers
ptal
6 years, 2 months ago (2014-09-30 01:39:56 UTC) #2
no sievers
Ah wait.. I do have to keep the peeking logic, but apply it to RetireSyncPoint. ...
6 years, 2 months ago (2014-09-30 01:45:36 UTC) #3
no sievers
piman: everything jamesr: mojo stamp, or everything jbauman: for double-checking the generalization of MatchSwapBuffersMessagesPattern() in ...
6 years, 2 months ago (2014-09-30 21:53:12 UTC) #5
Tom Sepez
Rubberstamp LGTM on deleting messages. Thanks!
6 years, 2 months ago (2014-09-30 22:50:13 UTC) #6
jamesr
https://codereview.chromium.org/619453002/diff/40001/cc/test/test_gles2_interface.h File cc/test/test_gles2_interface.h (right): https://codereview.chromium.org/619453002/diff/40001/cc/test/test_gles2_interface.h#newcode193 cc/test/test_gles2_interface.h:193: virtual void SwapBuffers() OVERRIDE; sucks to encode these on ...
6 years, 2 months ago (2014-10-01 00:06:29 UTC) #7
no sievers
https://codereview.chromium.org/619453002/diff/40001/cc/test/test_gles2_interface.h File cc/test/test_gles2_interface.h (right): https://codereview.chromium.org/619453002/diff/40001/cc/test/test_gles2_interface.h#newcode193 cc/test/test_gles2_interface.h:193: virtual void SwapBuffers() OVERRIDE; On 2014/10/01 00:06:28, jamesr wrote: ...
6 years, 2 months ago (2014-10-01 00:12:53 UTC) #8
jamesr
On 2014/10/01 00:12:53, sievers wrote: > https://codereview.chromium.org/619453002/diff/40001/cc/test/test_gles2_interface.h > File cc/test/test_gles2_interface.h (right): > > https://codereview.chromium.org/619453002/diff/40001/cc/test/test_gles2_interface.h#newcode193 > ...
6 years, 2 months ago (2014-10-01 00:14:02 UTC) #9
no sievers
On 2014/10/01 00:14:02, jamesr wrote: > On 2014/10/01 00:12:53, sievers wrote: > > > https://codereview.chromium.org/619453002/diff/40001/cc/test/test_gles2_interface.h ...
6 years, 2 months ago (2014-10-01 00:51:12 UTC) #10
piman
LGTM, thanks for cleanup! We can move SwapBuffers/PostSubBuffers to ContextSupport if it's practical, but I ...
6 years, 2 months ago (2014-10-01 02:03:31 UTC) #11
jamesr
It's not a super huge deal either way. This cleanup is great either way. mojo/ ...
6 years, 2 months ago (2014-10-01 02:04:39 UTC) #12
jbauman
lgtm https://codereview.chromium.org/619453002/diff/40001/content/common/gpu/gpu_channel.cc File content/common/gpu/gpu_channel.cc (right): https://codereview.chromium.org/619453002/diff/40001/content/common/gpu/gpu_channel.cc#newcode680 content/common/gpu/gpu_channel.cc:680: // SwapBuffer should be AsyncFlush->Echo. We only try ...
6 years, 2 months ago (2014-10-01 02:15:38 UTC) #13
jbauman
https://codereview.chromium.org/619453002/diff/40001/content/common/gpu/gpu_channel.cc File content/common/gpu/gpu_channel.cc (right): https://codereview.chromium.org/619453002/diff/40001/content/common/gpu/gpu_channel.cc#newcode680 content/common/gpu/gpu_channel.cc:680: // SwapBuffer should be AsyncFlush->Echo. We only try to ...
6 years, 2 months ago (2014-10-01 02:21:00 UTC) #14
no sievers
Ok so I have left (Partial)Swap in ContextSupport. I think it does make more sense ...
6 years, 2 months ago (2014-10-01 21:54:49 UTC) #15
piman
LGTM. Adding a Flush+InsertSyncPoint IPC seems like a good idea.
6 years, 2 months ago (2014-10-02 17:42:52 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/619453002/80001
6 years, 2 months ago (2014-10-02 18:29:48 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:80001) as da4b00b9cd2c89a5facd0d522b0435ce516a6da6
6 years, 2 months ago (2014-10-02 18:35:29 UTC) #19
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/42243047e7418892929a8e5b19fe12b9db4b9c4c Cr-Commit-Position: refs/heads/master@{#297869}
6 years, 2 months ago (2014-10-02 18:36:19 UTC) #20
no sievers
6 years, 2 months ago (2014-10-03 01:55:04 UTC) #21
Message was sent while issue was closed.
On 2014/10/02 17:42:52, piman (Very slow to review) wrote:
> LGTM. Adding a Flush+InsertSyncPoint IPC seems like a good idea.

So I just realized that for a Flush+InsertSyncPoint-command to be very useful it
would also have to imply the deep flush/glFlush because the pattern is not
unlikely to be like this:

void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
...

  context->Flush();
  uint32 sync_point = context->InsertSyncPointCHROMIUM(); // So this already
doesn't send a Flush IPC
}

That however might cause us to deep flush more often than desirable.

I wonder if it's better to move in a direction where the client uses less
synchronization primitives, ideally only sync points and doesn't use shallow or
deep flushes anymore. It's better for the service to use the best working
primitive available (glFlush or fence, or neither with virtual contexts). And
then you could optimize further, for example we might then be able to update
'put' through shared memory (like we do for get). And the service might also be
able to make better scheduling decisions unlike when flush is entirely
client-driven (it could decide to parse on its own when it has no work).

Powered by Google App Engine
This is Rietveld 408576698